这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f2d3115
update docs
rikinsk Feb 6, 2019
12d9a52
Merge branch 'master' into console-permissions
rikinsk Feb 6, 2019
fbd4436
update console permission builder
rikinsk Feb 13, 2019
2fe38f8
fix postgis type in console permissions
rikinsk Feb 14, 2019
77f004d
Merge branch 'master' into console-permissions
rikinsk Feb 14, 2019
a056d54
update package-lock.json
rikinsk Feb 14, 2019
fed6a76
update <a> to <Link>
rikinsk Feb 14, 2019
c3f8cff
replace indexOf with includes
rikinsk Feb 14, 2019
347a520
update partial access filter icon in permissions
rikinsk Feb 14, 2019
3b40d41
add relationship permissions text
rikinsk Feb 14, 2019
21b6511
update relationship permissions text
rikinsk Feb 14, 2019
1e5aee3
Merge branch 'master' into console-permissions
rikinsk Feb 14, 2019
38d4840
removed geography from postgis operators
rikinsk Feb 15, 2019
9633cc3
Merge branch 'console-permissions' of github.com:rikinsk/graphql-engi…
rikinsk Feb 15, 2019
32abe4a
update console perm test to support types
wawhal Feb 15, 2019
3fccd3d
update permissions bulk actions section
rikinsk Feb 15, 2019
22b053a
Merge branch 'console-permissions' of github.com:rikinsk/graphql-engi…
rikinsk Feb 15, 2019
0f2ea54
update relationship msg margin
rikinsk Feb 15, 2019
8a9247c
update relationship msg
rikinsk Feb 15, 2019
5f708ac
improve save other role permissions UX
rikinsk Feb 15, 2019
39b63aa
Merge branch 'master' into console-permissions
rikinsk Feb 15, 2019
4930ad1
bug fix
rikinsk Feb 15, 2019
ec59e1a
show all roles in permissions
rikinsk Feb 16, 2019
1b74a5b
revert package-lock.json changes
rikinsk Feb 17, 2019
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
5 changes: 2 additions & 3 deletions console/cypress/integration/validators/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ const compareChecks = (permObj, check, query, columns) => {
}
} else if (query === 'insert') {
// eslint-disable-line no-lonely-if
expect(permObj.check[getColName(0)]._eq === '1').to.be.true; // eslint-dsable-line eqeqeq
expect(permObj.check[getColName(0)]._eq === 1).to.be.true;
} else {
expect(permObj.filter[getColName(0)]._eq === '1').to.be.true;
expect(permObj.filter[getColName(0)]._eq === 1).to.be.true;
if (query === 'select' || query === 'update') {
columns.forEach((col, index) => {
expect(permObj.columns.includes(getColName(index)));
Expand Down Expand Up @@ -319,7 +319,6 @@ export const validatePermission = (
};
const requestOptions = makeDataAPIOptions(dataApiUrl, adminSecret, reqBody);
cy.request(requestOptions).then(response => {
cy.log(JSON.stringify(response));
const tableSchema = response.body.find(
table => table.table_name === tableName
);
Expand Down
6 changes: 3 additions & 3 deletions console/src/components/QueryBuilderJson/QueryBuilderJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ class QueryBuilderJson extends React.Component {
Object.keys(object).forEach((key, i) => {
objectArray.push({ key: key, value: object[key] });
// replace unselected key with array position
if (unselectedElements.indexOf(key) !== -1) {
if (unselectedElements.includes(key)) {
unselectedElements[unselectedElements.indexOf(key)] = i;
}
});
}

objectArray.forEach((_object, i) => {
const unselected = unselectedElements.indexOf(i) !== -1;
const unselected = unselectedElements.includes(i);
_jsonObject.push(
<div
key={i}
Expand All @@ -138,7 +138,7 @@ class QueryBuilderJson extends React.Component {

elements.forEach((element, i) => {
/* eslint-disable no-use-before-define */
const unselected = unselectedElements.indexOf(i) !== -1;
const unselected = unselectedElements.includes(i);
_jsonArray.push(
<div
key={i}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import Helmet from 'react-helmet';
import CommonTabLayout from '../../../Layout/CommonTabLayout/CommonTabLayout';
// import { Link } from 'react-router';
import { Link } from 'react-router';
import { push } from 'react-router-redux';

import { pageTitle, appPrefix } from '../Modify/constants';
Expand Down Expand Up @@ -82,14 +82,14 @@ class Permission extends React.Component {
applicable to the data returned by this function
</p>
<div className={styles.commonBtn}>
<a href={permissionTableUrl}>
<Link to={permissionTableUrl}>
<button
className={styles.yellow_button}
data-test={'custom-function-permission-btn'}
>
{`${setOffTable} Permissions`}
</button>
</a>
</Link>
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ hr
word-wrap: break-word;
.columnListElement {
float: left;
margin-right: 75px;
margin-right: 50px;
}

.toggleAll {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ export const SET_TYPE_CONFIG = 'ModifyTable/SET_TYPE_CONFIG';

/* */

const getQueriesWithPermColumns = insert => {
const getQueriesWithPermColumns = allowInsert => {
const queries = ['select', 'update'];
if (insert) {
if (allowInsert) {
queries.push('insert');
}
return queries;
Expand Down Expand Up @@ -455,7 +455,7 @@ const applySamePermissionsBulk = tableSchema => {
const table = tableSchema.table_name;
const currentQueryType = permissionsState.query;
const toBeAppliedPermission = permissionsState[currentQueryType];
const selectedRoles = permissionsState.applySamePermissions;
const selectedRoles = permissionsState.applySamePermissions.concat([permissionsState.role]);

const permissionsUpQueries = [];
const permissionsDownQueries = [];
Expand All @@ -465,10 +465,11 @@ const applySamePermissionsBulk = tableSchema => {
// find out if selected role has an existing permission of the same query type.
// if so add a drop permission and then create the new permission.

const currentRolePermission = currentPermissions.filter(el => {
const currentRolePermission = currentPermissions.find(el => {
return el.role_name === role;
});
if (currentRolePermission[0].permissions[currentQueryType]) {

if (currentRolePermission && currentRolePermission.permissions[currentQueryType]) {
// existing permission is there. so drop and recreate.
const deleteQuery = {
type: 'drop_' + currentQueryType + '_permission',
Expand All @@ -482,7 +483,7 @@ const applySamePermissionsBulk = tableSchema => {
args: {
table: { name: table, schema: currentSchema },
role: role,
permission: currentRolePermission[0].permissions[currentQueryType],
permission: currentRolePermission.permissions[currentQueryType],
},
};
permissionsUpQueries.push(deleteQuery);
Expand Down
Loading