Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render: (_, record) => (
<div>
{i18n('common.view')}
{this.props.hasPermissionToEditRecord(record) && (
{i18n('common.edit')}
)}
{this.props.hasPermissionToDestroy && (
this.doDestroy(record.id)}
okText={i18n('common.yes')}
cancelText={i18n('common.no')}
>
{i18n('common.destroy')}
)}
</div>
),
},
render() {
return (
{this.props.hasPermissionToCreate && (
<button type="primary">
{i18n('common.new')}
</button>
)}
{this.props.hasPermissionToImport && (
<button type="primary">
{i18n('common.import')}
</button>
)}
{this.renderRemoveButton()}
{this.renderEnableButton()}
{this.renderDisableButton()}
{this.props.hasPermissionToAuditLogs && (
<button>
{i18n('auditLog.menu')}
</button>
)}
doSendEmailConfirmation: () => async (
dispatch,
getState,
) => {
try {
dispatch({ type: actions.EMAIL_CONFIRMATION_START });
await service.sendEmailVerification(
selectors.selectAuthenticationUser(getState()),
);
Message.success(
i18n('auth.verificationEmailSuccess'),
);
dispatch({
type: actions.EMAIL_CONFIRMATION_SUCCESS,
});
} catch (error) {
Errors.handle(error);
dispatch({ type: actions.EMAIL_CONFIRMATION_ERROR });
}
},
>
<button type="primary" loading="{saveLoading}">
{i18n('common.save')}
</button>
<button disabled="{saveLoading}">
{i18n('common.reset')}
</button>
);
}}
/>
)}`}
>
<button>
{i18n('auditLog.menu')}
</button>
)}
{user && user.email && hasPermissionToAuditLogs && (
<button>
{i18n('iam.view.activity')}
</button>
)}
);
}
}
const disabled = !selectedKeys.length || loading;
const button = (
<button type="primary" disabled="{disabled}">
{i18n('iam.disable')}
</button>
);
if (disabled) {
return (
{button}
);
}
return button;
}
{
path: '/settings',
icon: 'setting',
label: i18n('settings.menu'),
loader: () => import('view/settings/SettingsFormPage'),
permissionRequired: permissions.settingsEdit,
menu: true,
},
{
path: '/pet',
loader: () => import('view/pet/list/PetListPage'),
permissionRequired: permissions.petRead,
exact: true,
icon: 'github',
label: i18n('entities.pet.menu'),
menu: true,
},
{
path: '/pet/new',
loader: () => import('view/pet/form/PetFormPage'),
menu: false,
permissionRequired: permissions.petCreate,
exact: true,
},
{
path: '/pet/importer',
loader: () =>
import('view/pet/importer/PetImporterPage'),
menu: false,
permissionRequired: permissions.petImport,
exact: true,
match,
user,
hasPermissionToEditRecord,
hasPermissionToAuditLogs,
hasPermissionToChangeStatus,
loading,
} = this.props;
const id = match.params.id;
return (
{hasPermissionToEditRecord(user) && (
<button type="primary">
{i18n('common.edit')}
</button>
)}
{user && hasPermissionToChangeStatus && (
this.doToggleStatus()}
okText={i18n('common.yes')}
cancelText={i18n('common.no')}
>
<button disabled="{loading}" type="primary"></button>
icon="delete"
disabled={destroyLoading}
>
{i18n('common.destroy')}
)}
{hasPermissionToAuditLogs && (
<button>
{i18n('auditLog.menu')}
</button>
)}
);
}
}
render: (_, record) => (
<div>
{i18n('common.view')}
{this.props.hasPermissionToEdit && (
{i18n('common.edit')}
)}
{this.props.hasPermissionToDestroy && (
this.doDestroy(record.id)}
okText={i18n('common.yes')}
cancelText={i18n('common.no')}
>
{i18n('common.destroy')}
)}
</div>
),
},