From 03ea997c3b70b1a120448749f9238c06b6f05174 Mon Sep 17 00:00:00 2001 From: Rikin Kachhia Date: Tue, 20 Aug 2019 19:12:15 +0530 Subject: [PATCH] add schema permissions summary page + update table permissions page (#2693) Schema permissions summary page * show summary of access control for all roles across tables and actions * allow copy of permissions from one role to others Table permissions page * highlight actions and roles as headers in table * move bulk action selector to end of row * scroll to edit/bulk section when opened * pre-select table and action in clone section --- console/src/components/Common/Common.scss | 41 +- .../GqlCompatibilityWarning.js | 26 +- .../Common/Layout/LeftSubSidebar/function.svg | 4 +- .../Layout/LeftSubSidebar/function_active.svg | 54 + .../Layout/LeftSubSidebar/function_high.svg | 41 - console/src/components/Common/Modal/Modal.js | 37 + .../Common/{ => Modal}/ModalWrapper.js | 0 .../components/Common/TableCommon/Table.scss | 9 - .../Common/WarningSymbol/WarningSymbol.js | 28 + .../WarningSymbol.scss} | 2 +- .../src/components/Common/utils/jsUtils.js | 49 + .../src/components/Common/utils/pgUtils.js | 103 ++ .../components/Common/utils/routesUtils.js | 59 + .../src/components/Common/utils/urlUtils.js | 3 + .../components/Common/utils/v1QueryUtils.js | 25 + console/src/components/Main/Main.js | 187 ++- console/src/components/Main/Main.scss | 10 +- console/src/components/Main/Tooltips.js | 29 +- .../src/components/Services/About/About.js | 10 +- .../ApiExplorer/ApiRequest/ApiRequest.js | 6 +- .../components/Services/Data/Add/AddTable.js | 15 +- .../ReusableComponents/ForeignKeySelector.js | 54 +- .../components/Services/Data/DataRouter.js | 5 + .../Services/Data/DataSubSidebar.js | 144 +-- .../PermissionsSummary/PermissionsSummary.js | 1066 +++++++++++++++++ .../PermissionsSummary.scss | 73 ++ .../Services/Data/PermissionsSummary/utils.js | 106 ++ .../components/Services/Data/RawSQL/RawSQL.js | 39 +- .../components/Services/Data/Schema/Schema.js | 117 +- .../Services/Data/Schema/Tooltips.js | 10 +- .../Data/TableModify/ModifyTable.scss | 265 ---- .../Services/Data/TablePermissions/Actions.js | 151 ++- .../Data/TablePermissions/Permissions.js | 301 +++-- .../Data/TablePermissions/Permissions.scss | 168 +++ console/src/components/Services/Data/index.js | 1 + .../Services/EventTrigger/EventSubSidebar.js | 2 +- .../RemoteSchema/RemoteSchemaSubSidebar.js | 2 +- 37 files changed, 2360 insertions(+), 882 deletions(-) create mode 100644 console/src/components/Common/Layout/LeftSubSidebar/function_active.svg delete mode 100644 console/src/components/Common/Layout/LeftSubSidebar/function_high.svg create mode 100644 console/src/components/Common/Modal/Modal.js rename console/src/components/Common/{ => Modal}/ModalWrapper.js (100%) create mode 100644 console/src/components/Common/WarningSymbol/WarningSymbol.js rename console/src/components/Common/{GqlCompatibilityWarning/GqlCompatibilityWarning.scss => WarningSymbol/WarningSymbol.scss} (63%) create mode 100644 console/src/components/Common/utils/jsUtils.js create mode 100644 console/src/components/Common/utils/pgUtils.js create mode 100644 console/src/components/Common/utils/routesUtils.js create mode 100644 console/src/components/Common/utils/urlUtils.js create mode 100644 console/src/components/Common/utils/v1QueryUtils.js create mode 100644 console/src/components/Services/Data/PermissionsSummary/PermissionsSummary.js create mode 100644 console/src/components/Services/Data/PermissionsSummary/PermissionsSummary.scss create mode 100644 console/src/components/Services/Data/PermissionsSummary/utils.js create mode 100644 console/src/components/Services/Data/TablePermissions/Permissions.scss diff --git a/console/src/components/Common/Common.scss b/console/src/components/Common/Common.scss index d8760d274ea..75aedd163c3 100644 --- a/console/src/components/Common/Common.scss +++ b/console/src/components/Common/Common.scss @@ -43,12 +43,22 @@ table { font-size: 14px; } -table thead tr th { +table thead tr th, +table tbody tr th { background-color: #F2F2F2 !important; color: #4D4D4D; font-weight: 600 !important; } +.full_container { + margin: 20px; + min-width: fit-content; +} + +.fit_content { + width: fit-content; +} + .pageSidebar { height: calc(100vh - 50px); overflow: auto; @@ -167,8 +177,13 @@ table thead tr th { display: flex; } -.line_mar { - margin: 15px 20px; +.flex_space_between { + display: flex; + justify-content: space-between; +} + +.flex_0 { + flex: 0; } .wd5 { @@ -198,6 +213,10 @@ table thead tr th { float: left; } +.wd100Percent { + width: 100% !important; +} + .wd90 { width: 90%; } @@ -754,6 +773,10 @@ code { float: left; } +.text_center { + text-align: center; +} + .block_wrapper { padding: 20px; background-color: #fff; @@ -861,6 +884,14 @@ code { color: #767E96 } +.text_link { + color: #337ab7; +} + +.text_link:hover, .text_link:focus { + color: #23527c; +} + .docsButton { background-color: #fff; border-radius: 5px; @@ -1325,10 +1356,6 @@ code { width: 325px; } -.wd100Percent { - width: 100% !important; -} - /* container height subtracting top header and bottom scroll bar */ $mainContainerHeight: calc(100vh - 50px - 25px); diff --git a/console/src/components/Common/GqlCompatibilityWarning/GqlCompatibilityWarning.js b/console/src/components/Common/GqlCompatibilityWarning/GqlCompatibilityWarning.js index 91be25c4ffa..c52bffdea9f 100644 --- a/console/src/components/Common/GqlCompatibilityWarning/GqlCompatibilityWarning.js +++ b/console/src/components/Common/GqlCompatibilityWarning/GqlCompatibilityWarning.js @@ -1,30 +1,12 @@ import React from 'react'; -import Tooltip from 'react-bootstrap/lib/Tooltip'; -import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger'; -import styles from './GqlCompatibilityWarning.scss'; +import WarningSymbol from '../WarningSymbol/WarningSymbol'; const GqlCompatibilityWarning = () => { - const gqlCompatibilityTip = ( - - This identifier name does not conform to the GraphQL naming standard. - Names in GraphQL should be limited to this ASCII subset: - /[_A-Za-z][_0-9A-Za-z]*/. - - ); + const gqlCompatibilityTip = + 'This identifier name does not conform to the GraphQL naming standard. Names in GraphQL should be limited to this ASCII subset: /[_A-Za-z][_0-9A-Za-z]*/.'; - return ( -
- -