If UserProfileFormFields is non-empty, and the user's prefs.profile is
empty, wb2 will navigate to the user account page to encourage people
to fill out the profile. Unlike wb1, filling it out is not mandatory.
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>
SiteName: string;
IdleTimeout: string;
BannerUUID: string;
SiteName: string;
IdleTimeout: string;
BannerUUID: string;
+ UserProfileFormFields: {};
};
Login: {
LoginCluster: string;
};
Login: {
LoginCluster: string;
SSHHelpHostSuffix: '',
SiteName: '',
IdleTimeout: '0s',
SSHHelpHostSuffix: '',
SiteName: '',
IdleTimeout: '0s',
+ BannerUUID: "",
+ UserProfileFormFields: {}
},
Login: {
LoginCluster: '',
},
Login: {
LoginCluster: '',
super(serverApi, resourceType, actions, readOnlyFields.concat([
'uuid',
'etag',
super(serverApi, resourceType, actions, readOnlyFields.concat([
'uuid',
'etag',
+ 'kind',
+ 'canWrite',
+ 'canManage',
+ 'createdAt',
+ 'modifiedAt',
+ 'modifiedByClientUuid',
+ 'modifiedByUserUuid'
]));
}
create(data?: Partial<T>, showErrors?: boolean) {
let payload: any;
if (data !== undefined) {
]));
}
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),
};
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) {
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),
};
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 { 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
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));
}
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"
if (!user.isActive) {
// As a special case, if the user is inactive, they
// may be able to self-activate using the "activate"