How to use the choerodon-ui.Modal.confirm function in choerodon-ui

To help you get started, we’ve selected a few choerodon-ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github choerodon / iam-service / react / src / app / iam / containers / global / configuration / Configuration.js View on Github external
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();
          }
        });
      },
    });
  }
github choerodon / iam-service / iam-service / react / src / iam / containers / global / executable-program / ExecutableProgram.js View on Github external
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();
        }
      }),
    });
  };
github choerodon / choerodon-front-iam / iam / src / app / iam / containers / global / task-detail / TaskDetail.js View on Github external
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' }));
      }),
    });
  }
github choerodon / choerodon-front-iam / iam / src / app / iam / containers / global / root-user / RootUser.js View on Github external
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();
        }
      }),
    });
  }
github choerodon / choerodon-front-iam / iam / src / app / iam / containers / global / mail-template / MailTemplate.js View on Github external
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' }));
github choerodon / iam-service / react / src / app / iam / containers / project / project-setting / ProjectSetting.js View on Github external
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;
            });
github choerodon / choerodon-front-iam / iam / src / app / iam / containers / global / executable-program / ExecutableProgram.js View on Github external
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();
        }
      }),
    });
  };
github choerodon / choerodon-front-iam / iam / src / app / iam / containers / global / inmail-template / InMailTemplate.js View on Github external
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' }));
github choerodon / iam-service / iam-service / react / src / iam / containers / global / announcement / Announcement.js View on Github external
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();
        }
      }),
    });
  };
github choerodon / iam-service / react / src / app / iam / containers / organization / ldap / TestLdap.js View on Github external
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();
        }
      }),
    });