import BaseForm from 'components/Form';
import { getPath } from 'utils/route-map';
export default class FormAction extends BaseForm {
static id = 'formAction';
static actionType = 'link';
static title = 'form';
static buttonType = 'primary';
static isDanger = false;
static path = '/';
static policy = '';
static aliasPolicy = '';
static allowed() {
return Promise.resolve();
}
get isAdminPage() {
return this.props.isAdminPage || false;
}
getRouteName(routeName) {
return this.isAdminPage ? `${routeName}Admin` : routeName;
}
getRoutePath(routeName, params = {}, query = {}) {
const realName = this.getRouteName(routeName);
return getPath({ key: realName, params, query });
}
}