Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleClickTotalCard = (label, type) => {
label = `${label}`.toLocaleLowerCase();
const guessRoute = routes.portal[type][label] || routes.portal[label];
this.props.history.push(toRoute(guessRoute));
};
<ul>
<li>
<span>{t('Status')}</span>
</li>
<li>
<span>{t('App')}</span>
<label>
<label>
<img src="{app.icon}">
</label>
{app.name}
</label>
</li>
<li>
<span>{t('Version')}</span>
<label>
<span>{version.name}</span>
</label>
</li>
<li>
<span>{t('Runtime')}</span>
</li></ul>
handleSubmit = async (e, params) => {
const { store, user } = this.props;
const res = await store.oauth2Check(params);
if (res && res.user) {
await store.fetchDetail(res.user.sub, true);
}
const defaultUrl = toRoute(routes.portal.apps, user.defaultPortal);
if (!(res && res.err)) {
location.href = getUrlParam('redirect_url') || defaultUrl;
} else {
this.setState({
hasError: true,
showInputError: true
});
}
};
const res = await create({
app_id: appId,
version_id: versionId,
runtime_id: runtimeId,
conf: conf.replace(/>>>>>>/g, '.')
});
if (res && _.get(res, 'cluster_id')) {
appDeployStore.success(t('Deploy app successfully'));
const path = user.isDevPortal || user.isISVPortal
? toRoute(routes.portal._dev.sandboxInstances, {
portal: 'dev',
appId
})
: toRoute(routes.portal.clusters);
setTimeout(() => history.push(path), 1000);
}
};