From 8a9901d417c1cde1e74744188779ad179c190120 Mon Sep 17 00:00:00 2001 From: Karthik Venkateswaran Date: Wed, 22 May 2019 16:53:30 +0530 Subject: [PATCH] add all PG column types in table add / modify (close #223, #2035, #394, #2038) (#1933) --- console/cypress/helpers/dataHelpers.js | 16 +- .../integration/api-explorer/graphql/spec.js | 20 +- .../integration/data/create-table/spec.js | 67 +++- .../integration/data/insert-browse/spec.js | 27 +- .../cypress/integration/data/modify/spec.js | 38 +- .../integration/data/permissions/spec.js | 20 +- .../integration/data/relationships/spec.js | 32 +- .../cypress/integration/data/views/spec.js | 31 +- .../integration/events/create-trigger/spec.js | 24 +- console/package-lock.json | 309 +++++++++++++++- console/package.json | 1 + console/src/components/Common/Common.scss | 5 + .../SearchableSelect/SearchableSelect.js | 70 ++++ .../TableCommon/ReactTableOverrides.css | 11 +- .../components/Common/TableCommon/Table.scss | 11 - .../components/Common/TextInput/TextInput.js | 21 ++ console/src/components/Main/Main.js | 8 +- .../Services/CustomResolver/Common/Common.js | 11 +- .../Services/Data/Add/AddActions.js | 9 +- .../components/Services/Data/Add/AddTable.js | 337 ++++++------------ .../Services/Data/Add/TableColumn.js | 143 ++++++++ .../Services/Data/Add/TableColumns.js | 31 ++ .../Services/Data/Add/TableComment.js | 28 ++ .../components/Services/Data/Add/TableName.js | 28 ++ .../Services/Data/Common/DataTypes.js | 82 ----- .../components/Services/Data/Common/PgInfo.js | 34 ++ .../components/Services/Data/Common/utils.js | 103 ++++++ .../components/Services/Data/DataActions.js | 70 ++++ .../src/components/Services/Data/DataState.js | 4 + .../components/Services/Data/RawSQL/utils.js | 2 +- .../Services/Data/TableBrowseRows/ViewRows.js | 8 +- .../Services/Data/TableCommon/TableReducer.js | 17 + .../Data/TableModify/ColumnCreator.js | 63 ++-- .../Services/Data/TableModify/ColumnEditor.js | 134 +++---- .../Data/TableModify/ColumnEditorList.js | 12 +- .../Data/TableModify/ModifyActions.js | 47 +++ .../Services/Data/TableModify/ModifyTable.js | 31 +- .../Data/TableModify/ModifyTable.scss | 7 +- .../Services/Data/TableModify/utils.js | 62 ++++ .../Services/Data/TablePermissions/Actions.js | 16 +- .../PermissionBuilder/PermissionBuilder.js | 4 +- console/src/components/Services/Data/utils.js | 90 +++++ .../EventTrigger/Modify/WebhookEditor.js | 5 + .../EventTrigger/PendingEvents/ViewRows.js | 3 +- .../EventTrigger/ProcessedEvents/ViewRows.js | 3 +- .../TableCommon/RedeliverEvent.js | 12 +- console/src/theme/bootstrap.overrides.scss | 16 + 47 files changed, 1561 insertions(+), 562 deletions(-) create mode 100644 console/src/components/Common/SearchableSelect/SearchableSelect.js create mode 100644 console/src/components/Common/TextInput/TextInput.js create mode 100644 console/src/components/Services/Data/Add/TableColumn.js create mode 100644 console/src/components/Services/Data/Add/TableColumns.js create mode 100644 console/src/components/Services/Data/Add/TableComment.js create mode 100644 console/src/components/Services/Data/Add/TableName.js delete mode 100755 console/src/components/Services/Data/Common/DataTypes.js create mode 100644 console/src/components/Services/Data/Common/PgInfo.js create mode 100644 console/src/components/Services/Data/Common/utils.js create mode 100644 console/src/components/Services/Data/TableModify/utils.js diff --git a/console/cypress/helpers/dataHelpers.js b/console/cypress/helpers/dataHelpers.js index a18c8e55a84..7450c10ef91 100644 --- a/console/cypress/helpers/dataHelpers.js +++ b/console/cypress/helpers/dataHelpers.js @@ -8,8 +8,8 @@ export const dataTypes = [ 'text', 'numeric', 'date', - 'timestamp with time zone', - 'time with time zone', + 'timestamptz', + 'timetz', 'boolean', ]; export const typeDefaults = { @@ -19,8 +19,8 @@ export const typeDefaults = { text: 'test-text', numeric: '0.55555', date: 'now()', - 'timestamp with time zone': 'now()', - 'time with time zone': 'now()', + timestamptz: 'now()', + timetz: 'now()', boolean: 'false', }; export const queryTypes = ['insert', 'select', 'update', 'delete']; @@ -28,6 +28,14 @@ export const getColName = i => `apic_test_column_${i}`; export const getTableName = (i, testName = '') => `apic_test_table_${testName}_${i}`; export const getElementFromAlias = alias => `[data-test=${alias}]`; +export const getElementFromClassName = cn => `.${cn}`; +export const tableColumnTypeSelector = alias => { + cy.get(`${getElementFromAlias(alias)}`) + .children('div') + .click() + .find('input') + .focus(); +}; export const makeDataAPIUrl = dataApiUrl => `${dataApiUrl}/v1/query`; export const makeDataAPIOptions = (dataApiUrl, key, body) => ({ method: 'POST', diff --git a/console/cypress/integration/api-explorer/graphql/spec.js b/console/cypress/integration/api-explorer/graphql/spec.js index 75915881c62..793da78f956 100644 --- a/console/cypress/integration/api-explorer/graphql/spec.js +++ b/console/cypress/integration/api-explorer/graphql/spec.js @@ -1,6 +1,10 @@ /* eslint import/prefer-default-export: 0 */ -import { getElementFromAlias, baseUrl } from '../../../helpers/dataHelpers'; +import { + getElementFromAlias, + baseUrl, + tableColumnTypeSelector, +} from '../../../helpers/dataHelpers'; import { validateCT } from '../../validators/validators'; import { makeDataAPIOptions } from '../../../helpers/dataHelpers'; import { toggleOnMigrationMode } from '../../data/migration-mode/utils'; @@ -29,11 +33,21 @@ export const createTestTable = () => { cy.get(getElementFromAlias('column-0')) .clear() .type('id'); - cy.get(getElementFromAlias('col-type-0')).select('serial'); + // cy.get(getElementFromAlias('col-type-0')).click(); + tableColumnTypeSelector('col-type-0'); + cy.get(getElementFromAlias('data_test_column_type_value_serial')) + .first() + .click(); + // cy.get(getElementFromAlias('col-type-0')).select('serial'); cy.get(getElementFromAlias('column-1')) .clear() .type('name'); - cy.get(getElementFromAlias('col-type-1')).select('text'); + tableColumnTypeSelector('col-type-1'); + cy.get(getElementFromAlias('data_test_column_type_value_text')) + .first() + .click(); + + // cy.get(getElementFromAlias('col-type-1')).select('text'); // Set primary key cy.get(getElementFromAlias('primary-key-select-0')).select('0'); // Click on create diff --git a/console/cypress/integration/data/create-table/spec.js b/console/cypress/integration/data/create-table/spec.js index 3580bcef849..1a60f8147da 100644 --- a/console/cypress/integration/data/create-table/spec.js +++ b/console/cypress/integration/data/create-table/spec.js @@ -1,4 +1,5 @@ import { + tableColumnTypeSelector, getElementFromAlias, getTableName, getColName, @@ -34,7 +35,10 @@ export const failCTWithoutColumns = () => { export const failCTWithoutPK = () => { // Set first column cy.get(getElementFromAlias('column-0')).type(getColName(0)); - cy.get(getElementFromAlias('col-type-0')).select('serial'); + tableColumnTypeSelector('col-type-0'); + cy.get(getElementFromAlias('data_test_column_type_value_serial')) + .first() + .click(); // Click on create cy.get(getElementFromAlias('table-create')).click(); // Check for an error @@ -48,7 +52,10 @@ export const failCTWithoutPK = () => { export const failCTDuplicateColumns = () => { // Set second column cy.get(getElementFromAlias('column-1')).type(getColName(0)); - cy.get(getElementFromAlias('col-type-1')).select('serial'); + tableColumnTypeSelector('col-type-1'); + cy.get(getElementFromAlias('data_test_column_type_value_serial')) + .first() + .click(); // Set primary key cy.get(getElementFromAlias('primary-key-select-0')).select('0'); // Click on create @@ -65,12 +72,41 @@ export const failCTDuplicateColumns = () => { validateCT(getTableName(0, testName), 'failure'); }; +export const failCTDuplicatePrimaryKey = () => { + // Set second column + cy.get(getElementFromAlias('column-1')) + .clear() + .type(getColName(1)); + tableColumnTypeSelector('col-type-1'); + cy.get(getElementFromAlias('data_test_column_type_value_serial')) + .first() + .click(); + // Set primary key + cy.get(getElementFromAlias('primary-key-select-0')).select('0'); + cy.get(getElementFromAlias('primary-key-select-1')).select('0'); + cy.on('window:alert', str => { + expect( + str === + `You key [${getColName( + 0 + )}] is already present in the current set of primary keys.` + ).to.be.true; + }); + // Check if the route didn't change + cy.url().should('eq', `${baseUrl}/data/schema/public/table/add`); + // Validate + validateCT(getTableName(0, testName), 'failure'); +}; + export const failCTWrongDefaultValue = () => { // Set second column cy.get(getElementFromAlias('column-1')) .clear() .type(getColName(1)); - cy.get(getElementFromAlias('col-type-1')).select('integer'); + tableColumnTypeSelector('col-type-1'); + cy.get(getElementFromAlias('data_test_column_type_value_integer')) + .first() + .click(); cy.get(getElementFromAlias('col-default-1')).type('qwerty'); // Set primary key cy.get(getElementFromAlias('primary-key-select-0')).select('0'); @@ -87,7 +123,10 @@ export const passCT = () => { cy.get(getElementFromAlias('column-1')) .clear() .type(getColName(1)); - cy.get(getElementFromAlias('col-type-1')).select('text'); + tableColumnTypeSelector('col-type-1'); + cy.get(getElementFromAlias('data_test_column_type_value_text')) + .first() + .click(); cy.get(getElementFromAlias('col-default-1')).clear(); // Set primary key cy.get(getElementFromAlias('primary-key-select-0')).select('0'); @@ -114,13 +153,22 @@ export const passCTWithFK = () => { .type(getTableName(1, testName)); // Set first column cy.get(getElementFromAlias('column-0')).type(getColName(0)); - cy.get(getElementFromAlias('col-type-0')).select('serial'); + tableColumnTypeSelector('col-type-0'); + cy.get(getElementFromAlias('data_test_column_type_value_serial')) + .first() + .click(); // Set second column cy.get(getElementFromAlias('column-1')).type(getColName(1)); - cy.get(getElementFromAlias('col-type-1')).select('text'); + tableColumnTypeSelector('col-type-1'); + cy.get(getElementFromAlias('data_test_column_type_value_text')) + .first() + .click(); // Set third column cy.get(getElementFromAlias('column-2')).type(getColName(2)); - cy.get(getElementFromAlias('col-type-2')).select('text'); + tableColumnTypeSelector('col-type-2'); + cy.get(getElementFromAlias('data_test_column_type_value_text')) + .first() + .click(); // Set primary key cy.get(getElementFromAlias('primary-key-select-0')).select('0'); @@ -170,7 +218,10 @@ export const failCTDuplicateTable = () => { cy.get(getElementFromAlias('tableName')).type(getTableName(0, testName)); // Set column cy.get(getElementFromAlias('column-0')).type(getColName(1)); - cy.get(getElementFromAlias('col-type-0')).select('serial'); + tableColumnTypeSelector('col-type-0'); + cy.get(getElementFromAlias('data_test_column_type_value_serial')) + .first() + .click(); // Set primary key cy.get(getElementFromAlias('primary-key-select-0')).select('0'); // Click on create diff --git a/console/cypress/integration/data/insert-browse/spec.js b/console/cypress/integration/data/insert-browse/spec.js index 7b0f0e7341a..295dcb96b7e 100644 --- a/console/cypress/integration/data/insert-browse/spec.js +++ b/console/cypress/integration/data/insert-browse/spec.js @@ -5,6 +5,7 @@ import { dataTypes, getElementFromAlias, typeDefaults, + tableColumnTypeSelector, } from '../../../helpers/dataHelpers'; import { @@ -24,7 +25,12 @@ const setColumns = () => { // Type column name cy.get(getElementFromAlias(`column-${i}`)).type(getColName(i)); // Select column type - cy.get(getElementFromAlias(`col-type-${i}`)).select(dataTypes[i]); + tableColumnTypeSelector(`col-type-${i}`); + // cy.get(getElementFromAlias(`col-type-${i}`)).click(); + cy.get(getElementFromAlias(`data_test_column_type_value_${dataTypes[i]}`)) + .first() + .click(); + // cy.get(getElementFromAlias(`col-type-${i}`)).select(dataTypes[i]); if (i === dataTypes.indexOf('text')) { cy.get(getElementFromAlias(`unique-${i}`)).check(); @@ -109,7 +115,11 @@ export const passSearchTables = () => { // Type column name cy.get(getElementFromAlias('column-0')).type(getColName(0)); // Select column type - cy.get(getElementFromAlias('col-type-0')).select('integer'); + // cy.get(getElementFromAlias('col-type-0')).select('integer'); + tableColumnTypeSelector('col-type-0'); + cy.get(getElementFromAlias('data_test_column_type_value_integer')) + .first() + .click(); // Set primary key cy.get(getElementFromAlias('primary-key-select-0')).select('0'); // Click on create @@ -425,9 +435,18 @@ export const checkViewRelationship = () => { // Type table name cy.get(getElementFromAlias('tableName')).type(getTableName(2, testName)); cy.get(getElementFromAlias('column-0')).type('id'); - cy.get(getElementFromAlias('col-type-0')).select('serial'); + tableColumnTypeSelector('col-type-0'); + // cy.get(getElementFromAlias('col-type-0')).click(); + cy.get(getElementFromAlias('data_test_column_type_value_serial')) + .first() + .click(); cy.get(getElementFromAlias('column-1')).type('someID'); - cy.get(getElementFromAlias('col-type-1')).select('integer'); + tableColumnTypeSelector('col-type-1'); + // cy.get(getElementFromAlias('col-type-1')).click(); + cy.get(getElementFromAlias('data_test_column_type_value_integer')) + .first() + .click(); + // cy.get(getElementFromAlias('col-type-1')).select('integer'); // Set primary key cy.get(getElementFromAlias('primary-key-select-0')).select('0'); // Click on create diff --git a/console/cypress/integration/data/modify/spec.js b/console/cypress/integration/data/modify/spec.js index 60eb2046a79..5a3df9187e8 100644 --- a/console/cypress/integration/data/modify/spec.js +++ b/console/cypress/integration/data/modify/spec.js @@ -1,4 +1,5 @@ import { + tableColumnTypeSelector, baseUrl, getTableName, getColName, @@ -18,7 +19,11 @@ export const passMTCreateTable = () => { cy.url().should('eq', `${baseUrl}/data/schema/public/table/add`); cy.get(getElementFromAlias('tableName')).type(getTableName(0, testName)); cy.get(getElementFromAlias('column-0')).type('id'); - cy.get(getElementFromAlias('col-type-0')).select('Integer'); + tableColumnTypeSelector('col-type-0'); + cy.get(getElementFromAlias('data_test_column_type_value_integer')) + .first() + .click(); + // cy.get(getElementFromAlias('col-type-0')).select('Integer'); cy.get(getElementFromAlias('primary-key-select-0')).select('id'); cy.get(getElementFromAlias('table-create')).click(); cy.wait(7000); @@ -106,7 +111,11 @@ export const failMTWithoutColType = () => { export const Addcolumnnullable = () => { cy.get(getElementFromAlias('column-name')).type('{selectall}{del}'); cy.get(getElementFromAlias('column-name')).type(getColName(3)); - cy.get(getElementFromAlias('data-type')).select('Text'); + tableColumnTypeSelector('col-type-0'); + cy.get(getElementFromAlias('data_test_column_type_value_text')) + .first() + .click(); + // cy.get(getElementFromAlias('data-type')).select('Text'); cy.get(getElementFromAlias('nullable-checkbox')).uncheck({ force: true }); cy.get(getElementFromAlias('add-column-button')).click(); cy.wait(2500); @@ -121,7 +130,12 @@ export const Addcolumnnullable = () => { export const Addcolumnname = name => { cy.get(getElementFromAlias('column-name')).type('{selectall}{del}'); cy.get(getElementFromAlias('column-name')).type(name); - cy.get(getElementFromAlias('data-type')).select('integer'); + + tableColumnTypeSelector('col-type-0'); + cy.get(getElementFromAlias('data_test_column_type_value_integer')) + .first() + .click(); + // cy.get(getElementFromAlias('data-type')).select('integer'); cy.get(getElementFromAlias('add-column-button')).click(); cy.wait(5000); @@ -131,7 +145,11 @@ export const Addcolumnname = name => { export const passMTAddColumn = () => { cy.get(getElementFromAlias('column-name')).type('{selectall}{del}'); cy.get(getElementFromAlias('column-name')).type(getColName(0)); - cy.get(getElementFromAlias('data-type')).select('integer'); + tableColumnTypeSelector('col-type-0'); + cy.get(getElementFromAlias('data_test_column_type_value_integer')) + .first() + .click(); + // cy.get(getElementFromAlias('data-type')).select('integer'); cy.get(getElementFromAlias('add-column-button')).click(); cy.wait(5000); // cy.get('.notification-success').click(); @@ -287,14 +305,14 @@ export const Createtable = (name, dict) => { export const Createtables = () => { cy.get(getElementFromAlias('data-create-table')).click(); - Createtable('author', { id: 'Integer', name: 'Text' }); + Createtable('author', { id: 'integer', name: 'Text' }); cy.get(getElementFromAlias('sidebar-add-table')).click(); Createtable('article', { - id: 'Integer', - title: 'Text', - Content: 'Text', - author_id: 'Integer', - rating: 'Integer', + id: 'integer', + title: 'text', + Content: 'text', + author_id: 'integer', + rating: 'integer', }); }; diff --git a/console/cypress/integration/data/permissions/spec.js b/console/cypress/integration/data/permissions/spec.js index 51215634652..bb483fc9424 100644 --- a/console/cypress/integration/data/permissions/spec.js +++ b/console/cypress/integration/data/permissions/spec.js @@ -1,4 +1,5 @@ import { + tableColumnTypeSelector, baseUrl, getTableName, getElementFromAlias, @@ -21,13 +22,26 @@ export const passPTCreateTable = () => { cy.get(getElementFromAlias('tableName')).type(getTableName(0, testName)); // Set first column cy.get(getElementFromAlias('column-0')).type(getColName(0)); - cy.get(getElementFromAlias('col-type-0')).select('serial'); + tableColumnTypeSelector('col-type-0'); + cy.get(getElementFromAlias('data_test_column_type_value_serial')) + .first() + .click(); + // cy.get(getElementFromAlias('col-type-0')).select('serial'); // Set second column cy.get(getElementFromAlias('column-1')).type(getColName(1)); - cy.get(getElementFromAlias('col-type-1')).select('integer'); + tableColumnTypeSelector('col-type-1'); + cy.get(getElementFromAlias('data_test_column_type_value_integer')) + .first() + .click(); + + // cy.get(getElementFromAlias('col-type-1')).select('integer'); // Set third column cy.get(getElementFromAlias('column-2')).type(getColName(2)); - cy.get(getElementFromAlias('col-type-2')).select('text'); + tableColumnTypeSelector('col-type-2'); + cy.get(getElementFromAlias('data_test_column_type_value_text')) + .first() + .click(); + // cy.get(getElementFromAlias('col-type-2')).select('text'); // Set primary key cy.get(getElementFromAlias('primary-key-select-0')).select('0'); // Create diff --git a/console/cypress/integration/data/relationships/spec.js b/console/cypress/integration/data/relationships/spec.js index 8e40a8c1d37..600b5c28ec5 100644 --- a/console/cypress/integration/data/relationships/spec.js +++ b/console/cypress/integration/data/relationships/spec.js @@ -1,4 +1,8 @@ -import { baseUrl, getElementFromAlias } from '../../../helpers/dataHelpers'; +import { + baseUrl, + getElementFromAlias, + tableColumnTypeSelector, +} from '../../../helpers/dataHelpers'; import { setMetaData, @@ -28,7 +32,11 @@ export const Createtable = (name, fields) => { for (const key in fields) { if (fields.hasOwnProperty(key)) { cy.get(getElementFromAlias(`column-${i}`)).type(key); - cy.get(getElementFromAlias(`col-type-${i}`)).select(fields[key]); + tableColumnTypeSelector(`col-type-${i}`); + cy.get(getElementFromAlias(`data_test_column_type_value_${fields[key]}`)) + .first() + .click(); + // cy.get(getElementFromAlias(`col-type-${i}`)).select(fields[key]); i++; } } @@ -75,19 +83,19 @@ export const Createtable = (name, fields) => { }; export const passRTCreateTables = () => { - Createtable('author', { id: 'Integer', name: 'Text' }); + Createtable('author', { id: 'integer', name: 'text' }); Createtable('article', { - id: 'Integer', - title: 'Text', - Content: 'Text', - author_id: 'Integer', - rating: 'Integer', + id: 'integer', + title: 'text', + Content: 'text', + author_id: 'integer', + rating: 'integer', }); Createtable('comment', { - id: 'Integer', - user_id: 'Integer', - article_id: 'Integer', - comment: 'Text', + id: 'integer', + user_id: 'integer', + article_id: 'integer', + comment: 'text', }); }; diff --git a/console/cypress/integration/data/views/spec.js b/console/cypress/integration/data/views/spec.js index a38e7f019f7..385e1be59c1 100644 --- a/console/cypress/integration/data/views/spec.js +++ b/console/cypress/integration/data/views/spec.js @@ -1,4 +1,8 @@ -import { getElementFromAlias, baseUrl } from '../../../helpers/dataHelpers'; +import { + getElementFromAlias, + baseUrl, + tableColumnTypeSelector, +} from '../../../helpers/dataHelpers'; import { setMetaData, @@ -17,7 +21,10 @@ export const Createtable = (name, dict) => { const values = Object.keys(dict).map(k => dict[k]); for (let i = 0; i < keys.length; i += 1) { cy.get(getElementFromAlias(`column-${i}`)).type(keys[i]); - cy.get(getElementFromAlias(`col-type-${i}`)).select(values[i]); + tableColumnTypeSelector(`col-type-${i}`); + cy.get(getElementFromAlias(`data_test_column_type_value_${values[i]}`)) + .first() + .click(); } cy.get(getElementFromAlias('primary-key-select-0')).select('id'); cy.get(getElementFromAlias('table-create')).click(); @@ -32,21 +39,21 @@ export const Createtable = (name, dict) => { export const passVCreateTables = () => { cy.get(getElementFromAlias('data-create-table')).click(); - Createtable('author', { id: 'Integer', name: 'Text' }); + Createtable('author', { id: 'integer', name: 'text' }); cy.get(getElementFromAlias('sidebar-add-table')).click(); Createtable('article', { - id: 'Integer', - title: 'Text', - Content: 'Text', - author_id: 'Integer', - rating: 'Integer', + id: 'integer', + title: 'text', + Content: 'text', + author_id: 'integer', + rating: 'integer', }); cy.get(getElementFromAlias('sidebar-add-table')).click(); Createtable('comment', { - id: 'Integer', - user_id: 'Integer', - article_id: 'Integer', - comment: 'Text', + id: 'integer', + user_id: 'integer', + article_id: 'integer', + comment: 'text', }); }; diff --git a/console/cypress/integration/events/create-trigger/spec.js b/console/cypress/integration/events/create-trigger/spec.js index fab25b8d8dc..cb8c60b497b 100644 --- a/console/cypress/integration/events/create-trigger/spec.js +++ b/console/cypress/integration/events/create-trigger/spec.js @@ -8,7 +8,10 @@ import { getTimeoutSeconds, baseUrl, } from '../../../helpers/eventHelpers'; -import { getColName } from '../../../helpers/dataHelpers'; +import { + getColName, + tableColumnTypeSelector, +} from '../../../helpers/dataHelpers'; import { setMetaData, validateCT, @@ -31,13 +34,26 @@ export const passPTCreateTable = () => { cy.get(getElementFromAlias('tableName')).type(getTableName(0, testName)); // Set first column cy.get(getElementFromAlias('column-0')).type(getColName(0)); - cy.get(getElementFromAlias('col-type-0')).select('serial'); + tableColumnTypeSelector('col-type-0'); + cy.get(getElementFromAlias('data_test_column_type_value_serial')) + .first() + .click(); + // cy.get(getElementFromAlias('col-type-0')).select('serial'); // Set second column cy.get(getElementFromAlias('column-1')).type(getColName(1)); - cy.get(getElementFromAlias('col-type-1')).select('integer'); + tableColumnTypeSelector('col-type-1'); + cy.get(getElementFromAlias('data_test_column_type_value_integer')) + .first() + .click(); + + // cy.get(getElementFromAlias('col-type-1')).select('integer'); // Set third column cy.get(getElementFromAlias('column-2')).type(getColName(2)); - cy.get(getElementFromAlias('col-type-2')).select('text'); + tableColumnTypeSelector('col-type-2'); + cy.get(getElementFromAlias('data_test_column_type_value_text')) + .first() + .click(); + // cy.get(getElementFromAlias('col-type-2')).select('text'); // Set primary key cy.get(getElementFromAlias('primary-key-select-0')).select('0'); // Create diff --git a/console/package-lock.json b/console/package-lock.json index c9e03157f3d..e8930a76093 100644 --- a/console/package-lock.json +++ b/console/package-lock.json @@ -370,7 +370,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz", "integrity": "sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==", - "dev": true, "requires": { "@babel/types": "^7.0.0" } @@ -1559,7 +1558,6 @@ "version": "7.3.3", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.3.tgz", "integrity": "sha512-2tACZ80Wg09UnPg5uGAOUvvInaqLk3l/IAhQzlxLQOIXacr6bMsra5SH6AWw/hIDRCSbCdHP2KzSOD+cT7TzMQ==", - "dev": true, "requires": { "esutils": "^2.0.2", "lodash": "^4.17.11", @@ -1569,8 +1567,7 @@ "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" } } }, @@ -1613,6 +1610,62 @@ } } }, + "@emotion/babel-utils": { + "version": "0.6.10", + "resolved": "https://registry.npmjs.org/@emotion/babel-utils/-/babel-utils-0.6.10.tgz", + "integrity": "sha512-/fnkM/LTEp3jKe++T0KyTszVGWNKPNOUJfjNKLO17BzQ6QPxgbg3whayom1Qr2oLFH3V92tDymU+dT5q676uow==", + "requires": { + "@emotion/hash": "^0.6.6", + "@emotion/memoize": "^0.6.6", + "@emotion/serialize": "^0.9.1", + "convert-source-map": "^1.5.1", + "find-root": "^1.1.0", + "source-map": "^0.7.2" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==" + } + } + }, + "@emotion/hash": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.6.6.tgz", + "integrity": "sha512-ojhgxzUHZ7am3D2jHkMzPpsBAiB005GF5YU4ea+8DNPybMk01JJUM9V9YRlF/GE95tcOm8DxQvWA2jq19bGalQ==" + }, + "@emotion/memoize": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.6.6.tgz", + "integrity": "sha512-h4t4jFjtm1YV7UirAFuSuFGyLa+NNxjdkq6DpFLANNQY5rHueFZHVY+8Cu1HYVP6DrheB0kv4m5xPjo7eKT7yQ==" + }, + "@emotion/serialize": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-0.9.1.tgz", + "integrity": "sha512-zTuAFtyPvCctHBEL8KZ5lJuwBanGSutFEncqLn/m9T1a6a93smBStK+bZzcNPgj4QS8Rkw9VTwJGhRIUVO8zsQ==", + "requires": { + "@emotion/hash": "^0.6.6", + "@emotion/memoize": "^0.6.6", + "@emotion/unitless": "^0.6.7", + "@emotion/utils": "^0.8.2" + } + }, + "@emotion/stylis": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.7.1.tgz", + "integrity": "sha512-/SLmSIkN13M//53TtNxgxo57mcJk/UJIDFRKwOiLIBEyBHEcipgR6hNMQ/59Sl4VjCJ0Z/3zeAZyvnSLPG/1HQ==" + }, + "@emotion/unitless": { + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.6.7.tgz", + "integrity": "sha512-Arj1hncvEVqQ2p7Ega08uHLr1JuRYBuO5cIvcA+WWEQ5+VmkOE3ZXzl04NbQxeQpWX78G7u6MqxKuNX3wvYZxg==" + }, + "@emotion/utils": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.8.2.tgz", + "integrity": "sha512-rLu3wcBWH4P5q1CGoSSH/i9hrXs7SlbRLkoq9IGuoPYNGQvDJ3pt/wmOM+XgYjIDRMVIdkUWt0RsfzF50JfnCw==" + }, "@webassemblyjs/ast": { "version": "1.7.8", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.7.8.tgz", @@ -1800,8 +1853,7 @@ "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "accepts": { "version": "1.3.5", @@ -2409,6 +2461,32 @@ } } }, + "babel-plugin-emotion": { + "version": "9.2.11", + "resolved": "https://registry.npmjs.org/babel-plugin-emotion/-/babel-plugin-emotion-9.2.11.tgz", + "integrity": "sha512-dgCImifnOPPSeXod2znAmgc64NhaaOjGEHROR/M+lmStb3841yK1sgaDYAYMnlvWNz8GnpwIPN0VmNpbWYZ+VQ==", + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@emotion/babel-utils": "^0.6.4", + "@emotion/hash": "^0.6.2", + "@emotion/memoize": "^0.6.1", + "@emotion/stylis": "^0.7.0", + "babel-plugin-macros": "^2.0.0", + "babel-plugin-syntax-jsx": "^6.18.0", + "convert-source-map": "^1.5.0", + "find-root": "^1.1.0", + "mkdirp": "^0.5.1", + "source-map": "^0.5.7", + "touch": "^2.0.1" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, "babel-plugin-istanbul": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.1.tgz", @@ -2465,6 +2543,73 @@ } } }, + "babel-plugin-macros": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-2.5.1.tgz", + "integrity": "sha512-xN3KhAxPzsJ6OQTktCanNpIFnnMsCV+t8OloKxIL72D6+SUZYFn9qfklPgef5HyyDtzYZqqb+fs1S12+gQY82Q==", + "requires": { + "@babel/runtime": "^7.4.2", + "cosmiconfig": "^5.2.0", + "resolve": "^1.10.0" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.4.tgz", + "integrity": "sha512-w0+uT71b6Yi7i5SE0co4NioIpSYS6lLiXvCzWzGSKvpK5vdQtCbICHMj+gbAKAOtxiV6HsVh/MBdaF9EQ6faSg==", + "requires": { + "regenerator-runtime": "^0.13.2" + } + }, + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + } + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "regenerator-runtime": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", + "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" + }, + "resolve": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz", + "integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==", + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "babel-plugin-syntax-jsx": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", + "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=" + }, "babel-plugin-transform-react-remove-prop-types": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.18.tgz", @@ -2949,6 +3094,21 @@ "os-homedir": "^1.0.1" } }, + "caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", + "requires": { + "callsites": "^2.0.0" + }, + "dependencies": { + "callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=" + } + } + }, "caller-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", @@ -3604,7 +3764,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", - "dev": true, "requires": { "safe-buffer": "~5.1.1" } @@ -3698,6 +3857,20 @@ "elliptic": "^6.0.0" } }, + "create-emotion": { + "version": "9.2.12", + "resolved": "https://registry.npmjs.org/create-emotion/-/create-emotion-9.2.12.tgz", + "integrity": "sha512-P57uOF9NL2y98Xrbl2OuiDQUZ30GVmASsv5fbsjF4Hlraip2kyAvMm+2PoYUvFFw03Fhgtxk3RqZSm2/qHL9hA==", + "requires": { + "@emotion/hash": "^0.6.2", + "@emotion/memoize": "^0.6.1", + "@emotion/stylis": "^0.7.0", + "@emotion/unitless": "^0.6.2", + "csstype": "^2.5.2", + "stylis": "^3.5.0", + "stylis-rule-sheet": "^0.0.10" + } + }, "create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -3926,6 +4099,11 @@ } } }, + "csstype": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.4.tgz", + "integrity": "sha512-lAJUJP3M6HxFXbqtGRc0iZrdyeN+WzOWeY0q/VnFzI+kqVrYIzC7bWlKqCW7oCIdzoPkvfp82EVvrTlQ8zsWQg==" + }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -4405,6 +4583,15 @@ "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", "dev": true }, + "emotion": { + "version": "9.2.12", + "resolved": "https://registry.npmjs.org/emotion/-/emotion-9.2.12.tgz", + "integrity": "sha512-hcx7jppaI8VoXxIWEhxpDW7I+B4kq9RNzQLmsrF6LY8BGKqe2N+gFAQr0EfuFucFlPs2A9HM4+xNj4NeqEWIOQ==", + "requires": { + "babel-plugin-emotion": "^9.2.11", + "create-emotion": "^9.2.12" + } + }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -4456,7 +4643,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, "requires": { "is-arrayish": "^0.2.1" } @@ -4920,8 +5106,7 @@ "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, "etag": { "version": "1.8.1", @@ -5403,6 +5588,11 @@ "integrity": "sha1-M8RLQpqysvBkYpnF+fcY83b/jVQ=", "dev": true }, + "find-root": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==" + }, "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", @@ -7199,6 +7389,30 @@ "integrity": "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=", "optional": true }, + "import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "requires": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + }, + "dependencies": { + "caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", + "requires": { + "caller-callsite": "^2.0.0" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=" + } + } + }, "import-local": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", @@ -7492,8 +7706,7 @@ "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" }, "is-binary-path": { "version": "1.0.1", @@ -7566,8 +7779,7 @@ "is-directory": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", - "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", - "dev": true + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=" }, "is-dotfile": { "version": "1.0.3", @@ -7952,8 +8164,7 @@ "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" }, "json-schema": { "version": "0.2.3", @@ -8925,6 +9136,11 @@ "p-is-promise": "^1.1.0" } }, + "memoize-one": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.0.4.tgz", + "integrity": "sha512-P0z5IeAH6qHHGkJIXWw0xC2HNEgkx/9uWWBQw64FJj3/ol14VYdfVGWWr0fXfjhhv3TKVIqUq65os6O4GUNksA==" + }, "memory-fs": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", @@ -11010,8 +11226,7 @@ "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" }, "path-to-regexp": { "version": "0.1.7", @@ -12016,6 +12231,14 @@ "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", "dev": true }, + "raf": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", + "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", + "requires": { + "performance-now": "^2.1.0" + } + }, "ramda": { "version": "0.24.1", "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.24.1.tgz", @@ -12257,6 +12480,14 @@ } } }, + "react-input-autosize": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/react-input-autosize/-/react-input-autosize-2.2.1.tgz", + "integrity": "sha512-3+K4CD13iE4lQQ2WlF8PuV5htfmTRLH6MDnfndHM6LuBRszuXnuyIfE7nhSKt8AzRBZ50bu0sAhkNMeS5pxQQA==", + "requires": { + "prop-types": "^15.5.8" + } + }, "react-is": { "version": "16.5.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.5.2.tgz", @@ -12390,6 +12621,20 @@ "resolved": "https://registry.npmjs.org/react-router-redux/-/react-router-redux-4.0.8.tgz", "integrity": "sha1-InQDWWtRUeGCN32rg1tdRfD4BU4=" }, + "react-select": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/react-select/-/react-select-2.4.3.tgz", + "integrity": "sha512-cmxNaiHpviRYkojeW9rGEUJ4jpX7QTmPe2wcscwA4d1lStzw/cJtr4ft5H2O/YhfpkrcwaLghu3XmEYdXhBo8Q==", + "requires": { + "classnames": "^2.2.5", + "emotion": "^9.1.2", + "memoize-one": "^5.0.0", + "prop-types": "^15.6.0", + "raf": "^3.4.0", + "react-input-autosize": "^2.2.1", + "react-transition-group": "^2.2.1" + } + }, "react-side-effect": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/react-side-effect/-/react-side-effect-1.1.5.tgz", @@ -14243,6 +14488,16 @@ } } }, + "stylis": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-3.5.4.tgz", + "integrity": "sha512-8/3pSmthWM7lsPBKv7NXkzn2Uc9W7NotcwGNpJaa3k7WMM1XDCA4MgT5k/8BIexd5ydZdboXtU90XH9Ec4Bv/Q==" + }, + "stylis-rule-sheet": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stylis-rule-sheet/-/stylis-rule-sheet-0.0.10.tgz", + "integrity": "sha512-nTbZoaqoBnmK+ptANthb10ZRZOGC+EmTLLUxeYIuHNkEKcmKgXX1XWKkUBT2Ac4es3NybooPe0SmvKdhKJZAuw==" + }, "subscriptions-transport-ws": { "version": "0.9.15", "resolved": "https://registry.npmjs.org/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.15.tgz", @@ -14656,6 +14911,24 @@ "resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz", "integrity": "sha1-bkWxJj8gF/oKzH2J14sVuL932jI=" }, + "touch": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/touch/-/touch-2.0.2.tgz", + "integrity": "sha512-qjNtvsFXTRq7IuMLweVgFxmEuQ6gLbRs2jQxL80TtZ31dEKWYIxRXquij6w6VimyDek5hD3PytljHmEtAs2u0A==", + "requires": { + "nopt": "~1.0.10" + }, + "dependencies": { + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "requires": { + "abbrev": "1" + } + } + } + }, "tough-cookie": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", diff --git a/console/package.json b/console/package.json index ce9d0847d1c..22faabccb5c 100644 --- a/console/package.json +++ b/console/package.json @@ -89,6 +89,7 @@ "react-redux": "^5.0.6", "react-router": "^3.2.0", "react-router-redux": "^4.0.8", + "react-select": "^2.4.3", "react-table": "^6.8.6", "react-tabs": "^2.1.0", "react-toggle": "^4.0.2", diff --git a/console/src/components/Common/Common.scss b/console/src/components/Common/Common.scss index 3ad62a20452..78ebdd0fe5c 100644 --- a/console/src/components/Common/Common.scss +++ b/console/src/components/Common/Common.scss @@ -280,6 +280,11 @@ button { outline: none; } +button > i { + padding-top: 3px; + padding-bottom: 3px; +} + .no_border { border: 0 !important; border-radius: 0 !important; diff --git a/console/src/components/Common/SearchableSelect/SearchableSelect.js b/console/src/components/Common/SearchableSelect/SearchableSelect.js new file mode 100644 index 00000000000..f4f8759d2d1 --- /dev/null +++ b/console/src/components/Common/SearchableSelect/SearchableSelect.js @@ -0,0 +1,70 @@ +import React from 'react'; +import Select, { components } from 'react-select'; +import PropTypes from 'prop-types'; + +/* + * Wrap the option generated by react-select and adds utility properties + * */ +const CustomOption = props => { + return ( +
+ +
+ ); +}; + +/* + * Searchable select box component + * 1) options: Accepts options + * 2) value: selectedValue + * 3) onChange: function to call on change of value + * 4) bsClass: Wrapper class + * 5) customStyle: Custom style + * */ +const SearchableSelectBox = ({ + options, + onChange, + value, + bsClass, + styleOverrides, +}) => { + /* Select element style customization */ + + const customStyles = {}; + if (styleOverrides) { + Object.keys(styleOverrides).forEach(comp => { + customStyles[comp] = provided => { + return { + ...provided, + ...styleOverrides[comp], + }; + }; + }); + } + + return ( + + ); +}; + +TextInput.propTypes = { + onChange: PropTypes.func.isRequired, +}; + +export default TextInput; diff --git a/console/src/components/Main/Main.js b/console/src/components/Main/Main.js index 3816f6b4759..8a311a510c4 100644 --- a/console/src/components/Main/Main.js +++ b/console/src/components/Main/Main.js @@ -323,9 +323,7 @@ class Main extends React.Component {
{'GitHub'}
@@ -356,9 +354,7 @@ class Main extends React.Component {
{'Twitter'}
diff --git a/console/src/components/Services/CustomResolver/Common/Common.js b/console/src/components/Services/CustomResolver/Common/Common.js index 3d40fa3f74a..0184ec1c7f4 100644 --- a/console/src/components/Services/CustomResolver/Common/Common.js +++ b/console/src/components/Services/CustomResolver/Common/Common.js @@ -100,12 +100,6 @@ class Common extends React.Component {