Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
loadAppData = projectId =>
axios.post(`/devops/v1/projects/${projectId}/apps/list_by_options?active=true&type=normal&doPage=false&has_version=true`
, JSON.stringify({searchParam: {}, param: ""})
)
.then((data) => {
const res = handleProptError(data);
if (res) {
this.setAppDate(data.content);
}
return res;
});
loadApps = (projectId, page = 0, size = 20, sorter = { id: 'asc' }, datas = {
searchParam: {},
param: '',
}) => axios.post(`devops/v1/projects/${projectId}/apps_market/list_all?page=${page}&size=${size}`, JSON.stringify(datas))
.then((data) => {
this.changeLoading(true);
if (data && data.failed) {
Choerodon.prompt(data.message);
} else {
this.handleData(data);
this.changeLoading(false);
}
})
.catch((error) => {
Choerodon.prompt(error.message);
});
queryBranchData = ({ projectId, sorter = { field: 'createDate', order: 'asc' }, postData = { searchParam: {}, param: '' }, size = 3 }) => {
axios.post(`/devops/v1/projects/${projectId}/apps/${DevPipelineStore.selectedApp}/git/branches?page=0&size=${size}`, JSON.stringify(postData)).then((data) => {
const result = handleProptError(data);
if (result) {
this.setBranchData(result);
}
}).catch(err => Choerodon.handleResponseError(err));
};
submitDeployment(projectId, applicationDeployDTO) {
return axios
.post(`/devops/v1/projects/${projectId}/app_instances`, JSON.stringify(applicationDeployDTO))
.then(data => handleProptError(data));
}
loadTagData = (projectId, page = 0, sizes = 10, postData = { searchParam: {}, param: '' }) => axios.post(`/devops/v1/projects/${projectId}/apps/${DevPipelineStore.selectedApp}/git/tags_list_options?page=0&size=${sizes}`, JSON.stringify(postData))
.then((data) => {
const res = handleProptError(data);
if (res) {
this.setTagData(data);
}
});
loadData() {
const { projectId } = AppState.currentMenuType;
axios.get(`agile/v1/projects/${projectId}/product_version/versions`)
.then((res) => {
const latestVersionId = Math.max(...res.filter(item => item.statusCode !== 'archived').map((item => item.versionId)));
if (latestVersionId !== -Infinity) {
this.loadSelectData(latestVersionId);
}
this.setState({
versionList: res.filter(item => item.statusCode !== 'archived'),
currentVersionId: latestVersionId,
loading: false,
});
});
}
loadData() {
const projectId = AppState.currentMenuType.id;
const orgId = AppState.currentMenuType.organizationId;
axios.get(`agile/v1/projects/${projectId}/sprint/active/${orgId}`)
.then((res) => {
this.setState({
sprint: res,
loading: false,
});
});
}
loadData() {
const projectId = AppState.currentMenuType.id;
const userId = AppState.getUserId;
this.setState({ loading: true });
axios.get(`/agile/v1/projects/${projectId}/issues/unfinished/${userId}`)
.then((res) => {
this.setState({
issues: res,
loading: false,
});
});
}
loadPriorityInfo() {
this.setState({ loading: true });
const projectId = AppState.currentMenuType.id;
const orgId = AppState.currentMenuType.organizationId;
axios.get(`agile/v1/projects/${projectId}/reports/issue_priority_distribution_chart?organizationId=${orgId}`)
.then((res) => {
this.setState({
priorityInfo: res,
loading: false,
});
});
}
loadEpics() {
const projectId = AppState.currentMenuType.id;
const orgId = AppState.currentMenuType.organizationId;
axios.get(`/agile/v1/projects/${projectId}/issues/epics?organizationId=${orgId}`)
.then((res) => {
this.handleEpics(res.slice(0, 6));
});
}