From 3cfeb6064a90023a8d6c50d62fb79a3c8d9fccfc Mon Sep 17 00:00:00 2001 From: Rishichandra Wawhal Date: Wed, 23 Jan 2019 07:26:40 +0530 Subject: [PATCH] reuse buttons across console for uniformity (#1400) --- console/src/components/Common/Common.scss | 8 ++ .../Services/CustomResolver/Add/Add.js | 8 +- .../Services/CustomResolver/Edit/Edit.js | 31 ++-- .../CustomResolver/Landing/CustomResolver.js | 8 +- .../Services/CustomResolver/Styles.scss | 2 +- .../components/Services/Data/Add/AddTable.js | 8 +- .../Services/Data/Metadata/ClearAccessKey.js | 10 +- .../Services/Data/Metadata/ExportMetadata.js | 10 +- .../Services/Data/Metadata/ImportMetadata.js | 9 +- .../Services/Data/Metadata/ReloadMetadata.js | 9 +- .../Services/Data/Metadata/ResetMetadata.js | 9 +- .../components/Services/Data/Notification.js | 9 +- .../Data/PageContainer/PageContainer.js | 9 +- .../components/Services/Data/RawSQL/RawSQL.js | 18 +-- .../Services/Data/Schema/AutoAddRelations.js | 21 +-- .../components/Services/Data/Schema/Schema.js | 26 ++-- .../Services/Data/TableBrowseRows/EditItem.js | 8 +- .../Data/TableBrowseRows/FilterQuery.js | 8 +- .../Services/Data/TableBrowseRows/ViewRows.js | 25 ++-- .../Services/Data/TableCommon/TableHeader.js | 13 -- .../Data/TableInsertItem/InsertItem.js | 15 +- .../Services/Data/TableModify/ModifyTable.js | 61 ++++---- .../Services/Data/TableModify/ModifyView.js | 33 ++--- .../Data/TablePermissions/Permissions.js | 40 +++--- .../AddManualRelationship.js | 16 ++- .../Data/TableRelationships/Relationships.js | 45 +++--- .../TableRelationships/RelationshipsView.js | 12 +- .../Services/EventTrigger/Add/AddTrigger.js | 53 ++++--- .../EventTrigger/Modify/ActionButtons.js | 8 +- .../Services/EventTrigger/Modify/Editor.js | 21 ++- .../Services/EventTrigger/Modify/Modify.scss | 2 - .../Services/EventTrigger/Notification.js | 9 +- .../PageContainer/PageContainer.js | 9 +- .../EventTrigger/PendingEvents/FilterQuery.js | 16 ++- .../ProcessedEvents/FilterQuery.js | 16 ++- .../EventTrigger/RunningEvents/FilterQuery.js | 16 ++- .../EventTrigger/Schema/AutoAddRelations.js | 134 ------------------ .../Services/EventTrigger/Schema/Schema.js | 8 +- .../EventTrigger/StreamingLogs/Logs.js | 76 +++++----- .../TableCommon/RedeliverEvent.js | 17 ++- .../EventTrigger/TableCommon/Table.scss | 14 +- .../Services/Layout/Button/Button.js | 40 ++++++ .../Services/Layout/LeftNavBar/LeftNavBar.js | 9 +- .../Layout/RightLayoutWrapper/Schema.js | 9 +- 44 files changed, 480 insertions(+), 448 deletions(-) delete mode 100644 console/src/components/Services/EventTrigger/Schema/AutoAddRelations.js create mode 100644 console/src/components/Services/Layout/Button/Button.js diff --git a/console/src/components/Common/Common.scss b/console/src/components/Common/Common.scss index 604e97ec0e9..fcd625170d9 100644 --- a/console/src/components/Common/Common.scss +++ b/console/src/components/Common/Common.scss @@ -789,6 +789,9 @@ code background-color: #F2B130; } } +.gray_button { + background: #f2f2f2 !important; +} .docsButton { background-color: #fff; @@ -1109,6 +1112,11 @@ code height: 100vh; margin-bottom: 50px; } +.button_mar_right +{ + margin-right: 20px; +} + /* container height subtracting top header and bottom scroll bar */ $mainContainerHeight: calc(100vh - 50px - 25px); diff --git a/console/src/components/Services/CustomResolver/Add/Add.js b/console/src/components/Services/CustomResolver/Add/Add.js index 165c19a8522..7b5c54004dd 100644 --- a/console/src/components/Services/CustomResolver/Add/Add.js +++ b/console/src/components/Services/CustomResolver/Add/Add.js @@ -3,6 +3,7 @@ import Common from '../Common/Common'; import { addResolver, RESET } from './addResolverReducer'; import Helmet from 'react-helmet'; +import Button from '../../Layout/Button/Button'; import { pageTitle } from '../constants'; @@ -25,14 +26,15 @@ class Add extends React.Component { >
- + {/* */} diff --git a/console/src/components/Services/CustomResolver/Edit/Edit.js b/console/src/components/Services/CustomResolver/Edit/Edit.js index 6fec1fce0ab..324959a90da 100644 --- a/console/src/components/Services/CustomResolver/Edit/Edit.js +++ b/console/src/components/Services/CustomResolver/Edit/Edit.js @@ -13,6 +13,7 @@ import { push } from 'react-router-redux'; import Helmet from 'react-helmet'; import tabInfo from './tabInfo'; import CommonTabLayout from '../../Layout/CommonTabLayout/CommonTabLayout'; +import Button from '../../Layout/Button/Button'; import { appPrefix, pageTitle } from '../constants'; @@ -97,8 +98,10 @@ class Edit extends React.Component { const generateMigrateBtns = () => { return 'isModify' in editState && !editState.isModify ? (
- - + {this.state.deleteConfirmationError ? ( ) : (
- - +
); }; diff --git a/console/src/components/Services/CustomResolver/Landing/CustomResolver.js b/console/src/components/Services/CustomResolver/Landing/CustomResolver.js index 0b7cf078a43..6c32122f698 100644 --- a/console/src/components/Services/CustomResolver/Landing/CustomResolver.js +++ b/console/src/components/Services/CustomResolver/Landing/CustomResolver.js @@ -4,6 +4,7 @@ import { push } from 'react-router-redux'; import { appPrefix, pageTitle } from '../constants'; import globals from '../../../../Globals'; +import Button from '../../Layout/Button/Button'; class CustomResolver extends React.Component { render() { @@ -25,16 +26,17 @@ class CustomResolver extends React.Component { Remote Schemas   {migrationMode ? ( - + ) : null}
diff --git a/console/src/components/Services/CustomResolver/Styles.scss b/console/src/components/Services/CustomResolver/Styles.scss index b6e769b34d5..b0bd7b40278 100644 --- a/console/src/components/Services/CustomResolver/Styles.scss +++ b/console/src/components/Services/CustomResolver/Styles.scss @@ -139,4 +139,4 @@ line-height: 26px; } -} +} \ No newline at end of file diff --git a/console/src/components/Services/Data/Add/AddTable.js b/console/src/components/Services/Data/Add/AddTable.js index ccb58f1d7f2..d8a3c0f82e2 100644 --- a/console/src/components/Services/Data/Add/AddTable.js +++ b/console/src/components/Services/Data/Add/AddTable.js @@ -4,6 +4,7 @@ import Helmet from 'react-helmet'; import * as tooltip from './Tooltips'; import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger'; +import Button from '../../Layout/Button/Button'; import dataTypes from '../Common/DataTypes'; import { showErrorNotification } from '../Notification'; @@ -472,14 +473,15 @@ class AddTable extends Component { }} />
- +
diff --git a/console/src/components/Services/Data/Metadata/ClearAccessKey.js b/console/src/components/Services/Data/Metadata/ClearAccessKey.js index 73f01956b7a..d44b7d2c3d9 100644 --- a/console/src/components/Services/Data/Metadata/ClearAccessKey.js +++ b/console/src/components/Services/Data/Metadata/ClearAccessKey.js @@ -7,6 +7,7 @@ import { showSuccessNotification, showErrorNotification, } from '../Notification'; +import Button from '../../Layout/Button/Button'; class ClearAccessKey extends Component { constructor() { @@ -15,13 +16,14 @@ class ClearAccessKey extends Component { this.state.isClearing = false; } render() { - const styles = require('../PageContainer/PageContainer.scss'); const metaDataStyles = require('./Metadata.scss'); return (
- +
); } diff --git a/console/src/components/Services/Data/Metadata/ExportMetadata.js b/console/src/components/Services/Data/Metadata/ExportMetadata.js index 9524a81c423..bd1e60da416 100644 --- a/console/src/components/Services/Data/Metadata/ExportMetadata.js +++ b/console/src/components/Services/Data/Metadata/ExportMetadata.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Endpoints, { globalCookiePolicy } from '../../../../Endpoints'; +import Button from '../../Layout/Button/Button'; import { showSuccessNotification, @@ -14,13 +15,14 @@ class ExportMetadata extends Component { this.state.isExporting = false; } render() { - const styles = require('../PageContainer/PageContainer.scss'); const metaDataStyles = require('./Metadata.scss'); return (
- +
); } diff --git a/console/src/components/Services/Data/Metadata/ImportMetadata.js b/console/src/components/Services/Data/Metadata/ImportMetadata.js index b084d26a048..2054eda5228 100644 --- a/console/src/components/Services/Data/Metadata/ImportMetadata.js +++ b/console/src/components/Services/Data/Metadata/ImportMetadata.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Endpoints, { globalCookiePolicy } from '../../../../Endpoints'; +import Button from '../../Layout/Button/Button'; import { showSuccessNotification, @@ -83,13 +84,13 @@ class ImportMetadata extends Component { }); } render() { - const styles = require('../PageContainer/PageContainer.scss'); const metaDataStyles = require('./Metadata.scss'); return (
- +
); } diff --git a/console/src/components/Services/Data/Metadata/ReloadMetadata.js b/console/src/components/Services/Data/Metadata/ReloadMetadata.js index 84b17d589c9..111cf41cd2c 100644 --- a/console/src/components/Services/Data/Metadata/ReloadMetadata.js +++ b/console/src/components/Services/Data/Metadata/ReloadMetadata.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Endpoints, { globalCookiePolicy } from '../../../../Endpoints'; +import Button from '../../Layout/Button/Button'; import { showSuccessNotification, @@ -14,13 +15,13 @@ class ReloadMetadata extends Component { this.state.isReloading = false; } render() { - const styles = require('../PageContainer/PageContainer.scss'); const metaDataStyles = require('./Metadata.scss'); return (
- +
); } diff --git a/console/src/components/Services/Data/Metadata/ResetMetadata.js b/console/src/components/Services/Data/Metadata/ResetMetadata.js index cb0f3ceb294..e4338540811 100644 --- a/console/src/components/Services/Data/Metadata/ResetMetadata.js +++ b/console/src/components/Services/Data/Metadata/ResetMetadata.js @@ -2,6 +2,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Endpoints, { globalCookiePolicy } from '../../../../Endpoints'; import { showNotification } from '../../../App/Actions'; +import Button from '../../Layout/Button/Button'; import { showSuccessNotification, @@ -16,13 +17,13 @@ class ResetMetadata extends Component { } render() { - const styles = require('../PageContainer/PageContainer.scss'); const metaDataStyles = require('./Metadata.scss'); return (
- +
); } diff --git a/console/src/components/Services/Data/Notification.js b/console/src/components/Services/Data/Notification.js index 18c6057d60d..18bfa733372 100644 --- a/console/src/components/Services/Data/Notification.js +++ b/console/src/components/Services/Data/Notification.js @@ -2,6 +2,7 @@ import React from 'react'; import AceEditor from 'react-ace'; import { showNotification, showTempNotification } from '../../App/Actions'; import { notifExpand, notifMsg } from '../../App/Actions'; +import Button from '../Layout/Button/Button'; const styles = require('./TableCommon/Table.scss'); @@ -47,15 +48,17 @@ const showErrorNotification = (title, message, reqBody, error) => { let finalJson = error ? error.message : '{}'; if (error && 'action' in error) { refreshBtn = ( - + ); finalJson = error.action; } else if (error && 'internal' in error) { diff --git a/console/src/components/Services/Data/PageContainer/PageContainer.js b/console/src/components/Services/Data/PageContainer/PageContainer.js index 9cd44717926..101acb69f2c 100644 --- a/console/src/components/Services/Data/PageContainer/PageContainer.js +++ b/console/src/components/Services/Data/PageContainer/PageContainer.js @@ -4,6 +4,7 @@ import React from 'react'; import { connect } from 'react-redux'; import { Link } from 'react-router'; import globals from '../../../../Globals'; +import Button from '../../Layout/Button/Button'; import { LISTING_SCHEMA } from '../DataActions'; @@ -145,12 +146,14 @@ const PageContainer = ({ className={styles.padd_remove_full} to={'/data/schema/' + schemaName + '/table/add'} > - + ) : null} diff --git a/console/src/components/Services/Data/RawSQL/RawSQL.js b/console/src/components/Services/Data/RawSQL/RawSQL.js index 2ac1837d77d..f561d078461 100644 --- a/console/src/components/Services/Data/RawSQL/RawSQL.js +++ b/console/src/components/Services/Data/RawSQL/RawSQL.js @@ -4,7 +4,8 @@ import Helmet from 'react-helmet'; import AceEditor from 'react-ace'; import 'brace/mode/sql'; import Modal from 'react-bootstrap/lib/Modal'; -import Button from 'react-bootstrap/lib/Button'; +import ModalButton from 'react-bootstrap/lib/Button'; +import Button from '../../Layout/Button/Button'; import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger'; import Tooltip from 'react-bootstrap/lib/Tooltip'; @@ -341,19 +342,20 @@ const RawSQL = ({ ) : (
)} - +
{alert}
- + Run SQL @@ -367,14 +369,14 @@ const RawSQL = ({ - - +
diff --git a/console/src/components/Services/Data/Schema/AutoAddRelations.js b/console/src/components/Services/Data/Schema/AutoAddRelations.js index 6a399fb02d8..a21a6e1b613 100644 --- a/console/src/components/Services/Data/Schema/AutoAddRelations.js +++ b/console/src/components/Services/Data/Schema/AutoAddRelations.js @@ -9,6 +9,7 @@ import { autoAddRelName, } from '../TableRelationships/Actions'; import { getRelationshipLine } from '../TableRelationships/Relationships'; +import Button from '../../Layout/Button/Button'; class AutoAddRelations extends Component { trackAllRelations = untrackedData => { @@ -37,15 +38,17 @@ class AutoAddRelations extends Component { className={styles.padd_top_medium} key={'untrackedIndiv' + obj.data.tableName} > - +
{obj.data.tableName} -{' '} {getRelationshipLine( @@ -75,17 +78,15 @@ class AutoAddRelations extends Component { There are {untrackedRelations.length} untracked relations
)} - +
{untrackData}
); diff --git a/console/src/components/Services/Data/Schema/Schema.js b/console/src/components/Services/Data/Schema/Schema.js index b268a566ed8..f7d272c6c69 100644 --- a/console/src/components/Services/Data/Schema/Schema.js +++ b/console/src/components/Services/Data/Schema/Schema.js @@ -9,6 +9,7 @@ import { push } from 'react-router-redux'; import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger'; import { untrackedTip, untrackedRelTip } from './Tooltips'; +import Button from '../../Layout/Button/Button'; import { setTableName, addExistingTableSql, @@ -93,9 +94,11 @@ class Schema extends Component { untrackedHtml.push(
- +
{untrackedTables[i].table_name} @@ -131,9 +134,10 @@ class Schema extends Component { Schema{' '} {migrationMode ? ( - + ) : null}

@@ -159,17 +163,17 @@ class Schema extends Component {