Merge goal template
This commit is contained in:
Коммит
eb178658e1
|
@ -108,7 +108,7 @@ export default class Card extends React.PureComponent<ICardProps, ICardState> {
|
||||||
onClick={() => SettingsActions.openDialog(title, id)}
|
onClick={() => SettingsActions.openDialog(title, id)}
|
||||||
className="card-settings-btn"
|
className="card-settings-btn"
|
||||||
>
|
>
|
||||||
settings
|
expand_more
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,7 @@ export default class Editor extends React.PureComponent<IEditorProps, IEditorSta
|
||||||
];
|
];
|
||||||
|
|
||||||
const actions = !value ? null : actionButtons;
|
const actions = !value ? null : actionButtons;
|
||||||
const content = !value ? this.renderLoading() : this.renderEditor(value, theme);
|
const content = value !== null ? this.renderEditor(value, theme) : this.renderLoading();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog
|
<Dialog
|
||||||
|
|
|
@ -30,7 +30,7 @@ export default class SetupDashboard extends React.Component<ISetupDashboardProps
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.onSave = this.onSave.bind(this);
|
this.onSave = this.onSave.bind(this);
|
||||||
this.onCancel = this.onCancel.bind(this);
|
this.onDelete = this.onDelete.bind(this);
|
||||||
this.onSaveGoToDashboard = this.onSaveGoToDashboard.bind(this);
|
this.onSaveGoToDashboard = this.onSaveGoToDashboard.bind(this);
|
||||||
this.redirectToHomepageIfStandalone = this.redirectToHomepageIfStandalone.bind(this);
|
this.redirectToHomepageIfStandalone = this.redirectToHomepageIfStandalone.bind(this);
|
||||||
|
|
||||||
|
@ -46,15 +46,15 @@ export default class SetupDashboard extends React.Component<ISetupDashboardProps
|
||||||
}
|
}
|
||||||
|
|
||||||
onParamChange(connectionKey: string, paramKey: string, value: any) {
|
onParamChange(connectionKey: string, paramKey: string, value: any) {
|
||||||
let { connections } = this.state;
|
const { connections } = this.state;
|
||||||
|
|
||||||
connections[connectionKey] = connections[connectionKey] || {};
|
connections[connectionKey] = connections[connectionKey] || {};
|
||||||
connections[connectionKey][paramKey] = value;
|
connections[connectionKey][paramKey] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
onSave() {
|
onSave() {
|
||||||
let { dashboard } = this.props;
|
const { dashboard } = this.props;
|
||||||
let { connections } = this.state;
|
const { connections } = this.state;
|
||||||
|
|
||||||
dashboard.config.connections = connections;
|
dashboard.config.connections = connections;
|
||||||
|
|
||||||
|
@ -66,18 +66,23 @@ export default class SetupDashboard extends React.Component<ISetupDashboardProps
|
||||||
setTimeout(this.redirectToHomepageIfStandalone, 2000);
|
setTimeout(this.redirectToHomepageIfStandalone, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
onCancel() {
|
onDelete() {
|
||||||
this.redirectToHomepageIfStandalone();
|
const { dashboard } = this.props;
|
||||||
|
if (!dashboard) {
|
||||||
|
console.warn('Dashboard not found. Aborting delete.');
|
||||||
|
}
|
||||||
|
ConfigurationsActions.deleteDashboard(dashboard.id);
|
||||||
|
window.location.href = '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
redirectToHomepageIfStandalone() {
|
redirectToHomepageIfStandalone() {
|
||||||
let { dashboard } = this.props;
|
const { dashboard } = this.props;
|
||||||
window.location.replace(`/dashboard/${dashboard.url}`);
|
window.location.replace(`/dashboard/${dashboard.url}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let { dashboard } = this.props;
|
const { dashboard } = this.props;
|
||||||
let { connections } = this.state;
|
const { connections } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ width: '100%' }}>
|
<div style={{ width: '100%' }}>
|
||||||
|
@ -85,8 +90,8 @@ export default class SetupDashboard extends React.Component<ISetupDashboardProps
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<Button flat primary label="Save" onClick={this.onSave}>save</Button>
|
<Button flat primary label="Save" onClick={this.onSave}>save</Button>
|
||||||
<Button flat secondary label="Save and Go to Dashboard" onClick={this.onSaveGoToDashboard}>save</Button>
|
<Button flat primary label="Save and Go to Dashboard" onClick={this.onSaveGoToDashboard}>save</Button>
|
||||||
<Button flat secondary label="Cancel" onClick={this.onCancel}>cancel</Button>
|
<Button flat secondary label="Delete" onClick={this.onDelete}>delete</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче