AW-6756 Settingsknop Explorer dezelfde kleur als het logo van de explorer.
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Peter (extern) 2025-03-24 09:13:47 +01:00
parent 2ca9730735
commit a46e8040b2
6 changed files with 24 additions and 7 deletions

View File

@ -85,6 +85,9 @@ export const SETUNREADNOTIFICATIONS = '[AppCommon] SetUnreadNotifications';
export const SWITCHLANGUAGE = '[AppCommon] SwitchLanguage'; export const SWITCHLANGUAGE = '[AppCommon] SwitchLanguage';
export const SETSETTINGMENUBACKGROUNDCOLOR = '[AppCommon] SetSettingMenuBackgroundColor';
export class InitUser implements Action { export class InitUser implements Action {
readonly type = INITUSER; readonly type = INITUSER;
@ -379,6 +382,11 @@ export class SwitchLanguage implements Action {
constructor(public locale:string) { } constructor(public locale:string) { }
} }
export class SetSettingMenuBackgroundColor implements Action {
readonly type = SETSETTINGMENUBACKGROUNDCOLOR;
constructor(public color:string) { }
}
export type Actions = OpenModal export type Actions = OpenModal
| InitRoot | InitRoot
@ -427,6 +435,7 @@ export type Actions = OpenModal
| ToggleSettingMenu | ToggleSettingMenu
| NotificationEvent | NotificationEvent
| SetUnreadNotifications | SetUnreadNotifications
| SwitchLanguage; | SwitchLanguage
| SetSettingMenuBackgroundColor;

View File

@ -33,7 +33,7 @@
<fm-resumable-file-upload></fm-resumable-file-upload> <fm-resumable-file-upload></fm-resumable-file-upload>
</ng-container> </ng-container>
<div class="user-menu apponly"> <div class="user-menu apponly">
<fm-setting-menu [user]="user|async" [showMenu]="settingMenuVisible|async"></fm-setting-menu> <fm-setting-menu [user]="user|async" [showMenu]="settingMenuVisible|async" [backgroundColor]="settingMenuBackgroundColor|async"></fm-setting-menu>
<fm-help-menu [user]="user|async" [showMenu]="helpMenuVisible|async"></fm-help-menu> <fm-help-menu [user]="user|async" [showMenu]="helpMenuVisible|async"></fm-help-menu>
<fm-notification-menu [user]="user|async" [unread]="unreadNotifications|async" [showMenu]="notificationMenuVisible|async"></fm-notification-menu> <fm-notification-menu [user]="user|async" [unread]="unreadNotifications|async" [showMenu]="notificationMenuVisible|async"></fm-notification-menu>
<fm-app-menu [user]="user|async" [showMenu]="appMenuVisible|async"></fm-app-menu> <fm-app-menu [user]="user|async" [showMenu]="appMenuVisible|async"></fm-app-menu>

View File

@ -50,6 +50,7 @@ export class AppComponent implements OnInit, OnDestroy {
public unreadNotifications: Observable<number> = this.store$.select(appReducers.SelectgetUnreadNotifications); public unreadNotifications: Observable<number> = this.store$.select(appReducers.SelectgetUnreadNotifications);
public user: Observable<IUser> = this.store$.select(appReducers.SelectGetUser); public user: Observable<IUser> = this.store$.select(appReducers.SelectGetUser);
public isPageMode: Observable<boolean> = this.store$.select(appReducers.SelectGetIsPageMode); public isPageMode: Observable<boolean> = this.store$.select(appReducers.SelectGetIsPageMode);
public settingMenuBackgroundColor: Observable<string> = this.store$.select(appReducers.SelectGetSettingMenuBackgroundColor);
@Input() showUploadProgress = true; @Input() showUploadProgress = true;
constructor( constructor(

View File

@ -1,5 +1,5 @@
<div> <div>
<div (click)="toggle($event)" class="rounded-circle menu-button hidden" [ngClass]="{'hidden':!user || noContent}"> <div (click)="toggle($event)" class="rounded-circle menu-button hidden" [style.background-color]="backgroundColor" [ngClass]="{'hidden':!user || noContent}">
<span i18n-title title="Settings"><i class="fas fa-gear" aria-hidden="true"></i></span> <span i18n-title title="Settings"><i class="fas fa-gear" aria-hidden="true"></i></span>
<div class="menu hidden" [ngClass]="{'hidden':!showMenu}"> <div class="menu hidden" [ngClass]="{'hidden':!showMenu}">
<router-outlet name="setting-menu" (activate)="activateRoute()" (deactivate)="deActivateRoute()"></router-outlet> <router-outlet name="setting-menu" (activate)="activateRoute()" (deactivate)="deActivateRoute()"></router-outlet>

View File

@ -15,6 +15,7 @@ export class SettingMenuComponent implements OnInit {
@Input() user:IUser; @Input() user:IUser;
@Input() showMenu:boolean; @Input() showMenu:boolean;
@Input() backgroundColor:string;
public noContent = true; public noContent = true;
constructor(private store: Store<appReducers.State>) { } constructor(private store: Store<appReducers.State>) { }

View File

@ -29,7 +29,8 @@ export interface State {
settingMenuVisible: boolean, settingMenuVisible: boolean,
unreadNotifications: number, unreadNotifications: number,
isOnline: boolean, isOnline: boolean,
isPageMode:boolean isPageMode:boolean,
settingMenuBackgroundColor:string
} }
export const initialState: State = { export const initialState: State = {
@ -51,7 +52,8 @@ export const initialState: State = {
settingMenuVisible: false, settingMenuVisible: false,
unreadNotifications: 0, unreadNotifications: 0,
isOnline: true, isOnline: true,
isPageMode: true isPageMode: true,
settingMenuBackgroundColor:'rgb(128, 128, 128)'
} }
export function reducer(state = initialState, action: appCommonActions.Actions ): State { export function reducer(state = initialState, action: appCommonActions.Actions ): State {
@ -187,6 +189,10 @@ export function reducer(state = initialState, action: appCommonActions.Actions )
const a = action as appCommonActions.SetUnreadNotifications; const a = action as appCommonActions.SetUnreadNotifications;
return tassign(state,{unreadNotifications:a.unread}); return tassign(state,{unreadNotifications:a.unread});
} }
case appCommonActions.SETSETTINGMENUBACKGROUNDCOLOR: {
const a = action as appCommonActions.SetSettingMenuBackgroundColor;
return tassign(state,{settingMenuBackgroundColor:a.color});
}
default: { default: {
return state; return state;
} }
@ -212,6 +218,7 @@ export const getSettingMenuVisible = (state: State) => state.settingMenuVisible;
export const getUnreadNotifications = (state: State) => state.unreadNotifications; export const getUnreadNotifications = (state: State) => state.unreadNotifications;
export const getIsOnline = (state: State) => state.isOnline; export const getIsOnline = (state: State) => state.isOnline;
export const getIsPageMode = (state: State) => state.isPageMode; export const getIsPageMode = (state: State) => state.isPageMode;
export const getSettingMenuBackgroundColor = (state: State) => state.settingMenuBackgroundColor;
export const selectAppCommonState = createFeatureSelector<State>(MODULE_NAME); export const selectAppCommonState = createFeatureSelector<State>(MODULE_NAME);
@ -238,5 +245,4 @@ export const SelectgetUnreadNotifications = createSelector(selectAppCommonState,
export const SelectGetIsOnline = createSelector(selectAppCommonState,getIsOnline); export const SelectGetIsOnline = createSelector(selectAppCommonState,getIsOnline);
export const SelectGetIsPageMode = createSelector(selectAppCommonState,getIsPageMode); export const SelectGetIsPageMode = createSelector(selectAppCommonState,getIsPageMode);
export const SelectGetSettingMenuBackgroundColor= createSelector(selectAppCommonState,getSettingMenuBackgroundColor);