super(serverApi, resourceType, actions, readOnlyFields.concat([
'uuid',
'etag',
- 'kind'
+ 'kind',
+ 'canWrite',
+ 'canManage',
+ 'createdAt',
+ 'modifiedAt',
+ 'modifiedByClientUuid',
+ 'modifiedByUserUuid'
]));
}
create(data?: Partial<T>, showErrors?: boolean) {
let payload: any;
if (data !== undefined) {
- this.readOnlyFields.forEach( field => delete data[field] );
+ this.readOnlyFields.forEach(field => delete data[field]);
payload = {
[this.resourceType.slice(0, -1)]: CommonService.mapKeys(snakeCase)(data),
};
update(uuid: string, data: Partial<T>, showErrors?: boolean, select?: string[]) {
let payload: any;
if (data !== undefined) {
- this.readOnlyFields.forEach( field => delete data[field] );
+ this.readOnlyFields.forEach(field => delete data[field]);
payload = {
[this.resourceType.slice(0, -1)]: CommonService.mapKeys(snakeCase)(data),
};
import { RootState } from 'store/store';
import { progressIndicatorActions } from "store/progress-indicator/progress-indicator-actions";
import { WORKBENCH_LOADING_SCREEN } from 'store/workbench/workbench-actions';
+import { navigateToMyAccount } from 'store/navigation/navigation-action';
export const authMiddleware = (services: ServiceRepository): Middleware => store => next => action => {
// Middleware to update external state (local storage, window
}
store.dispatch<any>(initSessions(services.authService, state.auth.remoteHostsConfig[state.auth.localCluster], user));
+ if (Object.keys(state.auth.config.clusterConfig.Workbench.UserProfileFormFields).length > 0 &&
+ user.isActive &&
+ (Object.keys(user.prefs).length === 0 ||
+ user.prefs.profile === undefined ||
+ Object.keys(user.prefs.profile!).length === 0)) {
+ // If the user doesn't have a profile set, send them
+ // to the user profile page to encourage them to fill it out.
+ store.dispatch(navigateToMyAccount);
+ }
if (!user.isActive) {
// As a special case, if the user is inactive, they
// may be able to self-activate using the "activate"