From b614756b99ae410871d3e2df2478bfc9ac2440b8 Mon Sep 17 00:00:00 2001 From: wawhal Date: Tue, 8 Jan 2019 13:38:07 +0530 Subject: [PATCH 1/3] remove auth webhook ref from docs --- docs/graphql/manual/auth/webhook-examples.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/graphql/manual/auth/webhook-examples.rst b/docs/graphql/manual/auth/webhook-examples.rst index 5913f5ab73ce0..e15e0b59a9a4e 100644 --- a/docs/graphql/manual/auth/webhook-examples.rst +++ b/docs/graphql/manual/auth/webhook-examples.rst @@ -21,8 +21,7 @@ Once deployed, you can use any of the following endpoints as your auth webhook i - ``/simple/webhook`` (`View source `__) - ``/firebase/webhook`` (`View source `__) -- ``/auth0/webhook`` (`View source `__) .. note:: - If you are using ``auth0`` or ``firebase`` you will have to set the associated environment variables. + If you are using ``firebase`` you will have to set the associated environment variables. From ceaaa30201f49225742b8957c8eba06f80592435 Mon Sep 17 00:00:00 2001 From: wawhal Date: Tue, 22 Jan 2019 16:40:21 +0530 Subject: [PATCH 2/3] fix #1095 --- .../Data/TableRelationships/Actions.js | 32 +++++++++++-------- .../Data/TableRelationships/Relationships.js | 3 +- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/console/src/components/Services/Data/TableRelationships/Actions.js b/console/src/components/Services/Data/TableRelationships/Actions.js index 7277cabceb193..ba6fd7e730df1 100644 --- a/console/src/components/Services/Data/TableRelationships/Actions.js +++ b/console/src/components/Services/Data/TableRelationships/Actions.js @@ -336,21 +336,25 @@ const sanitizeRelName = arg => }); const formRelName = relMeta => { - let finalRelName; - // remove special chars and change first letter after underscore to uppercase - const targetTable = sanitizeRelName(relMeta.rTable); - if (relMeta.isObjRel) { - const objLCol = sanitizeRelName(relMeta.lcol.join(',')); - finalRelName = `${targetTable}By${objLCol}`; - } else { - const arrRCol = sanitizeRelName(relMeta.rcol.join(',')); - finalRelName = - `${ - targetTable - // (targetTable[targetTable.length - 1] !== 's' ? 's' : '') + // add s only if the last char is not s - }s` + `By${arrRCol}`; + try { + let finalRelName; + // remove special chars and change first letter after underscore to uppercase + const targetTable = sanitizeRelName(relMeta.rTable); + if (relMeta.isObjRel) { + const objLCol = sanitizeRelName(relMeta.lcol.join(',')); + finalRelName = `${targetTable}By${objLCol}`; + } else { + const arrRCol = sanitizeRelName(relMeta.rcol.join(',')); + finalRelName = + `${ + targetTable + // (targetTable[targetTable.length - 1] !== 's' ? 's' : '') + // add s only if the last char is not s + }s` + `By${arrRCol}`; + } + return finalRelName; + } catch (e) { + return ''; } - return finalRelName; }; const getAllUnTrackedRelations = (allSchemas, currentSchema) => { diff --git a/console/src/components/Services/Data/TableRelationships/Relationships.js b/console/src/components/Services/Data/TableRelationships/Relationships.js index cc6c483589abe..a012354745f41 100644 --- a/console/src/components/Services/Data/TableRelationships/Relationships.js +++ b/console/src/components/Services/Data/TableRelationships/Relationships.js @@ -10,6 +10,7 @@ import { relNameChanged, resetRelationshipForm, relManualAddClicked, + formRelName, } from './Actions'; import { findAllFromRel } from '../utils'; import { showErrorNotification } from '../Notification'; @@ -167,7 +168,7 @@ const addRelationshipCellView = ( {' '} From e4bcc2acb219361a44cbe79f57b4ee2426d39598 Mon Sep 17 00:00:00 2001 From: wawhal Date: Tue, 22 Jan 2019 18:47:40 +0530 Subject: [PATCH 3/3] update tests --- .../integration/data/insert-browse/spec.js | 4 +++- .../integration/data/relationships/spec.js | 21 ++++++++++++++----- .../Data/TableRelationships/Relationships.js | 3 ++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/console/cypress/integration/data/insert-browse/spec.js b/console/cypress/integration/data/insert-browse/spec.js index 246ade769ffbb..6a6cf79652f40 100644 --- a/console/cypress/integration/data/insert-browse/spec.js +++ b/console/cypress/integration/data/insert-browse/spec.js @@ -442,7 +442,9 @@ export const checkViewRelationship = () => { // Add relationship cy.get(getElementFromAlias('add-rel-mod')).click(); cy.get(getElementFromAlias('obj-rel-add-0')).click(); - cy.get(getElementFromAlias('suggested-rel-name')).type('someRel'); + cy.get(getElementFromAlias('suggested-rel-name')) + .clear() + .type('someRel'); cy.get(getElementFromAlias('obj-rel-save-0')).click(); cy.wait(300); // Insert a row diff --git a/console/cypress/integration/data/relationships/spec.js b/console/cypress/integration/data/relationships/spec.js index 7b2b6cae88a48..9a065c35d8e22 100644 --- a/console/cypress/integration/data/relationships/spec.js +++ b/console/cypress/integration/data/relationships/spec.js @@ -172,7 +172,9 @@ export const passRTAddSuggestedRel = () => { cy.get(getElementFromAlias('article_table_rt')).click(); cy.get(getElementFromAlias('table-relationships')).click(); cy.get(getElementFromAlias('obj-rel-add-0')).click(); - cy.get(getElementFromAlias('suggested-rel-name')).type('author'); + cy.get(getElementFromAlias('suggested-rel-name')) + .clear() + .type('author'); cy.get(getElementFromAlias('obj-rel-save-0')).click(); cy.wait(15000); validateColumn( @@ -183,7 +185,9 @@ export const passRTAddSuggestedRel = () => { cy.get(getElementFromAlias('article_table_rt')).click(); cy.get(getElementFromAlias('table-relationships')).click(); cy.get(getElementFromAlias('arr-rel-add-0')).click(); - cy.get(getElementFromAlias('suggested-rel-name')).type('comments'); + cy.get(getElementFromAlias('suggested-rel-name')) + .clear() + .type('comments'); cy.get(getElementFromAlias('arr-rel-save-0')).click(); cy.wait(15000); validateColumn( @@ -197,10 +201,13 @@ export const failRTAddSuggestedRel = () => { cy.get(getElementFromAlias('article_table_rt')).click(); cy.get(getElementFromAlias('table-relationships')).click(); cy.get(getElementFromAlias('obj-rel-add-0')).click(); + cy.get(getElementFromAlias('suggested-rel-name')).clear(); cy.get(getElementFromAlias('obj-rel-save-0')).click(); // cy.get('.notification-error'); cy.wait(15000); - cy.get(getElementFromAlias('suggested-rel-name')).type(123123); + cy.get(getElementFromAlias('suggested-rel-name')) + .clear() + .type(123123); cy.get('button') .contains('Save') .click(); @@ -214,7 +221,9 @@ export const failRTAddSuggestedRel = () => { cy.get(getElementFromAlias('article_table_rt')).click(); cy.get(getElementFromAlias('table-relationships')).click(); cy.get(getElementFromAlias('obj-rel-add-0')).click(); - cy.get(getElementFromAlias('suggested-rel-name')).type('author'); + cy.get(getElementFromAlias('suggested-rel-name')) + .clear() + .type('author'); cy.get(getElementFromAlias('obj-rel-save-0')).click(); cy.wait(15000); validateColumn( @@ -225,7 +234,9 @@ export const failRTAddSuggestedRel = () => { cy.get(getElementFromAlias('article_table_rt')).click(); cy.get(getElementFromAlias('table-relationships')).click(); cy.get(getElementFromAlias('arr-rel-add-0')).click(); - cy.get(getElementFromAlias('suggested-rel-name')).type('author'); + cy.get(getElementFromAlias('suggested-rel-name')) + .clear() + .type('author'); cy.get(getElementFromAlias('arr-rel-save-0')).click(); cy.wait(15000); // cy.get('.notification-error'); diff --git a/console/src/components/Services/Data/TableRelationships/Relationships.js b/console/src/components/Services/Data/TableRelationships/Relationships.js index a012354745f41..48d79a84c1fbf 100644 --- a/console/src/components/Services/Data/TableRelationships/Relationships.js +++ b/console/src/components/Services/Data/TableRelationships/Relationships.js @@ -110,6 +110,7 @@ const addRelationshipCellView = ( const onAdd = e => { e.preventDefault(); dispatch(relSelectionChanged(rel)); + dispatch(relNameChanged(formRelName(rel))); }; const onRelationshipNameChanged = e => { @@ -168,7 +169,7 @@ const addRelationshipCellView = ( {' '}