How to use @choerodon/master - 10 common examples

To help you get started, we’ve selected a few @choerodon/master 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 / test-manager-service / react / store / ExecuteDetailStore.js View on Github external
import {
  observable, action, computed, toJS,
} from 'mobx';
import { store } from '@choerodon/master';
import _ from 'lodash';
import { getParams } from '../common/utils';
import {
  getCycle, getCycleDetails, getCycleHistiorys,
} from '../api/ExecuteDetailApi';
import { getStatusList } from '../api/TestStatusApi';
import { getUsers } from '../api/IamApi';
import { getIssueList, getIssuesForDefects } from '../api/agileApi';

@store('ExecuteDetailStore')
class ExecuteDetailStore {
  @observable id = null;

  @observable issueList = [];

  @observable loading = false;

  @observable selectLoading = false;

  @observable ExecuteDetailSideVisible = true;

  @observable userList = [];

  // 用户列表
  @observable statusList = [];
github choerodon / devops-service / react / routes / app-service / app-list / modal / CreateForm.js View on Github external
async function selectFile(e) {
    const formdata = new FormData();
    const img = e.target.files[0];
    formdata.append('file', e.target.files[0]);
    try {
      const data = await axios.post(
        `/file/v1/files?bucket_name=devops-service&file_name=${img.name.split('.')[0]}`,
        formdata,
        {
          header: { 'Content-Type': 'multipart/form-data' },
        },
      );
      if (data) {
        record.set('imgUrl', data);
        getBase64(formdata.get('file'), (imgUrl) => {
          const ele = document.getElementById('img');
          ele.style.backgroundImage = `url(${imgUrl})`;
          setImgback(imgUrl);
        });
      }
    } catch (err) {
      // asfd
github choerodon / devops-service / react / routes / code-manager / stores / DevPipelineStore.js View on Github external
queryAppData = (projectId = AppState.currentMenuType.id, type, refersh, isReloadApp) => {
    // 已经加载过app数据 只更新对应模块的数据, 除非主动刷新 否则不查询app数据,
    if (!isReloadApp && this.appData.length !== 0 && type !== 'CodeManagerBranch') {
      refersh && refersh();
      return;
    }
    if (Number(this.preProId) !== Number(projectId)) {
      DeploymentPipelineStore.setProRole('app', '');
    }
    this.setAppData([]);
    this.setPreProId(projectId);
    this.setLoading(true);
    axios.get(`/devops/v1/projects/${projectId}/app_service/list_by_active`)
      .then((data) => {
        this.setLoading(false);
        if (handlePromptError(data)) {
          this.setAppData(data);
          if (data && data.length) {
            if (this.selectedApp) {
              if (_.filter(data, ['id', this.selectedApp]).length === 0) {
                this.setSelectApp(data[0].id);
              }
            } else {
              this.setSelectApp(data[0].id);
            }
            refersh && refersh();
          } else {
            this.setSelectApp(null);
          }
github choerodon / test-manager-service / react / routes / CustomStatus / CustomStatusIndex.js View on Github external
import React from 'react';
import { Route, Switch } from 'react-router-dom';
import { asyncRouter, nomatch } from '@choerodon/master';

const CustomStatusHome = asyncRouter(() => import('./CustomStatusHome'));

const CustomStatusIndex = ({ match }) => (
  
);

export default CustomStatusIndex;
github choerodon / test-manager-service / react / routes / AutoTest / AutoTestIndex.js View on Github external
import React from 'react';
import {
  Route,
  Switch,
} from 'react-router-dom';
import { asyncRouter, nomatch } from '@choerodon/master';

const CreateAutoTest = asyncRouter(() => (import('./CreateAutoTest')));
const AutoTestList = asyncRouter(() => import('./AutoTestList'));
const TestReport = asyncRouter(() => import('./TestReport'));
const TestIndex = ({ match }) => (
  
);
export default TestIndex;
github choerodon / test-manager-service / react / routes / AutoTest / AutoTestIndex.js View on Github external
import React from 'react';
import {
  Route,
  Switch,
} from 'react-router-dom';
import { asyncRouter, nomatch } from '@choerodon/master';

const CreateAutoTest = asyncRouter(() => (import('./CreateAutoTest')));
const AutoTestList = asyncRouter(() => import('./AutoTestList'));
const TestReport = asyncRouter(() => import('./TestReport'));
const TestIndex = ({ match }) => (
  
);
export default TestIndex;
github choerodon / test-manager-service / react / routes / AutoTest / AutoTestIndex.js View on Github external
import React from 'react';
import {
  Route,
  Switch,
} from 'react-router-dom';
import { asyncRouter, nomatch } from '@choerodon/master';

const CreateAutoTest = asyncRouter(() => (import('./CreateAutoTest')));
const AutoTestList = asyncRouter(() => import('./AutoTestList'));
const TestReport = asyncRouter(() => import('./TestReport'));
const TestIndex = ({ match }) => (
  
);
export default TestIndex;
github choerodon / devops-service / react / routes / app-service / stores / ListDataSet.js View on Github external
async function checkCode(value) {
    const pa = /^[a-z]([-a-z0-9]*[a-z0-9])?$/;
    if (value && pa.test(value)) {
      try {
        const res = await axios.get(`/devops/v1/projects/${projectId}/app_service/check_code?code=${value}`);
        if (res && res.failed) {
          return formatMessage({ id: 'checkCodeExist' });
        } else {
          return true;
        }
      } catch (err) {
        return formatMessage({ id: 'checkCodeFailed' });
      }
    } else {
      return formatMessage({ id: 'checkCodeReg' });
    }
  }
github choerodon / devops-service / react / routes / resource / main-view / stores / useCustomStore.js View on Github external
async loadSingleData(projectId, id) {
      try {
        const res = await axios.get(`/devops/v1/projects/${projectId}/customize_resource/${id}`);
        if (handlePromptError(res)) {
          this.setSingleData(res);
        }
      } catch (e) {
        Choerodon.handleResponseError(e);
      }
    },
github choerodon / manager-service / react / src / app / iam / containers / global / instance / Instance.js View on Github external
page: current,
      size: pageSize,
      instanceId,
      version,
      params,
      service: serviceName,
    };
    if (columnKey) {
      const sorter = [];
      sorter.push(columnKey);
      if (order === 'asc') {
        sorter.push('asc');
      }
      queryObj.sort = sorter.join(',');
    }
    return axios.get(`/manager/v1/instances?${querystring.stringify(queryObj)}`);
  }

@choerodon/master

A package of Master for Choerodon platform.

ISC
Latest version published 2 years ago

Package Health Score

43 / 100
Full package analysis