mirror of
https://github.com/bakhirev/assayo.git
synced 2025-02-22 21:12:19 +00:00
update
This commit is contained in:
parent
734ed93a32
commit
10e39d967e
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,7 @@
|
||||||
import { makeObservable, observable, action } from 'mobx';
|
import { makeObservable, observable, action } from 'mobx';
|
||||||
|
|
||||||
|
import { t } from 'ts/helpers/Localization';
|
||||||
|
|
||||||
export interface IConfirmStore {
|
export interface IConfirmStore {
|
||||||
title: string;
|
title: string;
|
||||||
yes: string;
|
yes: string;
|
||||||
|
@ -36,9 +38,9 @@ class ConfirmStore implements IConfirmStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
open(options?: any) {
|
open(options?: any) {
|
||||||
this.title = options?.title || options || 'Вы уверены что хотите удалить?';
|
this.title = options?.title || options || t('common.confirm.title');
|
||||||
this.yes = options?.yes || 'Да, уверен';
|
this.yes = options?.yes || t('common.confirm.yes');
|
||||||
this.no = options?.no || 'Отмена';
|
this.no = options?.no || t('common.confirm.no');
|
||||||
this.isOpen = true;
|
this.isOpen = true;
|
||||||
return new Promise((response: any, reject: any) => {
|
return new Promise((response: any, reject: any) => {
|
||||||
this.successCallback = response;
|
this.successCallback = response;
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import localization from 'ts/helpers/Localization';
|
import localization from 'ts/helpers/Localization';
|
||||||
import dataGripStore from 'ts/store/DataGrip';
|
import dataGripStore from 'ts/store/DataGrip';
|
||||||
|
import viewNameStore, { ViewNameEnum } from 'ts/store/ViewName';
|
||||||
import confirm from 'ts/components/ModalWindow/store/Confirm';
|
import confirm from 'ts/components/ModalWindow/store/Confirm';
|
||||||
|
|
||||||
import Button from './Button';
|
import Button from './Button';
|
||||||
|
@ -47,8 +48,9 @@ function getMenu(navigate: Function): any[] {
|
||||||
confirm.open({
|
confirm.open({
|
||||||
title: 'Вы уверены что хотите выйти?',
|
title: 'Вы уверены что хотите выйти?',
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
dataGripStore.asyncSetCommits([]);
|
dataGripStore.exit();
|
||||||
navigate('/');
|
navigate('/');
|
||||||
|
viewNameStore.toggle(ViewNameEnum.WELCOME);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -41,6 +41,7 @@ class DataGripStore {
|
||||||
processingDataAnalysis: action,
|
processingDataAnalysis: action,
|
||||||
depersonalized: action,
|
depersonalized: action,
|
||||||
updateStatistic: action,
|
updateStatistic: action,
|
||||||
|
exit: action,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,6 +148,13 @@ class DataGripStore {
|
||||||
this.fileGrip = fileGrip;
|
this.fileGrip = fileGrip;
|
||||||
this.hash = Math.random();
|
this.hash = Math.random();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exit() {
|
||||||
|
dataGrip.clear();
|
||||||
|
fileGrip.clear();
|
||||||
|
this.commits = [];
|
||||||
|
this.#updateRender();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const dataGripStore = new DataGripStore();
|
const dataGripStore = new DataGripStore();
|
||||||
|
|
|
@ -26,4 +26,8 @@ export default `
|
||||||
§ common.notifications.save: Изменения сохранены
|
§ common.notifications.save: Изменения сохранены
|
||||||
§ common.notifications.setting: Настройки сохранены
|
§ common.notifications.setting: Настройки сохранены
|
||||||
§ common.fileLoader.notification: Ошибка загрузки файла $1
|
§ common.fileLoader.notification: Ошибка загрузки файла $1
|
||||||
|
§ common.confirm.title: Вы уверены что хотите удалить?
|
||||||
|
§ common.confirm.yes: Да, уверен
|
||||||
|
§ common.confirm.no: Отмена
|
||||||
|
§ common.confirm.abc: abc
|
||||||
`;
|
`;
|
||||||
|
|
Loading…
Reference in a new issue