这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion console/cypress/integration/data/permissions/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const permRemove = (tableName, query) => {
// click on the query type to edit permission
cy.get(getElementFromAlias(`role0-${query}`)).click();
// Remove permission
cy.get(getElementFromAlias('Remove-all-access-button')).click();
cy.get(getElementFromAlias('Remove-button')).click();
cy.wait(2500);
// Check for notif
// cy.get('.notification-success').click();
Expand Down
2 changes: 1 addition & 1 deletion console/src/components/Common/Common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ input {
}
.add_mar_small
{
margin-right: 10px;
margin-right: 10px !important;
}
.code_space
{
Expand Down
2 changes: 2 additions & 0 deletions console/src/components/Services/Data/DataState.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const defaultPermissionsState = {
custom_checked: false,
newRole: '',
limitEnabled: true,
bulkSelect: [],
applySamePermissions: [],
};

const defaultQueryPermissions = {
Expand Down
85 changes: 75 additions & 10 deletions console/src/components/Services/Data/TableCommon/TableReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,27 @@ import {
PERM_TOGGLE_COLUMN,
PERM_TOGGLE_ALL_COLUMNS,
PERM_ALLOW_ALL,
PERM_TOGGLE_ENABLE_LIMIT,
PERM_TOGGLE_MODIFY_LIMIT,
PERM_TOGGLE_ALLOW_UPSERT,
PERM_CUSTOM_CHECKED,
PERM_REMOVE_ACCESS,
PERM_SAVE_PERMISSIONS,
PERM_CLOSE_EDIT,
PERM_SET_ROLE_NAME,
PERM_SELECT_BULK,
PERM_DESELECT_BULK,
PERM_RESET_BULK_SELECT,
PERM_RESET_BULK_SAME_SELECT,
PERM_SAME_APPLY_BULK,
PERM_DESELECT_SAME_APPLY_BULK,
toggleColumn,
toggleAllColumns,
getFilterKey,
getBasePermissionsState,
updatePermissionsState,
deleteFromPermissionsState,
updateBulkSelect,
updateBulkSameSelect,
} from '../TablePermissions/Actions';

const modifyReducer = (tableName, schemas, modifyStateOrig, action) => {
Expand Down Expand Up @@ -306,15 +313,6 @@ const modifyReducer = (tableName, schemas, modifyStateOrig, action) => {
},
};

case PERM_TOGGLE_ENABLE_LIMIT:
return {
...modifyState,
permissionsState: {
...modifyState.permissionsState,
limitEnabled: action.data,
},
};

case PERM_TOGGLE_MODIFY_LIMIT:
return {
...modifyState,
Expand Down Expand Up @@ -406,6 +404,73 @@ const modifyReducer = (tableName, schemas, modifyStateOrig, action) => {
...modifyState,
};

case PERM_SELECT_BULK:
return {
...modifyState,
permissionsState: {
...modifyState.permissionsState,
bulkSelect: updateBulkSelect(
modifyState.permissionsState,
action.data,
true
),
},
};
case PERM_DESELECT_BULK:
return {
...modifyState,
permissionsState: {
...modifyState.permissionsState,
bulkSelect: updateBulkSelect(
modifyState.permissionsState,
action.data,
false
),
},
};
case PERM_SAME_APPLY_BULK:
return {
...modifyState,
permissionsState: {
...modifyState.permissionsState,
applySamePermissions: updateBulkSameSelect(
modifyState.permissionsState,
action.data,
true
),
},
};
case PERM_DESELECT_SAME_APPLY_BULK:
return {
...modifyState,
permissionsState: {
...modifyState.permissionsState,
applySamePermissions: updateBulkSameSelect(
modifyState.permissionsState,
action.data,
false
),
},
};

case PERM_RESET_BULK_SELECT:
return {
...modifyState,
permissionsState: {
...modifyState.permissionsState,
bulkSelect: [],
},
};

case PERM_RESET_BULK_SAME_SELECT:
return {
...modifyState,
permissionsState: {
...modifyState.permissionsState,
applySamePermissions: [],
},
};

case TOGGLE_ACTIVE_COLUMN:
const newCol =
modifyState.activeEdit.column === action.column ? '' : action.column;
Expand Down
37 changes: 35 additions & 2 deletions console/src/components/Services/Data/TableModify/Modify.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

.newRoleInput {
margin-left: 20px;
width: 80%;
width: calc(100% - 40px);
height: 30px;
}

Expand Down Expand Up @@ -173,14 +173,30 @@ hr
td:first-child, th:first-child {
border-right: 4px double #ddd;
font-weight: bold;
width: 20%;
width: 10%;
}
td:nth-child(2) {
overflow: auto;
max-width: 250px;
width: 250px;
}
.newRoleTd {
padding-top: 13px;
}
.permissionDelete {
cursor: pointer;
}

.editPermissionLink {
font-size: 12px;
position: absolute;
right: 10px;
color: #337ab7;
cursor: pointer;
}

.bulkSelect {
margin-right: 10px !important;
}

.clickableCell {
Expand Down Expand Up @@ -209,17 +225,34 @@ hr
}
}

.applyBulkPermissions {
display: inline-block;
}

.samePermissionRole {
display: inline-block;
width: auto;
height: auto;
}

.bulkApplyBtn {
display: block;
margin-top: 10px;
clear: both;
}

.activeEdit {
.editPermissionsHeading {
font-weight: bold;
font-size: 16px;
margin-bottom: 5px;
word-wrap: break-word;
}

.editPermissionsSection {
margin: 5px;
padding: 10px;
word-wrap: break-word;

.columnListElement {
float: left;
Expand Down
Loading