mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 01:12:56 +03:00
reuse buttons across console for uniformity (#1400)
This commit is contained in:
parent
ace701a24a
commit
3cfeb6064a
@ -789,6 +789,9 @@ code
|
|||||||
background-color: #F2B130;
|
background-color: #F2B130;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.gray_button {
|
||||||
|
background: #f2f2f2 !important;
|
||||||
|
}
|
||||||
.docsButton
|
.docsButton
|
||||||
{
|
{
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@ -1109,6 +1112,11 @@ code
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
margin-bottom: 50px;
|
margin-bottom: 50px;
|
||||||
}
|
}
|
||||||
|
.button_mar_right
|
||||||
|
{
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* container height subtracting top header and bottom scroll bar */
|
/* container height subtracting top header and bottom scroll bar */
|
||||||
$mainContainerHeight: calc(100vh - 50px - 25px);
|
$mainContainerHeight: calc(100vh - 50px - 25px);
|
||||||
|
@ -3,6 +3,7 @@ import Common from '../Common/Common';
|
|||||||
|
|
||||||
import { addResolver, RESET } from './addResolverReducer';
|
import { addResolver, RESET } from './addResolverReducer';
|
||||||
import Helmet from 'react-helmet';
|
import Helmet from 'react-helmet';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
import { pageTitle } from '../constants';
|
import { pageTitle } from '../constants';
|
||||||
|
|
||||||
@ -25,14 +26,15 @@ class Add extends React.Component {
|
|||||||
>
|
>
|
||||||
<Common {...this.props} />
|
<Common {...this.props} />
|
||||||
<div className={styles.commonBtn}>
|
<div className={styles.commonBtn}>
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={styles.yellow_button}
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
disabled={isRequesting}
|
disabled={isRequesting}
|
||||||
data-test="add-remote-schema-submit"
|
data-test="add-remote-schema-submit"
|
||||||
>
|
>
|
||||||
{isRequesting ? 'Adding...' : 'Add Remote Schema'}
|
{isRequesting ? 'Adding...' : 'Add Remote Schema'}
|
||||||
</button>
|
</Button>
|
||||||
{/*
|
{/*
|
||||||
<button className={styles.default_button}>Cancel</button>
|
<button className={styles.default_button}>Cancel</button>
|
||||||
*/}
|
*/}
|
||||||
|
@ -13,6 +13,7 @@ import { push } from 'react-router-redux';
|
|||||||
import Helmet from 'react-helmet';
|
import Helmet from 'react-helmet';
|
||||||
import tabInfo from './tabInfo';
|
import tabInfo from './tabInfo';
|
||||||
import CommonTabLayout from '../../Layout/CommonTabLayout/CommonTabLayout';
|
import CommonTabLayout from '../../Layout/CommonTabLayout/CommonTabLayout';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
import { appPrefix, pageTitle } from '../constants';
|
import { appPrefix, pageTitle } from '../constants';
|
||||||
|
|
||||||
@ -97,8 +98,10 @@ class Edit extends React.Component {
|
|||||||
const generateMigrateBtns = () => {
|
const generateMigrateBtns = () => {
|
||||||
return 'isModify' in editState && !editState.isModify ? (
|
return 'isModify' in editState && !editState.isModify ? (
|
||||||
<div className={styles.commonBtn}>
|
<div className={styles.commonBtn}>
|
||||||
<button
|
<Button
|
||||||
className={styles.yellow_button}
|
className={styles.button_mar_right}
|
||||||
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.modifyClick();
|
this.modifyClick();
|
||||||
@ -107,9 +110,10 @@ class Edit extends React.Component {
|
|||||||
disabled={isRequesting}
|
disabled={isRequesting}
|
||||||
>
|
>
|
||||||
Modify
|
Modify
|
||||||
</button>
|
</Button>
|
||||||
<button
|
<Button
|
||||||
className={styles.danger_button + ' btn-danger'}
|
color="red"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.handleDeleteResolver(e);
|
this.handleDeleteResolver(e);
|
||||||
@ -118,7 +122,7 @@ class Edit extends React.Component {
|
|||||||
data-test={'remote-schema-edit-delete-btn'}
|
data-test={'remote-schema-edit-delete-btn'}
|
||||||
>
|
>
|
||||||
{isRequesting ? 'Deleting ...' : 'Delete'}
|
{isRequesting ? 'Deleting ...' : 'Delete'}
|
||||||
</button>
|
</Button>
|
||||||
{this.state.deleteConfirmationError ? (
|
{this.state.deleteConfirmationError ? (
|
||||||
<span
|
<span
|
||||||
className={styles.delete_confirmation_error}
|
className={styles.delete_confirmation_error}
|
||||||
@ -130,16 +134,19 @@ class Edit extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className={styles.commonBtn}>
|
<div className={styles.commonBtn}>
|
||||||
<button
|
<Button
|
||||||
className={styles.yellow_button}
|
className={styles.button_mar_right}
|
||||||
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={isRequesting}
|
disabled={isRequesting}
|
||||||
data-test={'remote-schema-edit-save-btn'}
|
data-test={'remote-schema-edit-save-btn'}
|
||||||
>
|
>
|
||||||
{isRequesting ? 'Saving' : 'Save'}
|
{isRequesting ? 'Saving' : 'Save'}
|
||||||
</button>
|
</Button>
|
||||||
<button
|
<Button
|
||||||
className={styles.default_button}
|
color="white"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.handleCancelModify();
|
this.handleCancelModify();
|
||||||
@ -148,7 +155,7 @@ class Edit extends React.Component {
|
|||||||
disabled={isRequesting}
|
disabled={isRequesting}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -4,6 +4,7 @@ import { push } from 'react-router-redux';
|
|||||||
|
|
||||||
import { appPrefix, pageTitle } from '../constants';
|
import { appPrefix, pageTitle } from '../constants';
|
||||||
import globals from '../../../../Globals';
|
import globals from '../../../../Globals';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
class CustomResolver extends React.Component {
|
class CustomResolver extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
@ -25,16 +26,17 @@ class CustomResolver extends React.Component {
|
|||||||
Remote Schemas
|
Remote Schemas
|
||||||
</h2>
|
</h2>
|
||||||
{migrationMode ? (
|
{migrationMode ? (
|
||||||
<button
|
<Button
|
||||||
data-test="data-create-remote-schemas"
|
data-test="data-create-remote-schemas"
|
||||||
className={styles.yellow_button}
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
dispatch(push(`${globals.urlPrefix}${appPrefix}/manage/add`));
|
dispatch(push(`${globals.urlPrefix}${appPrefix}/manage/add`));
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Add
|
Add
|
||||||
</button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,6 +4,7 @@ import Helmet from 'react-helmet';
|
|||||||
|
|
||||||
import * as tooltip from './Tooltips';
|
import * as tooltip from './Tooltips';
|
||||||
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
import dataTypes from '../Common/DataTypes';
|
import dataTypes from '../Common/DataTypes';
|
||||||
import { showErrorNotification } from '../Notification';
|
import { showErrorNotification } from '../Notification';
|
||||||
@ -472,14 +473,15 @@ class AddTable extends Component {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<hr />
|
<hr />
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={`btn ${styles.yellow_button}`}
|
|
||||||
onClick={this.submitValidation.bind(this)}
|
onClick={this.submitValidation.bind(this)}
|
||||||
data-test="table-create"
|
data-test="table-create"
|
||||||
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
>
|
>
|
||||||
{createBtnText}
|
{createBtnText}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,6 +7,7 @@ import {
|
|||||||
showSuccessNotification,
|
showSuccessNotification,
|
||||||
showErrorNotification,
|
showErrorNotification,
|
||||||
} from '../Notification';
|
} from '../Notification';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
class ClearAccessKey extends Component {
|
class ClearAccessKey extends Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -15,13 +16,14 @@ class ClearAccessKey extends Component {
|
|||||||
this.state.isClearing = false;
|
this.state.isClearing = false;
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
const styles = require('../PageContainer/PageContainer.scss');
|
|
||||||
const metaDataStyles = require('./Metadata.scss');
|
const metaDataStyles = require('./Metadata.scss');
|
||||||
return (
|
return (
|
||||||
<div className={metaDataStyles.display_inline}>
|
<div className={metaDataStyles.display_inline}>
|
||||||
<button
|
<Button
|
||||||
data-test="data-clear-access-key"
|
data-test="data-clear-access-key"
|
||||||
className={styles.default_button + ' ' + metaDataStyles.margin_right}
|
className={metaDataStyles.margin_right}
|
||||||
|
color="white"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.setState({ isClearing: true });
|
this.setState({ isClearing: true });
|
||||||
@ -52,7 +54,7 @@ class ClearAccessKey extends Component {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{this.state.isClearing ? 'Clearing...' : 'Clear access key (logout)'}
|
{this.state.isClearing ? 'Clearing...' : 'Clear access key (logout)'}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Endpoints, { globalCookiePolicy } from '../../../../Endpoints';
|
import Endpoints, { globalCookiePolicy } from '../../../../Endpoints';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
showSuccessNotification,
|
showSuccessNotification,
|
||||||
@ -14,13 +15,14 @@ class ExportMetadata extends Component {
|
|||||||
this.state.isExporting = false;
|
this.state.isExporting = false;
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
const styles = require('../PageContainer/PageContainer.scss');
|
|
||||||
const metaDataStyles = require('./Metadata.scss');
|
const metaDataStyles = require('./Metadata.scss');
|
||||||
return (
|
return (
|
||||||
<div className={metaDataStyles.display_inline}>
|
<div className={metaDataStyles.display_inline}>
|
||||||
<button
|
<Button
|
||||||
data-test="data-export-metadata"
|
data-test="data-export-metadata"
|
||||||
className={styles.default_button + ' ' + metaDataStyles.margin_right}
|
className={metaDataStyles.margin_right}
|
||||||
|
size="sm"
|
||||||
|
color="white"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.setState({ isExporting: true });
|
this.setState({ isExporting: true });
|
||||||
@ -83,7 +85,7 @@ class ExportMetadata extends Component {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{this.state.isExporting ? 'Exporting...' : 'Export metadata'}
|
{this.state.isExporting ? 'Exporting...' : 'Export metadata'}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Endpoints, { globalCookiePolicy } from '../../../../Endpoints';
|
import Endpoints, { globalCookiePolicy } from '../../../../Endpoints';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
showSuccessNotification,
|
showSuccessNotification,
|
||||||
@ -83,13 +84,13 @@ class ImportMetadata extends Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
const styles = require('../PageContainer/PageContainer.scss');
|
|
||||||
const metaDataStyles = require('./Metadata.scss');
|
const metaDataStyles = require('./Metadata.scss');
|
||||||
return (
|
return (
|
||||||
<div className={metaDataStyles.display_inline}>
|
<div className={metaDataStyles.display_inline}>
|
||||||
<button
|
<Button
|
||||||
data-test="data-import-metadata"
|
data-test="data-import-metadata"
|
||||||
className={styles.default_button}
|
size="sm"
|
||||||
|
color="white"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const currThis = this;
|
const currThis = this;
|
||||||
@ -112,7 +113,7 @@ class ImportMetadata extends Component {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{this.state.isImporting ? 'Importing...' : 'Import metadata'}
|
{this.state.isImporting ? 'Importing...' : 'Import metadata'}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Endpoints, { globalCookiePolicy } from '../../../../Endpoints';
|
import Endpoints, { globalCookiePolicy } from '../../../../Endpoints';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
showSuccessNotification,
|
showSuccessNotification,
|
||||||
@ -14,13 +15,13 @@ class ReloadMetadata extends Component {
|
|||||||
this.state.isReloading = false;
|
this.state.isReloading = false;
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
const styles = require('../PageContainer/PageContainer.scss');
|
|
||||||
const metaDataStyles = require('./Metadata.scss');
|
const metaDataStyles = require('./Metadata.scss');
|
||||||
return (
|
return (
|
||||||
<div className={metaDataStyles.display_inline}>
|
<div className={metaDataStyles.display_inline}>
|
||||||
<button
|
<Button
|
||||||
data-test="data-reload-metadata"
|
data-test="data-reload-metadata"
|
||||||
className={this.props.bsClass || styles.default_button}
|
color="white"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.setState({ isReloading: true });
|
this.setState({ isReloading: true });
|
||||||
@ -75,7 +76,7 @@ class ReloadMetadata extends Component {
|
|||||||
{this.state.isReloading
|
{this.state.isReloading
|
||||||
? this.props.btnTextChanging || 'Reloading...'
|
? this.props.btnTextChanging || 'Reloading...'
|
||||||
: this.props.btnText || 'Reload'}
|
: this.props.btnText || 'Reload'}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import React, { Component } from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Endpoints, { globalCookiePolicy } from '../../../../Endpoints';
|
import Endpoints, { globalCookiePolicy } from '../../../../Endpoints';
|
||||||
import { showNotification } from '../../../App/Actions';
|
import { showNotification } from '../../../App/Actions';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
showSuccessNotification,
|
showSuccessNotification,
|
||||||
@ -16,13 +17,13 @@ class ResetMetadata extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const styles = require('../PageContainer/PageContainer.scss');
|
|
||||||
const metaDataStyles = require('./Metadata.scss');
|
const metaDataStyles = require('./Metadata.scss');
|
||||||
return (
|
return (
|
||||||
<div className={metaDataStyles.display_inline}>
|
<div className={metaDataStyles.display_inline}>
|
||||||
<button
|
<Button
|
||||||
data-test="data-reset-metadata"
|
data-test="data-reset-metadata"
|
||||||
className={styles.default_button}
|
color="white"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const a = prompt(
|
const a = prompt(
|
||||||
@ -78,7 +79,7 @@ class ResetMetadata extends Component {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{this.state.isResetting ? 'Resetting...' : 'Reset'}
|
{this.state.isResetting ? 'Resetting...' : 'Reset'}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import React from 'react';
|
|||||||
import AceEditor from 'react-ace';
|
import AceEditor from 'react-ace';
|
||||||
import { showNotification, showTempNotification } from '../../App/Actions';
|
import { showNotification, showTempNotification } from '../../App/Actions';
|
||||||
import { notifExpand, notifMsg } from '../../App/Actions';
|
import { notifExpand, notifMsg } from '../../App/Actions';
|
||||||
|
import Button from '../Layout/Button/Button';
|
||||||
|
|
||||||
const styles = require('./TableCommon/Table.scss');
|
const styles = require('./TableCommon/Table.scss');
|
||||||
|
|
||||||
@ -47,15 +48,17 @@ const showErrorNotification = (title, message, reqBody, error) => {
|
|||||||
let finalJson = error ? error.message : '{}';
|
let finalJson = error ? error.message : '{}';
|
||||||
if (error && 'action' in error) {
|
if (error && 'action' in error) {
|
||||||
refreshBtn = (
|
refreshBtn = (
|
||||||
<button
|
<Button
|
||||||
className={styles.yellow_button + ' ' + styles.add_mar_top_small}
|
className={styles.add_mar_top_small}
|
||||||
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Refresh Console
|
Refresh Console
|
||||||
</button>
|
</Button>
|
||||||
);
|
);
|
||||||
finalJson = error.action;
|
finalJson = error.action;
|
||||||
} else if (error && 'internal' in error) {
|
} else if (error && 'internal' in error) {
|
||||||
|
@ -4,6 +4,7 @@ import React from 'react';
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { Link } from 'react-router';
|
import { Link } from 'react-router';
|
||||||
import globals from '../../../../Globals';
|
import globals from '../../../../Globals';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
import { LISTING_SCHEMA } from '../DataActions';
|
import { LISTING_SCHEMA } from '../DataActions';
|
||||||
|
|
||||||
@ -145,12 +146,14 @@ const PageContainer = ({
|
|||||||
className={styles.padd_remove_full}
|
className={styles.padd_remove_full}
|
||||||
to={'/data/schema/' + schemaName + '/table/add'}
|
to={'/data/schema/' + schemaName + '/table/add'}
|
||||||
>
|
>
|
||||||
<button
|
<Button
|
||||||
className={styles.add_mar_right + ' btn btn-xs btn-default'}
|
className={styles.add_mar_right}
|
||||||
|
size="xs"
|
||||||
|
color="white"
|
||||||
data-test="sidebar-add-table"
|
data-test="sidebar-add-table"
|
||||||
>
|
>
|
||||||
Add Table
|
Add Table
|
||||||
</button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
@ -4,7 +4,8 @@ import Helmet from 'react-helmet';
|
|||||||
import AceEditor from 'react-ace';
|
import AceEditor from 'react-ace';
|
||||||
import 'brace/mode/sql';
|
import 'brace/mode/sql';
|
||||||
import Modal from 'react-bootstrap/lib/Modal';
|
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 OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
||||||
import Tooltip from 'react-bootstrap/lib/Tooltip';
|
import Tooltip from 'react-bootstrap/lib/Tooltip';
|
||||||
@ -341,19 +342,20 @@ const RawSQL = ({
|
|||||||
) : (
|
) : (
|
||||||
<hr />
|
<hr />
|
||||||
)}
|
)}
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={styles.yellow_button}
|
|
||||||
onClick={submitSQL}
|
onClick={submitSQL}
|
||||||
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
data-test="run-sql"
|
data-test="run-sql"
|
||||||
>
|
>
|
||||||
Run!
|
Run!
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className="hidden col-xs-4">{alert}</div>
|
<div className="hidden col-xs-4">{alert}</div>
|
||||||
</div>
|
</div>
|
||||||
<Modal show={isModalOpen} onHide={onModalClose.bind(this)}>
|
<Modal show={isModalOpen} onHide={onModalClose.bind(this)}>
|
||||||
<Modal.Header closeButton>
|
<Modal.Header closeModalButton>
|
||||||
<Modal.Title>Run SQL</Modal.Title>
|
<Modal.Title>Run SQL</Modal.Title>
|
||||||
</Modal.Header>
|
</Modal.Header>
|
||||||
<Modal.Body>
|
<Modal.Body>
|
||||||
@ -367,14 +369,14 @@ const RawSQL = ({
|
|||||||
</div>
|
</div>
|
||||||
</Modal.Body>
|
</Modal.Body>
|
||||||
<Modal.Footer>
|
<Modal.Footer>
|
||||||
<Button onClick={onModalClose}>Cancel</Button>
|
<ModalButton onClick={onModalClose}>Cancel</ModalButton>
|
||||||
<Button
|
<ModalButton
|
||||||
onClick={onConfirmNoMigration}
|
onClick={onConfirmNoMigration}
|
||||||
bsStyle="primary"
|
bsStyle="primary"
|
||||||
data-test="not-migration-confirm"
|
data-test="not-migration-confirm"
|
||||||
>
|
>
|
||||||
Yes, i confirm
|
Yes, i confirm
|
||||||
</Button>
|
</ModalButton>
|
||||||
</Modal.Footer>
|
</Modal.Footer>
|
||||||
</Modal>
|
</Modal>
|
||||||
<div className={`${styles.padd_left_remove} container-fluid`}>
|
<div className={`${styles.padd_left_remove} container-fluid`}>
|
||||||
|
@ -9,6 +9,7 @@ import {
|
|||||||
autoAddRelName,
|
autoAddRelName,
|
||||||
} from '../TableRelationships/Actions';
|
} from '../TableRelationships/Actions';
|
||||||
import { getRelationshipLine } from '../TableRelationships/Relationships';
|
import { getRelationshipLine } from '../TableRelationships/Relationships';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
class AutoAddRelations extends Component {
|
class AutoAddRelations extends Component {
|
||||||
trackAllRelations = untrackedData => {
|
trackAllRelations = untrackedData => {
|
||||||
@ -37,15 +38,17 @@ class AutoAddRelations extends Component {
|
|||||||
className={styles.padd_top_medium}
|
className={styles.padd_top_medium}
|
||||||
key={'untrackedIndiv' + obj.data.tableName}
|
key={'untrackedIndiv' + obj.data.tableName}
|
||||||
>
|
>
|
||||||
<button
|
<Button
|
||||||
className={`${styles.display_inline} btn btn-xs btn-default`}
|
className={`${styles.display_inline}`}
|
||||||
|
size="xs"
|
||||||
|
color="white"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
handleAutoAddIndivRel(obj);
|
handleAutoAddIndivRel(obj);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Add
|
Add
|
||||||
</button>
|
</Button>
|
||||||
<div className={styles.display_inline + ' ' + styles.add_pad_left}>
|
<div className={styles.display_inline + ' ' + styles.add_pad_left}>
|
||||||
<b>{obj.data.tableName}</b> -{' '}
|
<b>{obj.data.tableName}</b> -{' '}
|
||||||
{getRelationshipLine(
|
{getRelationshipLine(
|
||||||
@ -75,17 +78,15 @@ class AutoAddRelations extends Component {
|
|||||||
There are {untrackedRelations.length} untracked relations
|
There are {untrackedRelations.length} untracked relations
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<button
|
<Button
|
||||||
onClick={this.trackAllRelations.bind(this, untrackedRelations)}
|
onClick={this.trackAllRelations.bind(this, untrackedRelations)}
|
||||||
className={
|
className={`${styles.display_inline} ${styles.add_mar_left}`}
|
||||||
styles.display_inline +
|
color="white"
|
||||||
' btn btn-xs btn-default ' +
|
size="xs"
|
||||||
styles.add_mar_left
|
|
||||||
}
|
|
||||||
data-test="track-all-relationships"
|
data-test="track-all-relationships"
|
||||||
>
|
>
|
||||||
Track All Relations
|
Track All Relations
|
||||||
</button>
|
</Button>
|
||||||
<div className={styles.padd_top_small}>{untrackData}</div>
|
<div className={styles.padd_top_small}>{untrackData}</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -9,6 +9,7 @@ import { push } from 'react-router-redux';
|
|||||||
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
||||||
|
|
||||||
import { untrackedTip, untrackedRelTip } from './Tooltips';
|
import { untrackedTip, untrackedRelTip } from './Tooltips';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
import {
|
import {
|
||||||
setTableName,
|
setTableName,
|
||||||
addExistingTableSql,
|
addExistingTableSql,
|
||||||
@ -93,9 +94,11 @@ class Schema extends Component {
|
|||||||
untrackedHtml.push(
|
untrackedHtml.push(
|
||||||
<div className={styles.padd_bottom} key={`${i}untracked`}>
|
<div className={styles.padd_bottom} key={`${i}untracked`}>
|
||||||
<div className={`${styles.display_inline} ${styles.padd_right}`}>
|
<div className={`${styles.display_inline} ${styles.padd_right}`}>
|
||||||
<button
|
<Button
|
||||||
data-test={`add-track-table-${untrackedTables[i].table_name}`}
|
data-test={`add-track-table-${untrackedTables[i].table_name}`}
|
||||||
className={`${styles.display_inline} btn btn-xs btn-default`}
|
className={`${styles.display_inline}`}
|
||||||
|
color="white"
|
||||||
|
size="xs"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
dispatch(setTableName(untrackedTables[i].table_name));
|
dispatch(setTableName(untrackedTables[i].table_name));
|
||||||
@ -103,7 +106,7 @@ class Schema extends Component {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Add
|
Add
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${styles.padd_right} ${styles.inline_block}`}>
|
<div className={`${styles.padd_right} ${styles.inline_block}`}>
|
||||||
{untrackedTables[i].table_name}
|
{untrackedTables[i].table_name}
|
||||||
@ -131,9 +134,10 @@ class Schema extends Component {
|
|||||||
Schema{' '}
|
Schema{' '}
|
||||||
</h2>
|
</h2>
|
||||||
{migrationMode ? (
|
{migrationMode ? (
|
||||||
<button
|
<Button
|
||||||
data-test="data-create-table"
|
data-test="data-create-table"
|
||||||
className={styles.yellow_button}
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
dispatch(
|
dispatch(
|
||||||
@ -142,7 +146,7 @@ class Schema extends Component {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Create Table
|
Create Table
|
||||||
</button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
@ -159,17 +163,17 @@ class Schema extends Component {
|
|||||||
<i className="fa fa-info-circle" aria-hidden="true" />
|
<i className="fa fa-info-circle" aria-hidden="true" />
|
||||||
</OverlayTrigger>
|
</OverlayTrigger>
|
||||||
{untrackedTables.length > 0 ? (
|
{untrackedTables.length > 0 ? (
|
||||||
<button
|
<Button
|
||||||
className={`${styles.display_inline} ${
|
className={`${styles.display_inline} ${styles.addAllBtn}`}
|
||||||
styles.addAllBtn
|
color="white"
|
||||||
} btn btn-xs btn-default`}
|
size="xs"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
dispatch(addAllUntrackedTablesSql(untrackedTables));
|
dispatch(addAllUntrackedTablesSql(untrackedTables));
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Add all
|
Add all
|
||||||
</button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
<div className={`${styles.padd_left_remove} col-xs-12`}>
|
<div className={`${styles.padd_left_remove} col-xs-12`}>
|
||||||
|
@ -4,6 +4,7 @@ import TableHeader from '../TableCommon/TableHeader';
|
|||||||
import { editItem, E_ONGOING_REQ } from './EditActions';
|
import { editItem, E_ONGOING_REQ } from './EditActions';
|
||||||
import globals from '../../../../Globals';
|
import globals from '../../../../Globals';
|
||||||
import { modalClose } from './EditActions';
|
import { modalClose } from './EditActions';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
// import RichTextEditor from 'react-rte';
|
// import RichTextEditor from 'react-rte';
|
||||||
import { replace } from 'react-router-redux';
|
import { replace } from 'react-router-redux';
|
||||||
@ -298,9 +299,10 @@ class EditItem extends Component {
|
|||||||
<div className="col-xs-9">
|
<div className="col-xs-9">
|
||||||
<form className="form-horizontal">
|
<form className="form-horizontal">
|
||||||
{elements}
|
{elements}
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={styles.yellow_button}
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
dispatch({ type: E_ONGOING_REQ });
|
dispatch({ type: E_ONGOING_REQ });
|
||||||
@ -321,7 +323,7 @@ class EditItem extends Component {
|
|||||||
data-test="save-button"
|
data-test="save-button"
|
||||||
>
|
>
|
||||||
{buttonText}
|
{buttonText}
|
||||||
</button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-xs-3">{alert}</div>
|
<div className="col-xs-3">{alert}</div>
|
||||||
|
@ -22,6 +22,7 @@ import {
|
|||||||
removeOrder,
|
removeOrder,
|
||||||
} from './FilterActions.js';
|
} from './FilterActions.js';
|
||||||
import { setDefaultQuery, runQuery } from './FilterActions';
|
import { setDefaultQuery, runQuery } from './FilterActions';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
const renderCols = (colName, tableSchema, onChange, usage, key) => {
|
const renderCols = (colName, tableSchema, onChange, usage, key) => {
|
||||||
const columns = tableSchema.columns.map(c => c.column_name);
|
const columns = tableSchema.columns.map(c => c.column_name);
|
||||||
@ -198,13 +199,14 @@ class FilterQuery extends Component {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${styles.padd_right} ${styles.clear_fix}`}>
|
<div className={`${styles.padd_right} ${styles.clear_fix}`}>
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={`btn ${styles.yellow_button}`}
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
data-test="run-query"
|
data-test="run-query"
|
||||||
>
|
>
|
||||||
Run query
|
Run query
|
||||||
</button>
|
</Button>
|
||||||
{/* <div className={styles.count + ' alert alert-info'}><i>Total <b>{tableName}</b> rows in the database for current query: {count} </i></div> */}
|
{/* <div className={styles.count + ' alert alert-info'}><i>Total <b>{tableName}</b> rows in the database for current query: {count} </i></div> */}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -25,6 +25,7 @@ import { I_SET_CLONE } from '../TableInsertItem/InsertActions';
|
|||||||
import _push from '../push';
|
import _push from '../push';
|
||||||
import { ordinalColSort, findTableFromRel } from '../utils';
|
import { ordinalColSort, findTableFromRel } from '../utils';
|
||||||
import Spinner from '../../../Common/Spinner/Spinner';
|
import Spinner from '../../../Common/Spinner/Spinner';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
import './ReactTableFix.css';
|
import './ReactTableFix.css';
|
||||||
|
|
||||||
const ViewRows = ({
|
const ViewRows = ({
|
||||||
@ -184,8 +185,10 @@ const ViewRows = ({
|
|||||||
}
|
}
|
||||||
if (!isSingleRow && !isView && hasPrimaryKeys) {
|
if (!isSingleRow && !isView && hasPrimaryKeys) {
|
||||||
editButton = (
|
editButton = (
|
||||||
<button
|
<Button
|
||||||
className={`${styles.add_mar_right_small} btn btn-xs btn-default`}
|
className={styles.add_mar_right_small}
|
||||||
|
color="white"
|
||||||
|
size="xs"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
dispatch({ type: E_SET_EDITITEM, oldItem: row, pkClause });
|
dispatch({ type: E_SET_EDITITEM, oldItem: row, pkClause });
|
||||||
dispatch(
|
dispatch(
|
||||||
@ -195,12 +198,14 @@ const ViewRows = ({
|
|||||||
data-test={`row-edit-button-${rowIndex}`}
|
data-test={`row-edit-button-${rowIndex}`}
|
||||||
>
|
>
|
||||||
Edit
|
Edit
|
||||||
</button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
|
||||||
cloneButton = (
|
cloneButton = (
|
||||||
<button
|
<Button
|
||||||
className={`${styles.add_mar_right_small} btn btn-xs btn-default`}
|
className={styles.add_mar_right_small}
|
||||||
|
size="xs"
|
||||||
|
color="white"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
dispatch({ type: I_SET_CLONE, clone: row });
|
dispatch({ type: I_SET_CLONE, clone: row });
|
||||||
dispatch(
|
dispatch(
|
||||||
@ -210,19 +215,21 @@ const ViewRows = ({
|
|||||||
data-test={`row-clone-button-${rowIndex}`}
|
data-test={`row-clone-button-${rowIndex}`}
|
||||||
>
|
>
|
||||||
Clone
|
Clone
|
||||||
</button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
|
||||||
deleteButton = (
|
deleteButton = (
|
||||||
<button
|
<Button
|
||||||
className={`${styles.add_mar_right_small} btn btn-xs btn-default`}
|
className={styles.add_mar_right_small}
|
||||||
|
size="xs"
|
||||||
|
color="white"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
dispatch(deleteItem(pkClause));
|
dispatch(deleteItem(pkClause));
|
||||||
}}
|
}}
|
||||||
data-test={`row-delete-button-${rowIndex}`}
|
data-test={`row-delete-button-${rowIndex}`}
|
||||||
>
|
>
|
||||||
Delete
|
Delete
|
||||||
</button>
|
</Button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const buttonsDiv = (
|
const buttonsDiv = (
|
||||||
|
@ -142,19 +142,6 @@ const TableHeader = ({
|
|||||||
Permissions
|
Permissions
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li role="presentation" className={'hide'}>
|
|
||||||
<Link
|
|
||||||
to={
|
|
||||||
'/data/schema/' +
|
|
||||||
currentSchema +
|
|
||||||
'/tables/' +
|
|
||||||
tableName +
|
|
||||||
'/permissions'
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<button className="btn btn-xs btn-warning">Try out APIs</button>
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div className="clearfix" />
|
<div className="clearfix" />
|
||||||
|
@ -4,6 +4,7 @@ import TableHeader from '../TableCommon/TableHeader';
|
|||||||
import { insertItem, I_RESET } from './InsertActions';
|
import { insertItem, I_RESET } from './InsertActions';
|
||||||
import { ordinalColSort } from '../utils';
|
import { ordinalColSort } from '../utils';
|
||||||
import { setTable } from '../DataActions';
|
import { setTable } from '../DataActions';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
class InsertItem extends Component {
|
class InsertItem extends Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -285,9 +286,10 @@ class InsertItem extends Component {
|
|||||||
<div className="col-xs-9">
|
<div className="col-xs-9">
|
||||||
<form id="insertForm" className="form-horizontal">
|
<form id="insertForm" className="form-horizontal">
|
||||||
{elements}
|
{elements}
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={'btn ' + styles.yellow_button}
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const inputValues = {};
|
const inputValues = {};
|
||||||
@ -309,9 +311,10 @@ class InsertItem extends Component {
|
|||||||
data-test="insert-save-button"
|
data-test="insert-save-button"
|
||||||
>
|
>
|
||||||
{this.state.insertedRows > 0 ? 'Insert Again' : 'Save'}
|
{this.state.insertedRows > 0 ? 'Insert Again' : 'Save'}
|
||||||
</button>
|
</Button>
|
||||||
<button
|
<Button
|
||||||
className={'btn ' + styles.default_button}
|
color="white"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const form = document.getElementById('insertForm');
|
const form = document.getElementById('insertForm');
|
||||||
@ -334,7 +337,7 @@ class InsertItem extends Component {
|
|||||||
data-test="clear-button"
|
data-test="clear-button"
|
||||||
>
|
>
|
||||||
Clear
|
Clear
|
||||||
</button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-xs-3">{alert}</div>
|
<div className="col-xs-3">{alert}</div>
|
||||||
|
@ -47,6 +47,7 @@ import {
|
|||||||
TIMESTAMP,
|
TIMESTAMP,
|
||||||
TIME,
|
TIME,
|
||||||
} from '../../../../constants';
|
} from '../../../../constants';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
const appPrefix = '/data';
|
const appPrefix = '/data';
|
||||||
|
|
||||||
@ -132,23 +133,25 @@ const ColumnEditor = ({
|
|||||||
<Link
|
<Link
|
||||||
to={`${appPrefix}/schema/${currentSchema}/tables/${tableName}/relationships`}
|
to={`${appPrefix}/schema/${currentSchema}/tables/${tableName}/relationships`}
|
||||||
>
|
>
|
||||||
<button
|
<Button
|
||||||
className={`${styles.default_button} btn`}
|
color="white"
|
||||||
|
size="sm"
|
||||||
type="button"
|
type="button"
|
||||||
data-test="add-rel-mod"
|
data-test="add-rel-mod"
|
||||||
>
|
>
|
||||||
+Add relationship
|
+Add relationship
|
||||||
</button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<button
|
<Button
|
||||||
className="btn btn-danger btn-sm"
|
color="red"
|
||||||
|
size="sm"
|
||||||
onClick={onDeleteFK}
|
onClick={onDeleteFK}
|
||||||
data-test="remove-constraint-button"
|
data-test="remove-constraint-button"
|
||||||
>
|
>
|
||||||
{' '}
|
{' '}
|
||||||
Remove Constraint{' '}
|
Remove Constraint{' '}
|
||||||
</button>{' '}
|
</Button>{' '}
|
||||||
|
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
@ -383,17 +386,20 @@ const ColumnEditor = ({
|
|||||||
</div>
|
</div>
|
||||||
{checkExistingForeignKey()}
|
{checkExistingForeignKey()}
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={`${styles.yellow_button} btn`}
|
color="yellow"
|
||||||
|
className={styles.button_mar_right}
|
||||||
|
size="sm"
|
||||||
data-test="save-button"
|
data-test="save-button"
|
||||||
>
|
>
|
||||||
Save
|
Save
|
||||||
</button>
|
</Button>
|
||||||
{!isPrimaryKey ? (
|
{!isPrimaryKey ? (
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={`${styles.yellow_button1} btn btn-danger btn-sm`}
|
color="red"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
onDelete();
|
onDelete();
|
||||||
@ -401,7 +407,7 @@ const ColumnEditor = ({
|
|||||||
data-test="remove-button"
|
data-test="remove-button"
|
||||||
>
|
>
|
||||||
Remove
|
Remove
|
||||||
</button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -564,8 +570,10 @@ class ModifyTable extends Component {
|
|||||||
<div className="container-fluid">
|
<div className="container-fluid">
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<h5 className={styles.padd_bottom}>
|
<h5 className={styles.padd_bottom}>
|
||||||
<button
|
<Button
|
||||||
className={`${styles.add_mar_small} btn btn-xs btn-default`}
|
className={styles.add_mar_small}
|
||||||
|
size="xs"
|
||||||
|
color="white"
|
||||||
data-test={`edit-${colName}`}
|
data-test={`edit-${colName}`}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (activeEdit.column === colName) {
|
if (activeEdit.column === colName) {
|
||||||
@ -585,7 +593,7 @@ class ModifyTable extends Component {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{btnText}
|
{btnText}
|
||||||
</button>
|
</Button>
|
||||||
<b>{colName}</b> {keyProperties()}
|
<b>{colName}</b> {keyProperties()}
|
||||||
|
|
||||||
</h5>
|
</h5>
|
||||||
@ -602,10 +610,13 @@ class ModifyTable extends Component {
|
|||||||
let colUniqueInput;
|
let colUniqueInput;
|
||||||
let colDefaultInput;
|
let colDefaultInput;
|
||||||
|
|
||||||
|
// TODO
|
||||||
const untrackBtn = (
|
const untrackBtn = (
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={`${styles.add_mar_right} btn btn-sm btn-default`}
|
className={styles.add_mar_right}
|
||||||
|
color="white"
|
||||||
|
size="sm"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const isOk = confirm('Are you sure to untrack?');
|
const isOk = confirm('Are you sure to untrack?');
|
||||||
if (isOk) {
|
if (isOk) {
|
||||||
@ -615,7 +626,7 @@ class ModifyTable extends Component {
|
|||||||
data-test="untrack-table"
|
data-test="untrack-table"
|
||||||
>
|
>
|
||||||
Untrack Table
|
Untrack Table
|
||||||
</button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
|
||||||
const editCommentClicked = () => {
|
const editCommentClicked = () => {
|
||||||
@ -811,20 +822,22 @@ class ModifyTable extends Component {
|
|||||||
ref={n => (colDefaultInput = n)}
|
ref={n => (colDefaultInput = n)}
|
||||||
data-test="default-value"
|
data-test="default-value"
|
||||||
/>
|
/>
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-sm btn-warning"
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
data-test="add-column-button"
|
data-test="add-column-button"
|
||||||
>
|
>
|
||||||
+ Add column
|
+ Add column
|
||||||
</button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
{untrackBtn}
|
{untrackBtn}
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-sm btn-danger"
|
color="red"
|
||||||
|
size="sm"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const isOk = confirm('Are you sure?');
|
const isOk = confirm('Are you sure?');
|
||||||
if (isOk) {
|
if (isOk) {
|
||||||
@ -834,7 +847,7 @@ class ModifyTable extends Component {
|
|||||||
data-test="delete-table"
|
data-test="delete-table"
|
||||||
>
|
>
|
||||||
Delete table
|
Delete table
|
||||||
</button>
|
</Button>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,6 +15,7 @@ import {
|
|||||||
} from './ModifyActions';
|
} from './ModifyActions';
|
||||||
import { ordinalColSort } from '../utils';
|
import { ordinalColSort } from '../utils';
|
||||||
import { setTable, fetchTableComment } from '../DataActions';
|
import { setTable, fetchTableComment } from '../DataActions';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
class ModifyView extends Component {
|
class ModifyView extends Component {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@ -83,9 +84,9 @@ class ModifyView extends Component {
|
|||||||
<div className="container-fluid">
|
<div className="container-fluid">
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<h5 className={styles.padd_bottom}>
|
<h5 className={styles.padd_bottom}>
|
||||||
<button disabled="disabled" className="btn btn-xs btn-warning">
|
<Button disabled="disabled" size="xs" color="yellow">
|
||||||
{btnText}
|
{btnText}
|
||||||
</button>{' '}
|
</Button>{' '}
|
||||||
{c.column_name}
|
{c.column_name}
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
@ -95,9 +96,11 @@ class ModifyView extends Component {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const untrackBtn = (
|
const untrackBtn = (
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={styles.add_mar_right + ' btn btn-sm btn-default'}
|
className={styles.add_mar_right}
|
||||||
|
color="white"
|
||||||
|
size="sm"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const isOk = confirm('Are you sure to untrack?');
|
const isOk = confirm('Are you sure to untrack?');
|
||||||
if (isOk) {
|
if (isOk) {
|
||||||
@ -107,7 +110,7 @@ class ModifyView extends Component {
|
|||||||
data-test="untrack-view"
|
data-test="untrack-view"
|
||||||
>
|
>
|
||||||
Untrack View
|
Untrack View
|
||||||
</button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
|
||||||
const editCommentClicked = () => {
|
const editCommentClicked = () => {
|
||||||
@ -210,25 +213,23 @@ class ModifyView extends Component {
|
|||||||
readOnly
|
readOnly
|
||||||
/>
|
/>
|
||||||
<hr />
|
<hr />
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={
|
color="yellow"
|
||||||
'btn btn-sm ' +
|
size="sm"
|
||||||
styles.yellow_button +
|
className={styles.add_mar_right}
|
||||||
' ' +
|
|
||||||
styles.add_mar_right
|
|
||||||
}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
this.modifyViewDefinition(tableName);
|
this.modifyViewDefinition(tableName);
|
||||||
}}
|
}}
|
||||||
data-test="modify-view"
|
data-test="modify-view"
|
||||||
>
|
>
|
||||||
Modify
|
Modify
|
||||||
</button>
|
</Button>
|
||||||
{untrackBtn}
|
{untrackBtn}
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={'btn btn-sm btn-danger'}
|
color="red"
|
||||||
|
size="sm"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const isOk = confirm('Are you sure');
|
const isOk = confirm('Are you sure');
|
||||||
if (isOk) {
|
if (isOk) {
|
||||||
@ -238,7 +239,7 @@ class ModifyView extends Component {
|
|||||||
data-test="delete-view"
|
data-test="delete-view"
|
||||||
>
|
>
|
||||||
Delete view
|
Delete view
|
||||||
</button>
|
</Button>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
|
@ -44,6 +44,7 @@ import { setTable, fetchViewInfoFromInformationSchema } from '../DataActions';
|
|||||||
import { getIngForm, escapeRegExp } from '../utils';
|
import { getIngForm, escapeRegExp } from '../utils';
|
||||||
import { legacyOperatorsMap } from './PermissionBuilder/utils';
|
import { legacyOperatorsMap } from './PermissionBuilder/utils';
|
||||||
import semverCheck from '../../../../helpers/semver';
|
import semverCheck from '../../../../helpers/semver';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
import EnhancedInput from '../../../Common/InputChecker/InputChecker';
|
import EnhancedInput from '../../../Common/InputChecker/InputChecker';
|
||||||
@ -1358,15 +1359,17 @@ class Permissions extends Component {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getButton = (value, customClasses, onClickFn, disabled) => (
|
const getButton = (value, color, onClickFn, disabled) => (
|
||||||
<button
|
<Button
|
||||||
className={`${styles.editActionButton} button btn ${customClasses}`}
|
className={styles.editActionButton}
|
||||||
|
color={color}
|
||||||
|
size="sm"
|
||||||
onClick={onClickFn}
|
onClick={onClickFn}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
data-test={`${value.split(' ').join('-')}-button`}
|
data-test={`${value.split(' ').join('-')}-button`}
|
||||||
>
|
>
|
||||||
{value}
|
{value}
|
||||||
</button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
|
||||||
const getButtonsSection = (tableSchema, permsState) => {
|
const getButtonsSection = (tableSchema, permsState) => {
|
||||||
@ -1400,19 +1403,19 @@ class Permissions extends Component {
|
|||||||
|
|
||||||
const saveButton = getButton(
|
const saveButton = getButton(
|
||||||
'Save permissions',
|
'Save permissions',
|
||||||
'btn-success',
|
'yellow',
|
||||||
dispatchSavePermissions,
|
dispatchSavePermissions,
|
||||||
disableSave
|
disableSave
|
||||||
);
|
);
|
||||||
|
|
||||||
const removeAccessButton = getButton(
|
const removeAccessButton = getButton(
|
||||||
'Remove',
|
'Remove',
|
||||||
'btn-danger',
|
'red',
|
||||||
dispatchRemoveAccess,
|
dispatchRemoveAccess,
|
||||||
disableRemoveAccess
|
disableRemoveAccess
|
||||||
);
|
);
|
||||||
|
|
||||||
const closeButton = getButton('Close', 'btn-default', dispatchCloseEdit);
|
const closeButton = getButton('Close', 'white', dispatchCloseEdit);
|
||||||
const currentPermissions = tableSchema.permissions;
|
const currentPermissions = tableSchema.permissions;
|
||||||
const applySameSelected = e => {
|
const applySameSelected = e => {
|
||||||
const isChecked = e.target.checked;
|
const isChecked = e.target.checked;
|
||||||
@ -1463,19 +1466,23 @@ class Permissions extends Component {
|
|||||||
<div>Apply same {permsState.query} permissions to other roles</div>
|
<div>Apply same {permsState.query} permissions to other roles</div>
|
||||||
<div className={styles.add_mar_top_small}>{roleListHtml}</div>
|
<div className={styles.add_mar_top_small}>{roleListHtml}</div>
|
||||||
{permsState.applySamePermissions.length ? (
|
{permsState.applySamePermissions.length ? (
|
||||||
<button
|
<Button
|
||||||
onClick={applySameBulk}
|
onClick={applySameBulk}
|
||||||
className={'btn btn-default ' + styles.bulkApplyBtn}
|
className={styles.bulkApplyBtn}
|
||||||
|
color="white"
|
||||||
|
size="sm"
|
||||||
>
|
>
|
||||||
Apply
|
Apply
|
||||||
</button>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<button
|
<Button
|
||||||
className={'btn btn-default ' + styles.bulkApplyBtn}
|
color="white"
|
||||||
|
className={styles.bulkApplyBtn}
|
||||||
|
size="sm"
|
||||||
disabled
|
disabled
|
||||||
>
|
>
|
||||||
Apply
|
Apply
|
||||||
</button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@ -1552,12 +1559,9 @@ class Permissions extends Component {
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.padd_bottom}>
|
<div className={styles.padd_bottom}>
|
||||||
<button
|
<Button onClick={bulkDeleteClicked} color="red" size="sm">
|
||||||
onClick={bulkDeleteClicked}
|
|
||||||
className={'btn btn-sm btn-default'}
|
|
||||||
>
|
|
||||||
Delete
|
Delete
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -16,6 +16,7 @@ import {
|
|||||||
UPDATE_REMOTE_SCHEMA_MANUAL_REL,
|
UPDATE_REMOTE_SCHEMA_MANUAL_REL,
|
||||||
RESET_MANUAL_REL_TABLE_LIST,
|
RESET_MANUAL_REL_TABLE_LIST,
|
||||||
} from '../DataActions';
|
} from '../DataActions';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
class AddManualRelationship extends Component {
|
class AddManualRelationship extends Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -198,21 +199,24 @@ class AddManualRelationship extends Component {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<Button
|
||||||
className={styles.yellow_button}
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
onClick={this.onAddRelClicked}
|
onClick={this.onAddRelClicked}
|
||||||
data-test={this.props.dataTestVal}
|
data-test={this.props.dataTestVal}
|
||||||
>
|
>
|
||||||
Add
|
Add
|
||||||
</button>
|
</Button>
|
||||||
{this.props.showClose ? (
|
{this.props.showClose ? (
|
||||||
<button
|
<Button
|
||||||
className={styles.add_mar_left + ' btn btn-default btn-sm'}
|
className={styles.add_mar_left}
|
||||||
|
color="white"
|
||||||
|
size="sm"
|
||||||
onClick={this.onCloseClicked}
|
onClick={this.onCloseClicked}
|
||||||
data-test="table-close-manual-relationship"
|
data-test="table-close-manual-relationship"
|
||||||
>
|
>
|
||||||
Close
|
Close
|
||||||
</button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -18,6 +18,7 @@ import gqlPattern, { gqlRelErrorNotif } from '../Common/GraphQLValidation';
|
|||||||
|
|
||||||
import AddManualRelationship from './AddManualRelationship';
|
import AddManualRelationship from './AddManualRelationship';
|
||||||
import suggestedRelationshipsRaw from './autoRelations';
|
import suggestedRelationshipsRaw from './autoRelations';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
/* Gets the complete list of relationships and converts it to a list of object, which looks like so :
|
/* Gets the complete list of relationships and converts it to a list of object, which looks like so :
|
||||||
{
|
{
|
||||||
@ -81,13 +82,14 @@ const relationshipView = (
|
|||||||
return (
|
return (
|
||||||
<td>
|
<td>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<Button
|
||||||
className="btn btn-sm btn-danger"
|
color="red"
|
||||||
|
size="sm"
|
||||||
onClick={onDelete}
|
onClick={onDelete}
|
||||||
data-test={`remove-button-${relName}`}
|
data-test={`remove-button-${relName}`}
|
||||||
>
|
>
|
||||||
Remove
|
Remove
|
||||||
</button>
|
</Button>
|
||||||
|
|
||||||
<b>{relName}</b>
|
<b>{relName}</b>
|
||||||
<div className={tableStyles.relationshipTopPadding}>
|
<div className={tableStyles.relationshipTopPadding}>
|
||||||
@ -140,13 +142,13 @@ const addRelationshipCellView = (
|
|||||||
}
|
}
|
||||||
dispatch(addRelNewFromStateMigrate());
|
dispatch(addRelNewFromStateMigrate());
|
||||||
};
|
};
|
||||||
const styles = require('../TableModify/Modify.scss');
|
|
||||||
return (
|
return (
|
||||||
<td>
|
<td>
|
||||||
<div>
|
<div>
|
||||||
{selectedRelationship === rel ? null : (
|
{selectedRelationship === rel ? null : (
|
||||||
<button
|
<Button
|
||||||
className={`${styles.exploreButton} btn btn-xs`}
|
size="xs"
|
||||||
|
color="yellow"
|
||||||
onClick={onAdd}
|
onClick={onAdd}
|
||||||
data-test={
|
data-test={
|
||||||
relMetaData[0] === 'object'
|
relMetaData[0] === 'object'
|
||||||
@ -155,7 +157,7 @@ const addRelationshipCellView = (
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
Add
|
Add
|
||||||
</button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{getRelationshipLine(rel.isObjRel, rel.lcol, rel.rcol, rel.rTable)}{' '}
|
{getRelationshipLine(rel.isObjRel, rel.lcol, rel.rcol, rel.rTable)}{' '}
|
||||||
|
|
||||||
@ -172,9 +174,10 @@ const addRelationshipCellView = (
|
|||||||
data-test="suggested-rel-name"
|
data-test="suggested-rel-name"
|
||||||
/>{' '}
|
/>{' '}
|
||||||
|
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={`${styles.exploreButton} btn btn-sm`}
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
data-test={
|
data-test={
|
||||||
relMetaData[0] === 'object'
|
relMetaData[0] === 'object'
|
||||||
? `obj-rel-save-${relMetaData[1]}`
|
? `obj-rel-save-${relMetaData[1]}`
|
||||||
@ -182,7 +185,7 @@ const addRelationshipCellView = (
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
Save
|
Save
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
) : null}
|
) : null}
|
||||||
@ -343,8 +346,10 @@ const AddRelationship = ({
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<Button
|
||||||
className="btn btn-sm btn-default hide"
|
className="hide"
|
||||||
|
color="white"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
dispatch(resetRelationshipForm());
|
dispatch(resetRelationshipForm());
|
||||||
@ -352,7 +357,7 @@ const AddRelationship = ({
|
|||||||
>
|
>
|
||||||
{' '}
|
{' '}
|
||||||
Cancel{' '}
|
Cancel{' '}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -488,15 +493,16 @@ class Relationships extends Component {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-sm btn-default"
|
color="white"
|
||||||
|
size="sm"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
dispatch(addNewRelClicked());
|
dispatch(addNewRelClicked());
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
+ Add relationship
|
+ Add relationship
|
||||||
</button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
@ -523,16 +529,17 @@ class Relationships extends Component {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-sm btn-default"
|
color="white"
|
||||||
|
size="sm"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
dispatch(relManualAddClicked());
|
dispatch(relManualAddClicked());
|
||||||
}}
|
}}
|
||||||
data-test="add-manual-relationship"
|
data-test="add-manual-relationship"
|
||||||
>
|
>
|
||||||
+ Add a relationship manually
|
+ Add a relationship manually
|
||||||
</button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,6 +7,7 @@ import { findAllFromRel } from '../utils';
|
|||||||
import { setTable, UPDATE_REMOTE_SCHEMA_MANUAL_REL } from '../DataActions';
|
import { setTable, UPDATE_REMOTE_SCHEMA_MANUAL_REL } from '../DataActions';
|
||||||
|
|
||||||
import AddRelationship from './AddManualRelationship';
|
import AddRelationship from './AddManualRelationship';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
/* Gets the complete list of relationships and converts it to a list of object, which looks like so :
|
/* Gets the complete list of relationships and converts it to a list of object, which looks like so :
|
||||||
{
|
{
|
||||||
@ -70,9 +71,9 @@ const relationshipView = (
|
|||||||
return (
|
return (
|
||||||
<td>
|
<td>
|
||||||
<div>
|
<div>
|
||||||
<button className="btn btn-sm btn-danger" onClick={onDelete}>
|
<Button size="sm" color="red" onClick={onDelete}>
|
||||||
Remove
|
Remove
|
||||||
</button>
|
</Button>
|
||||||
|
|
||||||
<b>{relName}</b>
|
<b>{relName}</b>
|
||||||
<div className={tableStyles.relationshipTopPadding}>
|
<div className={tableStyles.relationshipTopPadding}>
|
||||||
@ -230,15 +231,16 @@ class RelationshipsView extends Component {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-sm btn-default"
|
color="white"
|
||||||
|
size="sm"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
dispatch(addNewRelClicked());
|
dispatch(addNewRelClicked());
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
+ Add relationship
|
+ Add relationship
|
||||||
</button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
|
@ -3,6 +3,7 @@ import React, { Component } from 'react';
|
|||||||
import Helmet from 'react-helmet';
|
import Helmet from 'react-helmet';
|
||||||
import * as tooltip from './Tooltips';
|
import * as tooltip from './Tooltips';
|
||||||
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
removeHeader,
|
removeHeader,
|
||||||
@ -265,10 +266,7 @@ class AddTrigger extends Component {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<div
|
<div key={i} className={styles.noPadd + ' col-md-4'}>
|
||||||
key={i}
|
|
||||||
className={styles.noPadd + ' col-md-4'}
|
|
||||||
>
|
|
||||||
<div className={'checkbox '}>
|
<div className={'checkbox '}>
|
||||||
<label>
|
<label>
|
||||||
{inputHtml}
|
{inputHtml}
|
||||||
@ -295,7 +293,10 @@ class AddTrigger extends Component {
|
|||||||
</OverlayTrigger>{' '}
|
</OverlayTrigger>{' '}
|
||||||
</h4>
|
</h4>
|
||||||
{selectedOperations.update ? (
|
{selectedOperations.update ? (
|
||||||
<div className={styles.clearBoth + ' ' + styles.listenColumnWrapper}> {getColumnList('update')} </div>
|
<div className={styles.clearBoth + ' ' + styles.listenColumnWrapper}>
|
||||||
|
{' '}
|
||||||
|
{getColumnList('update')}{' '}
|
||||||
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
@ -651,19 +652,18 @@ class AddTrigger extends Component {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
<button
|
<div
|
||||||
onClick={this.toggleAdvanced.bind(this)}
|
onClick={this.toggleAdvanced.bind(this)}
|
||||||
|
className={styles.toggleAdvanced}
|
||||||
data-test="advanced-settings"
|
data-test="advanced-settings"
|
||||||
type="button"
|
|
||||||
className={'btn btn-default ' + styles.advancedToggleBtn}
|
|
||||||
>
|
>
|
||||||
Advanced Settings
|
|
||||||
{this.state.advancedExpanded ? (
|
{this.state.advancedExpanded ? (
|
||||||
<i className={'fa fa-arrow-up'} />
|
<i className={'fa fa-chevron-down'} />
|
||||||
) : (
|
) : (
|
||||||
<i className={'fa fa-arrow-down'} />
|
<i className={'fa fa-chevron-right'} />
|
||||||
)}
|
)}{' '}
|
||||||
</button>
|
<b>Advanced Settings</b>
|
||||||
|
</div>
|
||||||
{this.state.advancedExpanded ? (
|
{this.state.advancedExpanded ? (
|
||||||
<div
|
<div
|
||||||
className={
|
className={
|
||||||
@ -671,12 +671,20 @@ class AddTrigger extends Component {
|
|||||||
' ' +
|
' ' +
|
||||||
styles.add_mar_bottom +
|
styles.add_mar_bottom +
|
||||||
' ' +
|
' ' +
|
||||||
styles.add_mar_top + ' ' + styles.wd100
|
styles.add_mar_top +
|
||||||
|
' ' +
|
||||||
|
styles.wd100
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{tableName ? advancedColumnSection : null}
|
{tableName ? advancedColumnSection : null}
|
||||||
<div
|
<div
|
||||||
className={styles.add_mar_bottom + ' ' + styles.add_mar_top + ' ' + styles.wd100}
|
className={
|
||||||
|
styles.add_mar_bottom +
|
||||||
|
' ' +
|
||||||
|
styles.add_mar_top +
|
||||||
|
' ' +
|
||||||
|
styles.wd100
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<h4 className={styles.subheading_text}>Retry Logic</h4>
|
<h4 className={styles.subheading_text}>Retry Logic</h4>
|
||||||
<div
|
<div
|
||||||
@ -725,7 +733,13 @@ class AddTrigger extends Component {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className={styles.add_mar_bottom + ' ' + styles.add_mar_top + ' ' + styles.wd100}
|
className={
|
||||||
|
styles.add_mar_bottom +
|
||||||
|
' ' +
|
||||||
|
styles.add_mar_top +
|
||||||
|
' ' +
|
||||||
|
styles.wd100
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<h4 className={styles.subheading_text}>Headers</h4>
|
<h4 className={styles.subheading_text}>Headers</h4>
|
||||||
{heads}
|
{heads}
|
||||||
@ -733,13 +747,14 @@ class AddTrigger extends Component {
|
|||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
<hr />
|
<hr />
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={`btn ${styles.yellow_button}`}
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
data-test="trigger-create"
|
data-test="trigger-create"
|
||||||
>
|
>
|
||||||
{createBtnText}
|
{createBtnText}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { deleteTrigger } from '../EventActions';
|
import { deleteTrigger } from '../EventActions';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
const verifyDeleteTrigger = (triggerName, dispatch) => {
|
const verifyDeleteTrigger = (triggerName, dispatch) => {
|
||||||
if (confirm('Are you sure?')) {
|
if (confirm('Are you sure?')) {
|
||||||
@ -9,14 +10,15 @@ const verifyDeleteTrigger = (triggerName, dispatch) => {
|
|||||||
|
|
||||||
const Buttons = ({ styles, dispatch, triggerName, ongoingRequest }) => (
|
const Buttons = ({ styles, dispatch, triggerName, ongoingRequest }) => (
|
||||||
<div className={styles.add_mar_bottom}>
|
<div className={styles.add_mar_bottom}>
|
||||||
<button
|
<Button
|
||||||
className={'btn btn-sm btn-danger'}
|
color="red"
|
||||||
|
size="sm"
|
||||||
data-test="delete-trigger"
|
data-test="delete-trigger"
|
||||||
onClick={() => verifyDeleteTrigger(triggerName, dispatch)}
|
onClick={() => verifyDeleteTrigger(triggerName, dispatch)}
|
||||||
disabled={ongoingRequest === 'delete'}
|
disabled={ongoingRequest === 'delete'}
|
||||||
>
|
>
|
||||||
{ongoingRequest === 'delete' ? 'Deleting ...' : 'Delete'}
|
{ongoingRequest === 'delete' ? 'Deleting ...' : 'Delete'}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
class Editor extends React.Component {
|
class Editor extends React.Component {
|
||||||
state = {
|
state = {
|
||||||
@ -16,37 +17,35 @@ class Editor extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
toggleButton = () => (
|
toggleButton = () => (
|
||||||
<button
|
<Button
|
||||||
className={`${this.props.styles.add_mar_small}
|
className={`${this.props.styles.add_mar_small}
|
||||||
btn btn-sm btn-default
|
|
||||||
${this.props.styles.modifyEditButton}`}
|
${this.props.styles.modifyEditButton}`}
|
||||||
|
color="white"
|
||||||
|
size="sm"
|
||||||
data-test={`${this.state.isEditing ? 'close' : 'edit'}-${
|
data-test={`${this.state.isEditing ? 'close' : 'edit'}-${
|
||||||
this.props.name
|
this.props.name
|
||||||
}`}
|
}`}
|
||||||
onClick={this.toggleEditor}
|
onClick={this.toggleEditor}
|
||||||
>
|
>
|
||||||
{this.state.isEditing ? 'Close' : 'Edit'}
|
{this.state.isEditing ? 'Close' : 'Edit'}
|
||||||
</button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
|
||||||
saveButton = saveFunc => {
|
saveButton = saveFunc => {
|
||||||
const { name, property, ongoingRequest, styles } = this.props;
|
const { name, property, ongoingRequest, styles } = this.props;
|
||||||
const isSaving = ongoingRequest === property;
|
const isSaving = ongoingRequest === property;
|
||||||
return (
|
return (
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={`
|
className={styles.modifySaveButton}
|
||||||
btn
|
color="yellow"
|
||||||
${styles.yellow_button}
|
size="sm"
|
||||||
${
|
|
||||||
isSaving ? styles.modifySaveButtonDisabled : styles.modifySaveButton
|
|
||||||
}`}
|
|
||||||
onClick={saveFunc}
|
onClick={saveFunc}
|
||||||
data-test={`modify-trigger-${name}-save`}
|
data-test={`modify-trigger-${name}-save`}
|
||||||
disabled={isSaving}
|
disabled={isSaving}
|
||||||
>
|
>
|
||||||
{isSaving ? 'Saving ...' : 'Save'}
|
{isSaving ? 'Saving ...' : 'Save'}
|
||||||
</button>
|
</Button>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -53,8 +53,6 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
background-color: #e6cd8f;
|
|
||||||
border-color: #e6cd8f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.modifyWebhookCollapsed {
|
.modifyWebhookCollapsed {
|
||||||
|
@ -2,6 +2,7 @@ import React from 'react';
|
|||||||
import AceEditor from 'react-ace';
|
import AceEditor from 'react-ace';
|
||||||
import { showNotification, showTempNotification } from '../../App/Actions';
|
import { showNotification, showTempNotification } from '../../App/Actions';
|
||||||
import { notifExpand, notifMsg } from '../../App/Actions';
|
import { notifExpand, notifMsg } from '../../App/Actions';
|
||||||
|
import Button from '../Layout/Button/Button';
|
||||||
|
|
||||||
const styles = require('./TableCommon/Table.scss');
|
const styles = require('./TableCommon/Table.scss');
|
||||||
|
|
||||||
@ -47,15 +48,17 @@ const showErrorNotification = (title, message, reqBody, error) => {
|
|||||||
let finalJson = error ? error.message : '{}';
|
let finalJson = error ? error.message : '{}';
|
||||||
if (error && 'action' in error) {
|
if (error && 'action' in error) {
|
||||||
refreshBtn = (
|
refreshBtn = (
|
||||||
<button
|
<Button
|
||||||
className={styles.yellow_button + ' ' + styles.add_mar_top_small}
|
className={styles.add_mar_top_small}
|
||||||
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Refresh Console
|
Refresh Console
|
||||||
</button>
|
</Button>
|
||||||
);
|
);
|
||||||
finalJson = error.action;
|
finalJson = error.action;
|
||||||
} else if (error && 'internal' in error) {
|
} else if (error && 'internal' in error) {
|
||||||
|
@ -4,6 +4,7 @@ import React from 'react';
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { Link } from 'react-router';
|
import { Link } from 'react-router';
|
||||||
import globals from '../../../../Globals';
|
import globals from '../../../../Globals';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
import { LISTING_TRIGGER } from '../EventActions';
|
import { LISTING_TRIGGER } from '../EventActions';
|
||||||
|
|
||||||
@ -114,12 +115,14 @@ const PageContainer = ({
|
|||||||
className={styles.padd_remove_full}
|
className={styles.padd_remove_full}
|
||||||
to={'/events/manage/triggers/add'}
|
to={'/events/manage/triggers/add'}
|
||||||
>
|
>
|
||||||
<button
|
<Button
|
||||||
className={styles.add_mar_right + ' btn btn-xs btn-default'}
|
className={styles.add_mar_right}
|
||||||
|
color="white"
|
||||||
|
size="xs"
|
||||||
data-test="sidebar-add-table"
|
data-test="sidebar-add-table"
|
||||||
>
|
>
|
||||||
Add Trigger
|
Add Trigger
|
||||||
</button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
@ -21,6 +21,7 @@ import {
|
|||||||
addOrder,
|
addOrder,
|
||||||
removeOrder,
|
removeOrder,
|
||||||
} from './FilterActions.js';
|
} from './FilterActions.js';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
import { setDefaultQuery, runQuery } from './FilterActions';
|
import { setDefaultQuery, runQuery } from './FilterActions';
|
||||||
import { vMakeRequest } from './ViewActions';
|
import { vMakeRequest } from './ViewActions';
|
||||||
|
|
||||||
@ -223,16 +224,19 @@ class FilterQuery extends Component {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${styles.padd_right} ${styles.clear_fix}`}>
|
<div className={`${styles.padd_right} ${styles.clear_fix}`}>
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={`btn ${styles.yellow_button}`}
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
data-test="run-query"
|
data-test="run-query"
|
||||||
>
|
>
|
||||||
Run query
|
Run query
|
||||||
</button>
|
</Button>
|
||||||
<button
|
<Button
|
||||||
onClick={this.watchChanges.bind(this)}
|
onClick={this.watchChanges.bind(this)}
|
||||||
className={styles.add_mar_left + ' btn btn-default'}
|
className={styles.add_mar_left}
|
||||||
|
color="white"
|
||||||
|
size="sm"
|
||||||
data-test="run-query"
|
data-test="run-query"
|
||||||
>
|
>
|
||||||
{this.state.isWatching ? (
|
{this.state.isWatching ? (
|
||||||
@ -242,7 +246,7 @@ class FilterQuery extends Component {
|
|||||||
) : (
|
) : (
|
||||||
'Watch'
|
'Watch'
|
||||||
)}
|
)}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -21,6 +21,7 @@ import {
|
|||||||
addOrder,
|
addOrder,
|
||||||
removeOrder,
|
removeOrder,
|
||||||
} from './FilterActions.js';
|
} from './FilterActions.js';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
import { setDefaultQuery, runQuery } from './FilterActions';
|
import { setDefaultQuery, runQuery } from './FilterActions';
|
||||||
import { vMakeRequest } from './ViewActions';
|
import { vMakeRequest } from './ViewActions';
|
||||||
|
|
||||||
@ -223,16 +224,19 @@ class FilterQuery extends Component {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${styles.padd_right} ${styles.clear_fix}`}>
|
<div className={`${styles.padd_right} ${styles.clear_fix}`}>
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={`btn ${styles.yellow_button}`}
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
data-test="run-query"
|
data-test="run-query"
|
||||||
>
|
>
|
||||||
Run query
|
Run query
|
||||||
</button>
|
</Button>
|
||||||
<button
|
<Button
|
||||||
onClick={this.watchChanges.bind(this)}
|
onClick={this.watchChanges.bind(this)}
|
||||||
className={styles.add_mar_left + ' btn btn-default'}
|
className={styles.add_mar_left}
|
||||||
|
color="white"
|
||||||
|
size="sm"
|
||||||
data-test="run-query"
|
data-test="run-query"
|
||||||
>
|
>
|
||||||
{this.state.isWatching ? (
|
{this.state.isWatching ? (
|
||||||
@ -242,7 +246,7 @@ class FilterQuery extends Component {
|
|||||||
) : (
|
) : (
|
||||||
'Watch'
|
'Watch'
|
||||||
)}
|
)}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -23,6 +23,7 @@ import {
|
|||||||
} from './FilterActions.js';
|
} from './FilterActions.js';
|
||||||
import { setDefaultQuery, runQuery } from './FilterActions';
|
import { setDefaultQuery, runQuery } from './FilterActions';
|
||||||
import { vMakeRequest } from './ViewActions';
|
import { vMakeRequest } from './ViewActions';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
const renderCols = (colName, triggerSchema, onChange, usage, key) => {
|
const renderCols = (colName, triggerSchema, onChange, usage, key) => {
|
||||||
const columns = ['id', 'delivered', 'created_at'];
|
const columns = ['id', 'delivered', 'created_at'];
|
||||||
@ -223,16 +224,19 @@ class FilterQuery extends Component {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${styles.padd_right} ${styles.clear_fix}`}>
|
<div className={`${styles.padd_right} ${styles.clear_fix}`}>
|
||||||
<button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={`btn ${styles.yellow_button}`}
|
|
||||||
data-test="run-query"
|
data-test="run-query"
|
||||||
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
>
|
>
|
||||||
Run query
|
Run query
|
||||||
</button>
|
</Button>
|
||||||
<button
|
<Button
|
||||||
onClick={this.watchChanges.bind(this)}
|
onClick={this.watchChanges.bind(this)}
|
||||||
className={styles.add_mar_left + ' btn btn-default'}
|
className={styles.add_mar_left}
|
||||||
|
color="white"
|
||||||
|
size="sm"
|
||||||
data-test="run-query"
|
data-test="run-query"
|
||||||
>
|
>
|
||||||
{this.state.isWatching ? (
|
{this.state.isWatching ? (
|
||||||
@ -242,7 +246,7 @@ class FilterQuery extends Component {
|
|||||||
) : (
|
) : (
|
||||||
'Watch'
|
'Watch'
|
||||||
)}
|
)}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,134 +0,0 @@
|
|||||||
/* eslint-disable space-infix-ops */
|
|
||||||
/* eslint-disable no-loop-func */
|
|
||||||
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import {
|
|
||||||
autoTrackRelations,
|
|
||||||
autoAddRelName,
|
|
||||||
} from '../TableRelationships/Actions';
|
|
||||||
import { getRelationshipLine } from '../TableRelationships/Relationships';
|
|
||||||
import suggestedRelationshipsRaw from '../TableRelationships/autoRelations';
|
|
||||||
|
|
||||||
class AutoAddRelations extends Component {
|
|
||||||
trackAllRelations = () => {
|
|
||||||
this.props.dispatch(autoTrackRelations());
|
|
||||||
};
|
|
||||||
render() {
|
|
||||||
const { schema, untrackedRelations, dispatch } = this.props;
|
|
||||||
const styles = require('../PageContainer/PageContainer.scss');
|
|
||||||
const handleAutoAddIndivRel = obj => {
|
|
||||||
dispatch(autoAddRelName(obj));
|
|
||||||
};
|
|
||||||
|
|
||||||
if (untrackedRelations.length === 0) {
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className={styles.display_inline + ' ' + styles.padd_bottom}
|
|
||||||
key="no-untracked-rel"
|
|
||||||
>
|
|
||||||
There are no untracked relations
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
const untrackedIndivHtml = [];
|
|
||||||
schema.map(table => {
|
|
||||||
const currentTable = table.table_name;
|
|
||||||
const currentTableRel = suggestedRelationshipsRaw(currentTable, schema);
|
|
||||||
currentTableRel.objectRel.map(obj => {
|
|
||||||
untrackedIndivHtml.push(
|
|
||||||
<div
|
|
||||||
className={styles.padd_top_medium}
|
|
||||||
key={'untrackedIndiv' + table.table_name}
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
className={`${styles.display_inline} btn btn-xs btn-default`}
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
handleAutoAddIndivRel(obj);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Add
|
|
||||||
</button>
|
|
||||||
<div className={styles.display_inline + ' ' + styles.add_pad_left}>
|
|
||||||
<b>{obj.tableName}</b> -{' '}
|
|
||||||
{getRelationshipLine(
|
|
||||||
obj.isObjRel,
|
|
||||||
obj.lcol,
|
|
||||||
obj.rcol,
|
|
||||||
obj.rTable
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
currentTableRel.arrayRel.map(obj => {
|
|
||||||
untrackedIndivHtml.push(
|
|
||||||
<div
|
|
||||||
className={styles.padd_top_medium}
|
|
||||||
key={'untrackedIndiv' + table.table_name}
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
className={`${styles.display_inline} btn btn-xs btn-default`}
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
handleAutoAddIndivRel(obj);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Add
|
|
||||||
</button>
|
|
||||||
<div className={styles.display_inline + ' ' + styles.add_pad_left}>
|
|
||||||
<b>{obj.tableName}</b> -{' '}
|
|
||||||
{getRelationshipLine(
|
|
||||||
obj.isObjRel,
|
|
||||||
obj.lcol,
|
|
||||||
obj.rcol,
|
|
||||||
obj.rTable
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
{untrackedRelations.length === 0 ? (
|
|
||||||
<div
|
|
||||||
className={styles.display_inline + ' ' + styles.padd_bottom}
|
|
||||||
key="no-untracked-rel"
|
|
||||||
>
|
|
||||||
There are no untracked relations
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<div
|
|
||||||
className={styles.display_inline + ' ' + styles.padd_bottom}
|
|
||||||
key="untracked-rel"
|
|
||||||
>
|
|
||||||
There are {untrackedRelations.length} untracked relations
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<button
|
|
||||||
onClick={this.trackAllRelations}
|
|
||||||
className={
|
|
||||||
styles.display_inline +
|
|
||||||
' btn btn-xs btn-default ' +
|
|
||||||
styles.add_mar_left
|
|
||||||
}
|
|
||||||
data-test="track-all-relationships"
|
|
||||||
>
|
|
||||||
Track All Relations
|
|
||||||
</button>
|
|
||||||
<div className={styles.padd_top_small}>{untrackedIndivHtml}</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AutoAddRelations.propTypes = {
|
|
||||||
untrackedRelations: PropTypes.array.isRequired,
|
|
||||||
schema: PropTypes.array.isRequired,
|
|
||||||
dispatch: PropTypes.func.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default AutoAddRelations;
|
|
@ -8,6 +8,7 @@ import Helmet from 'react-helmet';
|
|||||||
import { push } from 'react-router-redux';
|
import { push } from 'react-router-redux';
|
||||||
import { loadTriggers } from '../EventActions';
|
import { loadTriggers } from '../EventActions';
|
||||||
import globals from '../../../../Globals';
|
import globals from '../../../../Globals';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
const appPrefix = globals.urlPrefix + '/events';
|
const appPrefix = globals.urlPrefix + '/events';
|
||||||
|
|
||||||
@ -38,16 +39,17 @@ class Schema extends Component {
|
|||||||
Event Triggers{' '}
|
Event Triggers{' '}
|
||||||
</h2>
|
</h2>
|
||||||
{migrationMode ? (
|
{migrationMode ? (
|
||||||
<button
|
<Button
|
||||||
data-test="data-create-trigger"
|
data-test="data-create-trigger"
|
||||||
className={styles.yellow_button}
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
dispatch(push(`${appPrefix}/manage/triggers/add`));
|
dispatch(push(`${appPrefix}/manage/triggers/add`));
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Create Trigger
|
Create Trigger
|
||||||
</button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
|
@ -28,6 +28,7 @@ import {
|
|||||||
import * as tooltip from '../Common/Tooltips';
|
import * as tooltip from '../Common/Tooltips';
|
||||||
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
||||||
import { convertDateTimeToLocale } from '../utils';
|
import { convertDateTimeToLocale } from '../utils';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
class StreamingLogs extends Component {
|
class StreamingLogs extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@ -287,9 +288,11 @@ class StreamingLogs extends Component {
|
|||||||
/>
|
/>
|
||||||
<br />
|
<br />
|
||||||
<div className={'hide'}>
|
<div className={'hide'}>
|
||||||
<button
|
<Button
|
||||||
onClick={this.watchChanges.bind(this)}
|
onClick={this.watchChanges.bind(this)}
|
||||||
className={styles.watchBtn + ' btn btn-default'}
|
className={styles.watchBtn}
|
||||||
|
color="white"
|
||||||
|
size="sm"
|
||||||
data-test="run-query"
|
data-test="run-query"
|
||||||
>
|
>
|
||||||
{this.state.isWatching ? (
|
{this.state.isWatching ? (
|
||||||
@ -302,7 +305,7 @@ class StreamingLogs extends Component {
|
|||||||
Stream Logs <i className={'fa fa-play'} />
|
Stream Logs <i className={'fa fa-play'} />
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
{invocationRowsData.length ? (
|
{invocationRowsData.length ? (
|
||||||
<div className={styles.streamingLogs + ' streamingLogs'}>
|
<div className={styles.streamingLogs + ' streamingLogs'}>
|
||||||
@ -315,9 +318,11 @@ class StreamingLogs extends Component {
|
|||||||
onChange={this.filterAll.bind(this)}
|
onChange={this.filterAll.bind(this)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<Button
|
||||||
onClick={this.handleNewerEvents.bind(this)}
|
onClick={this.handleNewerEvents.bind(this)}
|
||||||
className={styles.newBtn + ' btn btn-default'}
|
className={styles.newBtn}
|
||||||
|
color="white"
|
||||||
|
size="sm"
|
||||||
>
|
>
|
||||||
{log.isLoadingNewer ? (
|
{log.isLoadingNewer ? (
|
||||||
<span>
|
<span>
|
||||||
@ -326,7 +331,7 @@ class StreamingLogs extends Component {
|
|||||||
) : (
|
) : (
|
||||||
<span>Load newer logs</span>
|
<span>Load newer logs</span>
|
||||||
)}
|
)}
|
||||||
</button>
|
</Button>
|
||||||
{!log.isNewAvailable ? (
|
{!log.isNewAvailable ? (
|
||||||
<span> No new logs available at this time </span>
|
<span> No new logs available at this time </span>
|
||||||
) : null}
|
) : null}
|
||||||
@ -482,9 +487,10 @@ class StreamingLogs extends Component {
|
|||||||
/>
|
/>
|
||||||
<div className={styles.loadOlder}>
|
<div className={styles.loadOlder}>
|
||||||
{log.isOldAvailable ? (
|
{log.isOldAvailable ? (
|
||||||
<button
|
<Button
|
||||||
onClick={this.handleOlderEvents.bind(this)}
|
onClick={this.handleOlderEvents.bind(this)}
|
||||||
className={styles.oldBtn + ' btn btn-default'}
|
color="white"
|
||||||
|
size="sm"
|
||||||
>
|
>
|
||||||
{log.isLoadingOlder ? (
|
{log.isLoadingOlder ? (
|
||||||
<span>
|
<span>
|
||||||
@ -493,7 +499,7 @@ class StreamingLogs extends Component {
|
|||||||
) : (
|
) : (
|
||||||
<span>Load older logs</span>
|
<span>Load older logs</span>
|
||||||
)}
|
)}
|
||||||
</button>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<div> No more logs available </div>
|
<div> No more logs available </div>
|
||||||
)}
|
)}
|
||||||
|
@ -12,6 +12,7 @@ import {
|
|||||||
} from '../EventActions';
|
} from '../EventActions';
|
||||||
import AceEditor from 'react-ace';
|
import AceEditor from 'react-ace';
|
||||||
import 'brace/mode/json';
|
import 'brace/mode/json';
|
||||||
|
import Button from '../../Layout/Button/Button';
|
||||||
|
|
||||||
class RedeliverEvent extends Component {
|
class RedeliverEvent extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@ -211,12 +212,14 @@ class RedeliverEvent extends Component {
|
|||||||
<div className="col-md-12">
|
<div className="col-md-12">
|
||||||
<div className={styles.add_mar_bottom}>
|
<div className={styles.add_mar_bottom}>
|
||||||
Event ID - {log.redeliverEventId}
|
Event ID - {log.redeliverEventId}
|
||||||
<button
|
<Button
|
||||||
onClick={this.handleRedeliver.bind(this)}
|
onClick={this.handleRedeliver.bind(this)}
|
||||||
className={'hide btn btn-default'}
|
className="hide"
|
||||||
|
color="white"
|
||||||
|
size="sm"
|
||||||
>
|
>
|
||||||
Deliver again
|
Deliver again
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.padd_left_remove + ' col-md-5'}>
|
<div className={styles.padd_left_remove + ' col-md-5'}>
|
||||||
<div> Request </div>
|
<div> Request </div>
|
||||||
|
@ -272,7 +272,6 @@ a.expanded {
|
|||||||
|
|
||||||
.advancedToggleBtn {
|
.advancedToggleBtn {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
background: #f2f2f2 !important;
|
|
||||||
i {
|
i {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
@ -293,7 +292,6 @@ a.expanded {
|
|||||||
min-height: 41px;
|
min-height: 41px;
|
||||||
}
|
}
|
||||||
.newBtn {
|
.newBtn {
|
||||||
font-size: 12px;
|
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
.loadNewer {
|
.loadNewer {
|
||||||
@ -314,9 +312,6 @@ a.expanded {
|
|||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.oldBtn {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
.retryEvent {
|
.retryEvent {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
@ -346,3 +341,12 @@ a.expanded {
|
|||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.toggleAdvanced {
|
||||||
|
cursor: pointer;
|
||||||
|
b {
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
i:hover {
|
||||||
|
color: #4D4D4D ;
|
||||||
|
}
|
||||||
|
}
|
40
console/src/components/Services/Layout/Button/Button.js
Normal file
40
console/src/components/Services/Layout/Button/Button.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import styles from '../../../Common/Common.scss';
|
||||||
|
|
||||||
|
/*
|
||||||
|
This is a Button HOC that takes al the props supported by <button> and also
|
||||||
|
- color: (default: white) color of the button; currently supports yellow, red, green, gray, white
|
||||||
|
- size: size of the button; currently supports xs (extra small), sm(small)
|
||||||
|
- className: although you can provide any CSS classname, it is recommended to use only the positioning related classes and not the ones that change the appearance (color, font, size) of the button
|
||||||
|
*/
|
||||||
|
|
||||||
|
const Button = props => {
|
||||||
|
const { children, size, color, className } = props;
|
||||||
|
let extendedClassName = `${className || ''} btn ${
|
||||||
|
size ? `btn-${size} ` : 'button '
|
||||||
|
}`;
|
||||||
|
switch (color) {
|
||||||
|
case 'yellow':
|
||||||
|
extendedClassName += styles.yellow_button;
|
||||||
|
break;
|
||||||
|
case 'red':
|
||||||
|
extendedClassName += 'btn-danger';
|
||||||
|
break;
|
||||||
|
case 'green':
|
||||||
|
extendedClassName += 'btn-success';
|
||||||
|
break;
|
||||||
|
case 'gray':
|
||||||
|
extendedClassName += styles.gray_button;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
extendedClassName += 'btn-default';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<button {...props} className={extendedClassName}>
|
||||||
|
{children}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Button;
|
@ -4,6 +4,7 @@ import React from 'react';
|
|||||||
import { Link } from 'react-router';
|
import { Link } from 'react-router';
|
||||||
|
|
||||||
import { LISTING_SCHEMA } from '../../Data/DataActions';
|
import { LISTING_SCHEMA } from '../../Data/DataActions';
|
||||||
|
import Button from '../Button/Button';
|
||||||
|
|
||||||
const LeftNavBar = ({
|
const LeftNavBar = ({
|
||||||
appPrefix,
|
appPrefix,
|
||||||
@ -69,12 +70,14 @@ const LeftNavBar = ({
|
|||||||
className={styles.padd_remove_full}
|
className={styles.padd_remove_full}
|
||||||
to={`${appPrefix}/manage/add`}
|
to={`${appPrefix}/manage/add`}
|
||||||
>
|
>
|
||||||
<button
|
<Button
|
||||||
className={styles.add_mar_right + ' btn btn-xs btn-default'}
|
className={styles.add_mar_right}
|
||||||
|
color="white"
|
||||||
|
size="xs"
|
||||||
data-test="remote-schema-sidebar-add-table"
|
data-test="remote-schema-sidebar-add-table"
|
||||||
>
|
>
|
||||||
Add
|
Add
|
||||||
</button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
@ -5,6 +5,7 @@ import PropTypes from 'prop-types';
|
|||||||
|
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import Helmet from 'react-helmet';
|
import Helmet from 'react-helmet';
|
||||||
|
import Button from '../Button/Button';
|
||||||
import { push } from 'react-router-redux';
|
import { push } from 'react-router-redux';
|
||||||
import { loadTriggers } from '../EventActions';
|
import { loadTriggers } from '../EventActions';
|
||||||
import globals from '../../../../Globals';
|
import globals from '../../../../Globals';
|
||||||
@ -38,16 +39,18 @@ class Schema extends Component {
|
|||||||
Event Triggers{' '}
|
Event Triggers{' '}
|
||||||
</h2>
|
</h2>
|
||||||
{migrationMode ? (
|
{migrationMode ? (
|
||||||
<button
|
<Button
|
||||||
data-test="data-create-trigger"
|
data-test="data-create-trigger"
|
||||||
className={styles.yellow_button}
|
className={styles.button_mar_right}
|
||||||
|
color="yellow"
|
||||||
|
size="sm"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
dispatch(push(`${appPrefix}/manage/triggers/add`));
|
dispatch(push(`${appPrefix}/manage/triggers/add`));
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Create Trigger
|
Create Trigger
|
||||||
</button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
|
Loading…
Reference in New Issue
Block a user