From b614756b99ae410871d3e2df2478bfc9ac2440b8 Mon Sep 17 00:00:00 2001 From: wawhal Date: Tue, 8 Jan 2019 13:38:07 +0530 Subject: [PATCH 1/5] 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 181fe4feaef5a5d55674ab9bb18cb83f4dd13a67 Mon Sep 17 00:00:00 2001 From: wawhal Date: Wed, 16 Jan 2019 15:10:17 +0530 Subject: [PATCH 2/5] fix tracked tables being shown as untracked --- .../components/Services/Data/DataActions.js | 2 +- .../components/Services/Data/DataHeader.js | 24 +++++-------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/console/src/components/Services/Data/DataActions.js b/console/src/components/Services/Data/DataActions.js index 4a1e928e58936..c99cad8aa4d09 100644 --- a/console/src/components/Services/Data/DataActions.js +++ b/console/src/components/Services/Data/DataActions.js @@ -198,7 +198,7 @@ const loadUntrackedSchema = () => (dispatch, getState) => { const url = Endpoints.getSchema; const currentSchema = getState().tables.currentSchema; const body = initQueries.loadUntrackedSchema; - body.args.where.table_name = currentSchema; + body.args.where.table_schema = currentSchema; const options = { credentials: globalCookiePolicy, method: 'POST', diff --git a/console/src/components/Services/Data/DataHeader.js b/console/src/components/Services/Data/DataHeader.js index b5eecbc4fd19a..0e7fbefef865e 100644 --- a/console/src/components/Services/Data/DataHeader.js +++ b/console/src/components/Services/Data/DataHeader.js @@ -1,17 +1,11 @@ import React from 'react'; import { Link } from 'react-router'; -import { push } from 'react-router-redux'; +import _push from './push'; import Helmet from 'react-helmet'; import PageContainer from './PageContainer/PageContainer'; import globals from '../../../Globals'; -import { - loadSchema, - loadUntrackedSchema, - loadUntrackedRelations, - UPDATE_CURRENT_SCHEMA, -} from './DataActions'; -const appPrefix = '/data'; +const sectionPrefix = '/data'; const DataHeader = ({ schema, @@ -34,7 +28,7 @@ const DataHeader = ({ > Migrations @@ -44,13 +38,7 @@ const DataHeader = ({ const handleSchemaChange = e => { const updatedSchema = e.target.value; - dispatch(push(`${appPrefix}/schema/${updatedSchema}`)); - Promise.all([ - dispatch({ type: UPDATE_CURRENT_SCHEMA, currentSchema: updatedSchema }), - dispatch(loadSchema()), - dispatch(loadUntrackedSchema()), - dispatch(loadUntrackedRelations()), - ]); + dispatch(_push(`/schema/${updatedSchema}`)); }; return (
@@ -74,7 +62,7 @@ const DataHeader = ({ > Schema: @@ -108,7 +96,7 @@ const DataHeader = ({ > SQL From 5dfffdb723318e73d92f6887ec09a29f66558d77 Mon Sep 17 00:00:00 2001 From: wawhal Date: Wed, 16 Jan 2019 16:56:19 +0530 Subject: [PATCH 3/5] refresh metadata on schema change --- .../src/components/Services/Data/DataHeader.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/console/src/components/Services/Data/DataHeader.js b/console/src/components/Services/Data/DataHeader.js index 0e7fbefef865e..c83970d0c5fa7 100644 --- a/console/src/components/Services/Data/DataHeader.js +++ b/console/src/components/Services/Data/DataHeader.js @@ -5,6 +5,13 @@ import Helmet from 'react-helmet'; import PageContainer from './PageContainer/PageContainer'; import globals from '../../../Globals'; +import { + loadSchema, + loadUntrackedSchema, + loadUntrackedRelations, + UPDATE_CURRENT_SCHEMA, +} from './DataActions'; + const sectionPrefix = '/data'; const DataHeader = ({ @@ -38,7 +45,14 @@ const DataHeader = ({ const handleSchemaChange = e => { const updatedSchema = e.target.value; - dispatch(_push(`/schema/${updatedSchema}`)); + Promise.all([ + dispatch({ type: UPDATE_CURRENT_SCHEMA, currentSchema: updatedSchema }), + dispatch(loadSchema()), + dispatch(loadUntrackedSchema()), + dispatch(loadUntrackedRelations()), + ]).then(() => { + dispatch(_push(`/schema/${updatedSchema}`)); + }); }; return (
From f2b682a351364dc412af2ba43ab13203c51cac00 Mon Sep 17 00:00:00 2001 From: wawhal Date: Wed, 16 Jan 2019 18:15:57 +0530 Subject: [PATCH 4/5] remove obsolete test --- .../integration/data/create-table/spec.js | 25 ------------------- .../integration/data/create-table/test.js | 2 -- 2 files changed, 27 deletions(-) diff --git a/console/cypress/integration/data/create-table/spec.js b/console/cypress/integration/data/create-table/spec.js index 9d83513044baf..852226db3b634 100644 --- a/console/cypress/integration/data/create-table/spec.js +++ b/console/cypress/integration/data/create-table/spec.js @@ -127,31 +127,6 @@ export const passCT = () => { validateCT(getTableName(0, testName), 'success'); }; -export const failAddExistingTable = () => { - cy.visit(`${baseUrl}/data/schema/public/existing-table-view/add`); - cy.get(getElementFromAlias('existing-table')).type(getTableName(0, testName)); - cy.get(getElementFromAlias('add-existing-table-button')).click(); - cy.url().should( - 'eq', - `${baseUrl}/data/schema/public/existing-table-view/add` - ); - cy.get(getElementFromAlias(getTableName(0, testName))).click(); - cy.get(getElementFromAlias('table-modify')).click(); - cy.get(getElementFromAlias('untrack-table')).click(); - cy.on('window:confirm', () => true); - cy.wait(5000); -}; - -export const passAddExistingTable = () => { - cy.visit(`${baseUrl}/data/schema/public/existing-table-view/add`); - cy.get(getElementFromAlias('existing-table')).type(getTableName(0, testName)); - cy.get(getElementFromAlias('add-existing-table-button')).click(); - cy.url().should( - 'eq', - `${baseUrl}/data/schema/public/tables/${getTableName(0, testName)}/modify` - ); -}; - export const failCTDuplicateTable = () => { // Visit data page cy.get(getElementFromAlias('sidebar-add-table')).click(); diff --git a/console/cypress/integration/data/create-table/test.js b/console/cypress/integration/data/create-table/test.js index 3a1038bb0a517..4441ac18fe015 100644 --- a/console/cypress/integration/data/create-table/test.js +++ b/console/cypress/integration/data/create-table/test.js @@ -38,8 +38,6 @@ export const runCreateTableTests = () => { it('Fails to create with duplicate primary key', failCTDuplicatePrimaryKey); it('Fails to create with wrong default value', failCTWrongDefaultValue); it('Successfuly creates table', passCT); - it('Fails to add existing table', failAddExistingTable); - it('Passes add existing table', passAddExistingTable); it('Fails to create duplicate table', failCTDuplicateTable); it('Delete off the test table', deleteCTTestTable); }); From a6f5712f994fb5dec36d9384b8465652d553d4c2 Mon Sep 17 00:00:00 2001 From: wawhal Date: Thu, 17 Jan 2019 15:21:36 +0530 Subject: [PATCH 5/5] push before refreshing metadata --- console/src/components/Services/Data/DataHeader.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/console/src/components/Services/Data/DataHeader.js b/console/src/components/Services/Data/DataHeader.js index c83970d0c5fa7..42e6a3190a62f 100644 --- a/console/src/components/Services/Data/DataHeader.js +++ b/console/src/components/Services/Data/DataHeader.js @@ -45,14 +45,13 @@ const DataHeader = ({ const handleSchemaChange = e => { const updatedSchema = e.target.value; + dispatch(_push(`/schema/${updatedSchema}`)); Promise.all([ dispatch({ type: UPDATE_CURRENT_SCHEMA, currentSchema: updatedSchema }), dispatch(loadSchema()), dispatch(loadUntrackedSchema()), dispatch(loadUntrackedRelations()), - ]).then(() => { - dispatch(_push(`/schema/${updatedSchema}`)); - }); + ]); }; return (