Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
deleteConfig = (record) => {
const { intl } = this.props;
Modal.confirm({
className: 'c7n-iam-confirm-modal',
title: intl.formatMessage({ id: `${intlPrefix}.delete.title` }),
content: intl.formatMessage({ id: `${intlPrefix}.delete.content` }, { name: record.name }),
onOk: () => {
ConfigurationStore.deleteConfig(record.id).then(({ failed, message }) => {
if (failed) {
Choerodon.prompt(message);
} else {
Choerodon.prompt(intl.formatMessage({ id: 'delete.success' }));
this.loadConfig();
}
});
},
});
}
handleDelete = (record) => {
const { intl } = this.props;
Modal.confirm({
className: 'c7n-iam-confirm-modal',
title: intl.formatMessage({ id: `${intlPrefix}.delete.title` }),
content: intl.formatMessage({ id: `${intlPrefix}.delete.content` }, { name: record.code }),
onOk: () => ExecutableProgramStore.deleteExecutableProgramById(record.id).then(({ failed, message }) => {
if (failed) {
Choerodon.prompt(message);
} else {
Choerodon.prompt(intl.formatMessage({ id: 'delete.success' }));
this.handleRefresh();
}
}),
});
};
handleDelete = (record) => {
const { intl } = this.props;
const { type, id } = this.taskdetail;
Modal.confirm({
className: 'c7n-iam-confirm-modal',
title: intl.formatMessage({ id: `${intlPrefix}.delete.title` }),
content: intl.formatMessage({ id: `${intlPrefix}.delete.content` }, { name: record.name }),
onOk: () => TaskDetailStore.deleteTask(record.id, type, id).then(({ failed, message }) => {
if (failed) {
Choerodon.prompt(message);
} else {
Choerodon.prompt(intl.formatMessage({ id: 'delete.success' }));
this.loadTaskDetail();
}
}).catch(() => {
Choerodon.prompt(intl.formatMessage({ id: 'delete.error' }));
}),
});
}
handleDelete = (record) => {
const { intl } = this.props;
Modal.confirm({
className: 'c7n-iam-confirm-modal',
title: intl.formatMessage({ id: `${intlPrefix}.remove.title` }),
content: intl.formatMessage({ id: `${intlPrefix}.remove.content` }, {
name: record.realName,
}),
onOk: () => RootUserStore.deleteRootUser(record.id).then(({ failed, message }) => {
if (failed) {
Choerodon.prompt(message);
} else {
Choerodon.prompt(intl.formatMessage({ id: 'remove.success' }));
this.reload();
}
}),
});
}
handleDelete(record) {
const { intl } = this.props;
Modal.confirm({
className: 'c7n-iam-confirm-modal',
title: intl.formatMessage({ id: 'mailtemplate.delete.owntitle' }),
content: intl.formatMessage({ id: 'mailtemplate.delete.owncontent' }, {
name: record.name,
}),
onOk: () => {
MailTemplateStore.deleteMailTemplate(record.id, this.mail.type, this.mail.orgId).then((data) => {
if (data.failed) {
Choerodon.prompt(data.message);
} else {
Choerodon.prompt(intl.formatMessage({ id: 'delete.success' }));
this.reload();
}
}).catch((error) => {
if (error) {
Choerodon.prompt(intl.formatMessage({ id: 'delete.error' }));
handleEnabled = (name) => {
const { AppState, intl } = this.props;
const userId = AppState.getUserId;
this.setState({ stopping: true });
Modal.confirm({
className: 'c7n-iam-confirm-modal',
title: intl.formatMessage({ id: `${intlPrefix}.disable.title` }),
content: intl.formatMessage({ id: `${intlPrefix}.disable.content` }, { name }),
onOk: () => ProjectSettingStore.disableProject(AppState.currentMenuType.id)
.then((data) => {
this.setState({
stopping: false,
});
Choerodon.prompt(this.props.intl.formatMessage({ id: 'disable.success' }));
ProjectSettingStore.setProjectInfo(data);
HeaderStore.updateProject(data);
this.props.history.push('/');
HeaderStore.axiosGetOrgAndPro(sessionStorage.userId || userId).then((org) => {
org[0].forEach((value) => {
value.type = ORGANIZATION_TYPE;
});
handleDelete = (record) => {
const { intl } = this.props;
Modal.confirm({
className: 'c7n-iam-confirm-modal',
title: intl.formatMessage({ id: `${intlPrefix}.delete.title` }),
content: intl.formatMessage({ id: `${intlPrefix}.delete.content` }, { name: record.code }),
onOk: () => ExecutableProgramStore.deleteExecutableProgramById(record.id).then(({ failed, message }) => {
if (failed) {
Choerodon.prompt(message);
} else {
Choerodon.prompt(intl.formatMessage({ id: 'delete.success' }));
this.handleRefresh();
}
}),
});
};
handleDelete(record) {
const { intl } = this.props;
Modal.confirm({
className: 'c7n-iam-confirm-modal',
title: intl.formatMessage({ id: 'inmailtemplate.delete.owntitle' }),
content: intl.formatMessage({ id: 'inmailtemplate.delete.owncontent' }, {
name: record.name,
}),
onOk: () => {
InMailTemplateStore.deleteMailTemplate(record.id, this.mail.type, this.mail.orgId).then((data) => {
if (data.failed) {
Choerodon.prompt(data.message);
} else {
Choerodon.prompt(intl.formatMessage({ id: 'delete.success' }));
this.reload();
}
}).catch((error) => {
if (error) {
Choerodon.prompt(intl.formatMessage({ id: 'delete.error' }));
handleDelete = (record) => {
const { intl, AnnouncementStore } = this.props;
Modal.confirm({
className: 'c7n-iam-confirm-modal',
title: intl.formatMessage({ id: 'announcement.delete.title' }, { name: record.title }),
content: intl.formatMessage({ id: `announcement.delete.content${record.status === 'COMPLETED' ? '.send' : ''}` }),
onOk: () => AnnouncementStore.deleteAnnouncementById(record.id).then(({ failed, message }) => {
if (failed) {
Choerodon.prompt(message);
} else {
Choerodon.prompt(intl.formatMessage({ id: 'delete.success' }));
this.handleRefresh();
}
}),
});
};
handleAbort = () => {
const { intl, onAbort } = this.props;
Modal.confirm({
className: 'c7n-iam-confirm-modal',
title: intl.formatMessage({ id: `${intlPrefix}.abort.title` }),
content: intl.formatMessage({ id: `${intlPrefix}.abort.content` }),
onOk: () => axios.put(`iam/v1/organizations/${LDAPStore.ldapData.organizationId}/ldaps/${LDAPStore.ldapData.id}/stop`).then(({ failed, message }) => {
if (failed) {
Choerodon.prompt(message);
this.closeSyncSidebar();
} else {
Choerodon.prompt('终止成功');
this.closeSyncSidebar();
}
if (onAbort) {
onAbort();
}
}),
});