From 03a1ccd597d77aa915a344c8006b1f01fbe084c4 Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Mon, 14 Oct 2024 12:15:46 +0200 Subject: [PATCH 01/10] AW-6410 Add settings menu --- .../src/fm/actions/app-common.actions.ts | 9 ++ projects/common/src/fm/common.module.ts | 2 + .../src/fm/components/app/app.component.html | 1 + .../src/fm/components/app/app.component.scss | 2 +- .../src/fm/components/app/app.component.ts | 1 + .../settings-menu.component.html | 8 ++ .../settings-menu.component.scss | 90 +++++++++++++++++++ .../settings-menu/settings-menu.component.ts | 37 ++++++++ .../src/fm/reducers/app-common.reducer.ts | 21 +++-- 9 files changed, 163 insertions(+), 8 deletions(-) create mode 100644 projects/common/src/fm/components/settings-menu/settings-menu.component.html create mode 100644 projects/common/src/fm/components/settings-menu/settings-menu.component.scss create mode 100644 projects/common/src/fm/components/settings-menu/settings-menu.component.ts diff --git a/projects/common/src/fm/actions/app-common.actions.ts b/projects/common/src/fm/actions/app-common.actions.ts index 2c21045..d4c176a 100644 --- a/projects/common/src/fm/actions/app-common.actions.ts +++ b/projects/common/src/fm/actions/app-common.actions.ts @@ -71,6 +71,8 @@ export const TOGGLENOTIFICATIONMENU = '[AppCommon] ToggleNotificationMenu'; export const TOGGLEHELPMENU = '[AppCommon] ToggleHelpMenu'; +export const TOGGLESETTINGSMENU = '[AppCommon] ToggleSettingsMenu'; + export const SETMENUVISIBLE = '[AppCommon] SetMenuVisible'; export const ONLINE = '[AppCommon] Online'; @@ -332,6 +334,12 @@ export class ToggleHelpMenu implements Action { constructor() { } } +export class ToggleSettingsMenu implements Action { + readonly type = TOGGLESETTINGSMENU; + + constructor() { } +} + export class SetMenuVisible implements Action { readonly type = SETMENUVISIBLE; @@ -408,6 +416,7 @@ export type Actions = OpenModal | ToggleAppMenu | ToggleNotificationMenu | ToggleHelpMenu + | ToggleSettingsMenu | NotificationEvent | SetUnreadNotifications; diff --git a/projects/common/src/fm/common.module.ts b/projects/common/src/fm/common.module.ts index dbec468..ab501a9 100644 --- a/projects/common/src/fm/common.module.ts +++ b/projects/common/src/fm/common.module.ts @@ -34,6 +34,7 @@ import { HasClaimDirective } from './components/has-claim/has-claim.directive'; import { HasPackageDirective } from './components/has-package/has-package.directive'; import { HasRoleDirective } from './components/has-role/has-role.directive'; import { HelpMenuComponent } from './components/help-menu/help-menu.component'; +import { SettingsMenuComponent } from './components/settings-menu/settings-menu.component'; import { ItemLinkComponent } from './components/item-link/item-link.component'; import { MenuBackgroundComponent } from './components/menu-background/menu-background.component'; import { NotFoundComponent } from './components/not-found/not-found.component'; @@ -104,6 +105,7 @@ export { AppMenuComponent, NotificationMenuComponent, HelpMenuComponent, + SettingsMenuComponent, BackButtonComponent, ThumbnailComponent, EditImageModalComponent, diff --git a/projects/common/src/fm/components/app/app.component.html b/projects/common/src/fm/components/app/app.component.html index 388ccd8..538026d 100644 --- a/projects/common/src/fm/components/app/app.component.html +++ b/projects/common/src/fm/components/app/app.component.html @@ -34,6 +34,7 @@
+ diff --git a/projects/common/src/fm/components/app/app.component.scss b/projects/common/src/fm/components/app/app.component.scss index 14da6dd..53c5b3a 100644 --- a/projects/common/src/fm/components/app/app.component.scss +++ b/projects/common/src/fm/components/app/app.component.scss @@ -119,7 +119,7 @@ body { background: #f1f1f1; line-height: 18px; user-select:none;font-family: Lat max-height:0em; } -fm-help-menu,fm-app-menu,fm-user-menu,fm-notification-menu { +fm-help-menu,fm-app-menu,fm-user-menu,fm-notification-menu,fm-settings-menu { display: inline-block; margin-left: 1rem; } diff --git a/projects/common/src/fm/components/app/app.component.ts b/projects/common/src/fm/components/app/app.component.ts index c754312..3d7dcae 100644 --- a/projects/common/src/fm/components/app/app.component.ts +++ b/projects/common/src/fm/components/app/app.component.ts @@ -45,6 +45,7 @@ export class AppComponent implements OnInit, OnDestroy { public accountMenuVisible: Observable = this.store$.select(appReducers.SelectGetAccountMenuVisible); public appMenuVisible: Observable = this.store$.select(appReducers.SelectGetAppMenuVisible); public notificationMenuVisible: Observable = this.store$.select(appReducers.SelectGetNotificationMenuVisible); + public settingsMenuVisible: Observable = this.store$.select(appReducers.SelectGetHelpMenuVisible); public helpMenuVisible: Observable = this.store$.select(appReducers.SelectGetHelpMenuVisible); public unreadNotifications: Observable = this.store$.select(appReducers.SelectgetUnreadNotifications); public user: Observable = this.store$.select(appReducers.SelectGetUser); diff --git a/projects/common/src/fm/components/settings-menu/settings-menu.component.html b/projects/common/src/fm/components/settings-menu/settings-menu.component.html new file mode 100644 index 0000000..820a737 --- /dev/null +++ b/projects/common/src/fm/components/settings-menu/settings-menu.component.html @@ -0,0 +1,8 @@ +
+ +
\ No newline at end of file diff --git a/projects/common/src/fm/components/settings-menu/settings-menu.component.scss b/projects/common/src/fm/components/settings-menu/settings-menu.component.scss new file mode 100644 index 0000000..94b425b --- /dev/null +++ b/projects/common/src/fm/components/settings-menu/settings-menu.component.scss @@ -0,0 +1,90 @@ +.menu-button { + background-color: gray; + display: inline-block; + width: 2.5em; + height: 2.5em; + line-height: 2.5em; + text-align: center; + font-size: 1rem; + position: relative; +} + +div.menu-button > span { + color:white; +} + +.menu { + max-height: calc( 100vh - 4rem); + //transition: max-height 0.2s; + overflow: hidden; + box-shadow: 0 0 20px rgba(0,0,0,.3); + position: fixed; + top: 3.4rem; + right:0.5rem; + left:0.5rem; + background-color: #fff; + border-radius: 0.25rem; + padding: 0.5rem; + z-index: 3; +} + +:host-context(.fullscreen) .menu { + top:4em; +} + +.card { + padding:0.5rem; + min-width: 10rem; +} + +.card-body { + text-align: left; +} + +.hidden { + max-height: 0; +} + +.menu.hidden { + padding: 0; +} + +.menu-button.hidden { + overflow: hidden; +} + + +@media screen and (min-width: 44rem) { + .menu { + position: absolute; + top: 3rem; + right:0; + left: unset; + max-width: 30em; + } + + :host-context(.fullscreen) .menu { + top: 3rem; + } +} + +.mobile-hide { + display: inherit; +} + +@media screen and (max-width: 768px) { + .mobile-hide { + display: none; + } +} + +.unread { + display: block; + position: absolute; + top:-0.5em; + right: -0.5em; +} + +.unread.hidden { + display: none; +} \ No newline at end of file diff --git a/projects/common/src/fm/components/settings-menu/settings-menu.component.ts b/projects/common/src/fm/components/settings-menu/settings-menu.component.ts new file mode 100644 index 0000000..b89cd20 --- /dev/null +++ b/projects/common/src/fm/components/settings-menu/settings-menu.component.ts @@ -0,0 +1,37 @@ +import { Input } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; + +import { IUser } from '../../models/user'; +import {Store} from '@ngrx/store'; +import * as appReducers from '../../reducers/app-common.reducer'; +import * as appActions from '../../actions/app-common.actions'; + +@Component({ + selector: 'fm-settings-menu', + templateUrl: './settings-menu.component.html', + styleUrls: ['./settings-menu.component.scss'] +}) +export class SettingsMenuComponent implements OnInit { + + @Input() user:IUser; + @Input() showMenu:boolean; + public noContent = true; + + constructor(private store: Store) { } + + ngOnInit(): void { + } + + toggle(event:MouseEvent) { + event.stopPropagation(); + this.store.dispatch(new appActions.ToggleSettingsMenu()); + } + + activateRoute() { + this.noContent=false; + } + + deActivateRoute() { + this.noContent=true; + } +} diff --git a/projects/common/src/fm/reducers/app-common.reducer.ts b/projects/common/src/fm/reducers/app-common.reducer.ts index d28cb9a..d9429c0 100644 --- a/projects/common/src/fm/reducers/app-common.reducer.ts +++ b/projects/common/src/fm/reducers/app-common.reducer.ts @@ -26,6 +26,7 @@ export interface State { appMenuVisible: boolean, notificationMenuVisible: boolean, helpMenuVisible: boolean, + settingsMenuVisible: boolean, unreadNotifications: number, isOnline: boolean, isPageMode:boolean @@ -47,6 +48,7 @@ export const initialState: State = { appMenuVisible: false, notificationMenuVisible: false, helpMenuVisible: false, + settingsMenuVisible: false, unreadNotifications: 0, isOnline: true, isPageMode: true @@ -106,26 +108,29 @@ export function reducer(state = initialState, action: appCommonActions.Actions ) }); } case appCommonActions.TOGGLEMENU: { - return tassign(state, { menuVisible: !state.menuVisible,accountMenuVisible:!state.menuVisible?false:state.accountMenuVisible,appMenuVisible:!state.menuVisible?false:state.appMenuVisible,notificationMenuVisible:!state.menuVisible?false:state.notificationMenuVisible,helpMenuVisible:!state.menuVisible?false:state.helpMenuVisible }); + return tassign(state, { menuVisible: !state.menuVisible,accountMenuVisible:!state.menuVisible?false:state.accountMenuVisible,appMenuVisible:!state.menuVisible?false:state.appMenuVisible,notificationMenuVisible:!state.menuVisible?false:state.notificationMenuVisible,helpMenuVisible:!state.menuVisible?false:state.helpMenuVisible,settingsMenuVisible:!state.menuVisible?false:state.settingsMenuVisible }); } case appCommonActions.TOGGLEACCOUNTMENU: { - return tassign(state, { accountMenuVisible: !state.accountMenuVisible,appMenuVisible:false,notificationMenuVisible:false,helpMenuVisible:false }); + return tassign(state, { accountMenuVisible: !state.accountMenuVisible,appMenuVisible:false,notificationMenuVisible:false,helpMenuVisible:false,settingsMenuVisible:false }); } case appCommonActions.TOGGLEAPPMENU: { - return tassign(state, { appMenuVisible: !state.appMenuVisible,accountMenuVisible:false,notificationMenuVisible:false,helpMenuVisible:false }); + return tassign(state, { appMenuVisible: !state.appMenuVisible,accountMenuVisible:false,notificationMenuVisible:false,helpMenuVisible:false,settingsMenuVisible:false }); } case appCommonActions.TOGGLENOTIFICATIONMENU: { - return tassign(state, { notificationMenuVisible : !state.notificationMenuVisible,accountMenuVisible:false,appMenuVisible:false,helpMenuVisible:false }); + return tassign(state, { notificationMenuVisible : !state.notificationMenuVisible,accountMenuVisible:false,appMenuVisible:false,helpMenuVisible:false,settingsMenuVisible:false }); } case appCommonActions.TOGGLEHELPMENU: { - return tassign(state, { helpMenuVisible : !state.helpMenuVisible,accountMenuVisible:false,appMenuVisible:false,notificationMenuVisible:false }); + return tassign(state, { helpMenuVisible : !state.helpMenuVisible,accountMenuVisible:false,appMenuVisible:false,notificationMenuVisible:false,settingsMenuVisible:false }); + } + case appCommonActions.TOGGLESETTINGSMENU: { + return tassign(state, { settingsMenuVisible : !state.settingsMenuVisible,accountMenuVisible:false,appMenuVisible:false,notificationMenuVisible:false,helpMenuVisible:false }); } case appCommonActions.ESCAPE: { - return tassign(state, { menuVisible: false,accountMenuVisible:false,appMenuVisible: false,notificationMenuVisible:false,helpMenuVisible:false }); + return tassign(state, { menuVisible: false,accountMenuVisible:false,appMenuVisible: false,notificationMenuVisible:false,helpMenuVisible:false,settingsMenuVisible:false }); } case appCommonActions.SETMENUVISIBLE: { const a = action as appCommonActions.SetMenuVisible; - return tassign(state, { menuVisible: a.visible,accountMenuVisible:a.visible?false:state.accountMenuVisible,appMenuVisible:a.visible?false:state.appMenuVisible,notificationMenuVisible:a.visible?false:state.notificationMenuVisible,helpMenuVisible:a.visible?false:state.helpMenuVisible }); + return tassign(state, { menuVisible: a.visible,accountMenuVisible:a.visible?false:state.accountMenuVisible,appMenuVisible:a.visible?false:state.appMenuVisible,notificationMenuVisible:a.visible?false:state.notificationMenuVisible,helpMenuVisible:a.visible?false:state.helpMenuVisible,settingsMenuVisible:a.visible?false:state.settingsMenuVisible }); } case appCommonActions.INITUSERPACKAGESSUCCESS:{ const a = action as appCommonActions.InitUserPackagesSuccess; @@ -203,6 +208,7 @@ export const getAccountMenuVisible = (state: State) => state.accountMenuVisible; export const getAppMenuVisible = (state: State) => state.appMenuVisible; export const getNotificationMenuVisible = (state: State) => state.notificationMenuVisible; export const getHelpMenuVisible = (state: State) => state.helpMenuVisible; +export const getSettingsMenuVisible = (state: State) => state.settingsMenuVisible; export const getUnreadNotifications = (state: State) => state.unreadNotifications; export const getIsOnline = (state: State) => state.isOnline; export const getIsPageMode = (state: State) => state.isPageMode; @@ -227,6 +233,7 @@ export const SelectGetAccountMenuVisible = createSelector(selectAppCommonState,g export const SelectGetAppMenuVisible = createSelector(selectAppCommonState,getAppMenuVisible); export const SelectGetNotificationMenuVisible = createSelector(selectAppCommonState,getNotificationMenuVisible); export const SelectGetHelpMenuVisible = createSelector(selectAppCommonState,getHelpMenuVisible); +export const SelectGetSettingsMenuVisible = createSelector(selectAppCommonState,getSettingsMenuVisible); export const SelectgetUnreadNotifications = createSelector(selectAppCommonState,getUnreadNotifications); export const SelectGetIsOnline = createSelector(selectAppCommonState,getIsOnline); From 6f7d8fe248b27bfd7facd79f4b5393176b48cf45 Mon Sep 17 00:00:00 2001 From: jenkins Date: Mon, 14 Oct 2024 10:17:45 +0000 Subject: [PATCH 02/10] [ci skip] Updated packages #2514 --- package-lock.json | 12 ++++++------ package.json | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1d035e0..aaddcee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "farmmaps-lib-app", - "version": "4.10.0", + "version": "4.11.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "farmmaps-lib-app", - "version": "4.10.0", + "version": "4.11.0", "dependencies": { "@angular-eslint/eslint-plugin": "^18.2.0", "@angular/animations": "^18.2.3", @@ -90,7 +90,7 @@ }, "dist/common": { "name": "@farmmaps/common", - "version": "4.10.0-prerelease.2512", + "version": "4.10.0-prerelease.2513", "dependencies": { "tslib": "^2.3.0" }, @@ -115,7 +115,7 @@ }, "dist/common-map": { "name": "@farmmaps/common-map", - "version": "4.10.0-prerelease.2512", + "version": "4.10.0-prerelease.2513", "dependencies": { "tslib": "^2.0.0" }, @@ -130,7 +130,7 @@ }, "dist/common-map3d": { "name": "@farmmaps/common-map3d", - "version": "4.10.0-prerelease.2512", + "version": "4.10.0-prerelease.2513", "dependencies": { "tslib": "^2.0.0" }, @@ -143,7 +143,7 @@ }, "dist/ng-openlayers": { "name": "@farmmaps/ng-openlayers", - "version": "4.10.0-prerelease.2512", + "version": "4.10.0-prerelease.2513", "license": "MPL-2.0", "dependencies": { "tslib": "^2.3.0" diff --git a/package.json b/package.json index 7fbf91a..4de4148 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "farmmaps-lib-app", - "version": "4.10.0", - "scripts": { + "version": "4.11.0", + "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", @@ -10,7 +10,7 @@ "e2e": "ng e2e" }, "private": true, - "dependencies": { + "dependencies": { "@angular-eslint/eslint-plugin": "^18.2.0", "@angular/animations": "^18.2.3", "@angular/common": "^18.2.3", @@ -56,11 +56,11 @@ "util": "^0.12.4", "zone.js": "~0.14.10" }, - "optionalDependencies": { + "optionalDependencies": { "@lmdb/lmdb-linux-x64": "^3.1.0", "@rollup/rollup-linux-x64-gnu": "^4.21.2" }, - "devDependencies": { + "devDependencies": { "@angular-builders/custom-webpack": "^18.0.0", "@angular-devkit/build-angular": "^18.2.3", "@angular/cli": "^18.2.3", @@ -90,4 +90,4 @@ "ts-node": "^8.8.1", "typescript": "~5.4.4" } -} +} \ No newline at end of file From 98980fc857590f39d28eb9cd270800157fe85fae Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Mon, 14 Oct 2024 13:08:41 +0200 Subject: [PATCH 03/10] AW-6410 Fix settings menu --- projects/common/src/fm/components/app/app.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/common/src/fm/components/app/app.component.ts b/projects/common/src/fm/components/app/app.component.ts index 3d7dcae..2670a76 100644 --- a/projects/common/src/fm/components/app/app.component.ts +++ b/projects/common/src/fm/components/app/app.component.ts @@ -45,7 +45,7 @@ export class AppComponent implements OnInit, OnDestroy { public accountMenuVisible: Observable = this.store$.select(appReducers.SelectGetAccountMenuVisible); public appMenuVisible: Observable = this.store$.select(appReducers.SelectGetAppMenuVisible); public notificationMenuVisible: Observable = this.store$.select(appReducers.SelectGetNotificationMenuVisible); - public settingsMenuVisible: Observable = this.store$.select(appReducers.SelectGetHelpMenuVisible); + public settingsMenuVisible: Observable = this.store$.select(appReducers.SelectGetSettingsMenuVisible); public helpMenuVisible: Observable = this.store$.select(appReducers.SelectGetHelpMenuVisible); public unreadNotifications: Observable = this.store$.select(appReducers.SelectgetUnreadNotifications); public user: Observable = this.store$.select(appReducers.SelectGetUser); From f76ef44deeaef213abe63c506a3e8fb74893aa50 Mon Sep 17 00:00:00 2001 From: jenkins Date: Mon, 14 Oct 2024 11:10:45 +0000 Subject: [PATCH 04/10] [ci skip] Updated packages #2515 --- package-lock.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index aaddcee..2c49887 100644 --- a/package-lock.json +++ b/package-lock.json @@ -90,7 +90,7 @@ }, "dist/common": { "name": "@farmmaps/common", - "version": "4.10.0-prerelease.2513", + "version": "4.11.0-prerelease.2514", "dependencies": { "tslib": "^2.3.0" }, @@ -115,7 +115,7 @@ }, "dist/common-map": { "name": "@farmmaps/common-map", - "version": "4.10.0-prerelease.2513", + "version": "4.11.0-prerelease.2514", "dependencies": { "tslib": "^2.0.0" }, @@ -130,7 +130,7 @@ }, "dist/common-map3d": { "name": "@farmmaps/common-map3d", - "version": "4.10.0-prerelease.2513", + "version": "4.11.0-prerelease.2514", "dependencies": { "tslib": "^2.0.0" }, @@ -143,7 +143,7 @@ }, "dist/ng-openlayers": { "name": "@farmmaps/ng-openlayers", - "version": "4.10.0-prerelease.2513", + "version": "4.11.0-prerelease.2514", "license": "MPL-2.0", "dependencies": { "tslib": "^2.3.0" From a8675f5c49c309090bcd748169c3d82fdd491ee0 Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Mon, 14 Oct 2024 14:09:23 +0200 Subject: [PATCH 05/10] AW-6410 Fix settings menu --- package-lock.json | 10 +++---- .../src/fm/actions/app-common.actions.ts | 8 +++--- projects/common/src/fm/common.module.ts | 4 +-- .../src/fm/components/app/app.component.html | 2 +- .../src/fm/components/app/app.component.scss | 2 +- .../src/fm/components/app/app.component.ts | 2 +- .../setting-menu.component.html} | 4 +-- .../setting-menu.component.scss} | 0 .../setting-menu.component.ts} | 10 +++---- .../src/fm/reducers/app-common.reducer.ts | 26 +++++++++---------- src/app/app-routing.module.ts | 7 ++++- 11 files changed, 40 insertions(+), 35 deletions(-) rename projects/common/src/fm/components/{settings-menu/settings-menu.component.html => setting-menu/setting-menu.component.html} (66%) rename projects/common/src/fm/components/{settings-menu/settings-menu.component.scss => setting-menu/setting-menu.component.scss} (100%) rename projects/common/src/fm/components/{settings-menu/settings-menu.component.ts => setting-menu/setting-menu.component.ts} (72%) diff --git a/package-lock.json b/package-lock.json index aaddcee..eb254e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -90,7 +90,7 @@ }, "dist/common": { "name": "@farmmaps/common", - "version": "4.10.0-prerelease.2513", + "version": "2.1.0", "dependencies": { "tslib": "^2.3.0" }, @@ -115,7 +115,7 @@ }, "dist/common-map": { "name": "@farmmaps/common-map", - "version": "4.10.0-prerelease.2513", + "version": "2.0.0", "dependencies": { "tslib": "^2.0.0" }, @@ -124,13 +124,13 @@ "@ngrx/effects": "^18.0.2", "@ngrx/router-store": "^18.0.2", "@ngrx/store": "^18.0.2", - "ngrx-store-localstorage": "^18.0.0", + "ngrx-store-localstorage": "^18", "tassign": "^1.0.0" } }, "dist/common-map3d": { "name": "@farmmaps/common-map3d", - "version": "4.10.0-prerelease.2513", + "version": "2.0.0", "dependencies": { "tslib": "^2.0.0" }, @@ -143,7 +143,7 @@ }, "dist/ng-openlayers": { "name": "@farmmaps/ng-openlayers", - "version": "4.10.0-prerelease.2513", + "version": "18.0.0", "license": "MPL-2.0", "dependencies": { "tslib": "^2.3.0" diff --git a/projects/common/src/fm/actions/app-common.actions.ts b/projects/common/src/fm/actions/app-common.actions.ts index d4c176a..ca8ef37 100644 --- a/projects/common/src/fm/actions/app-common.actions.ts +++ b/projects/common/src/fm/actions/app-common.actions.ts @@ -71,7 +71,7 @@ export const TOGGLENOTIFICATIONMENU = '[AppCommon] ToggleNotificationMenu'; export const TOGGLEHELPMENU = '[AppCommon] ToggleHelpMenu'; -export const TOGGLESETTINGSMENU = '[AppCommon] ToggleSettingsMenu'; +export const TOGGLESETTINGMENU = '[AppCommon] ToggleSettingMenu'; export const SETMENUVISIBLE = '[AppCommon] SetMenuVisible'; @@ -334,8 +334,8 @@ export class ToggleHelpMenu implements Action { constructor() { } } -export class ToggleSettingsMenu implements Action { - readonly type = TOGGLESETTINGSMENU; +export class ToggleSettingMenu implements Action { + readonly type = TOGGLESETTINGMENU; constructor() { } } @@ -416,7 +416,7 @@ export type Actions = OpenModal | ToggleAppMenu | ToggleNotificationMenu | ToggleHelpMenu - | ToggleSettingsMenu + | ToggleSettingMenu | NotificationEvent | SetUnreadNotifications; diff --git a/projects/common/src/fm/common.module.ts b/projects/common/src/fm/common.module.ts index ab501a9..9f17ace 100644 --- a/projects/common/src/fm/common.module.ts +++ b/projects/common/src/fm/common.module.ts @@ -34,7 +34,7 @@ import { HasClaimDirective } from './components/has-claim/has-claim.directive'; import { HasPackageDirective } from './components/has-package/has-package.directive'; import { HasRoleDirective } from './components/has-role/has-role.directive'; import { HelpMenuComponent } from './components/help-menu/help-menu.component'; -import { SettingsMenuComponent } from './components/settings-menu/settings-menu.component'; +import { SettingMenuComponent } from './components/setting-menu/setting-menu.component'; import { ItemLinkComponent } from './components/item-link/item-link.component'; import { MenuBackgroundComponent } from './components/menu-background/menu-background.component'; import { NotFoundComponent } from './components/not-found/not-found.component'; @@ -105,7 +105,7 @@ export { AppMenuComponent, NotificationMenuComponent, HelpMenuComponent, - SettingsMenuComponent, + SettingMenuComponent, BackButtonComponent, ThumbnailComponent, EditImageModalComponent, diff --git a/projects/common/src/fm/components/app/app.component.html b/projects/common/src/fm/components/app/app.component.html index 538026d..1f33cf6 100644 --- a/projects/common/src/fm/components/app/app.component.html +++ b/projects/common/src/fm/components/app/app.component.html @@ -33,8 +33,8 @@
+ - diff --git a/projects/common/src/fm/components/app/app.component.scss b/projects/common/src/fm/components/app/app.component.scss index 53c5b3a..2ecbcc3 100644 --- a/projects/common/src/fm/components/app/app.component.scss +++ b/projects/common/src/fm/components/app/app.component.scss @@ -119,7 +119,7 @@ body { background: #f1f1f1; line-height: 18px; user-select:none;font-family: Lat max-height:0em; } -fm-help-menu,fm-app-menu,fm-user-menu,fm-notification-menu,fm-settings-menu { +fm-help-menu,fm-app-menu,fm-user-menu,fm-notification-menu,fm-setting-menu { display: inline-block; margin-left: 1rem; } diff --git a/projects/common/src/fm/components/app/app.component.ts b/projects/common/src/fm/components/app/app.component.ts index 2670a76..4808d08 100644 --- a/projects/common/src/fm/components/app/app.component.ts +++ b/projects/common/src/fm/components/app/app.component.ts @@ -45,7 +45,7 @@ export class AppComponent implements OnInit, OnDestroy { public accountMenuVisible: Observable = this.store$.select(appReducers.SelectGetAccountMenuVisible); public appMenuVisible: Observable = this.store$.select(appReducers.SelectGetAppMenuVisible); public notificationMenuVisible: Observable = this.store$.select(appReducers.SelectGetNotificationMenuVisible); - public settingsMenuVisible: Observable = this.store$.select(appReducers.SelectGetSettingsMenuVisible); + public settingMenuVisible: Observable = this.store$.select(appReducers.SelectGetSettingMenuVisible); public helpMenuVisible: Observable = this.store$.select(appReducers.SelectGetHelpMenuVisible); public unreadNotifications: Observable = this.store$.select(appReducers.SelectgetUnreadNotifications); public user: Observable = this.store$.select(appReducers.SelectGetUser); diff --git a/projects/common/src/fm/components/settings-menu/settings-menu.component.html b/projects/common/src/fm/components/setting-menu/setting-menu.component.html similarity index 66% rename from projects/common/src/fm/components/settings-menu/settings-menu.component.html rename to projects/common/src/fm/components/setting-menu/setting-menu.component.html index 820a737..fa19285 100644 --- a/projects/common/src/fm/components/settings-menu/settings-menu.component.html +++ b/projects/common/src/fm/components/setting-menu/setting-menu.component.html @@ -1,8 +1,8 @@ -
+
\ No newline at end of file diff --git a/projects/common/src/fm/components/settings-menu/settings-menu.component.scss b/projects/common/src/fm/components/setting-menu/setting-menu.component.scss similarity index 100% rename from projects/common/src/fm/components/settings-menu/settings-menu.component.scss rename to projects/common/src/fm/components/setting-menu/setting-menu.component.scss diff --git a/projects/common/src/fm/components/settings-menu/settings-menu.component.ts b/projects/common/src/fm/components/setting-menu/setting-menu.component.ts similarity index 72% rename from projects/common/src/fm/components/settings-menu/settings-menu.component.ts rename to projects/common/src/fm/components/setting-menu/setting-menu.component.ts index b89cd20..6ba8eae 100644 --- a/projects/common/src/fm/components/settings-menu/settings-menu.component.ts +++ b/projects/common/src/fm/components/setting-menu/setting-menu.component.ts @@ -7,11 +7,11 @@ import * as appReducers from '../../reducers/app-common.reducer'; import * as appActions from '../../actions/app-common.actions'; @Component({ - selector: 'fm-settings-menu', - templateUrl: './settings-menu.component.html', - styleUrls: ['./settings-menu.component.scss'] + selector: 'fm-setting-menu', + templateUrl: './setting-menu.component.html', + styleUrls: ['./setting-menu.component.scss'] }) -export class SettingsMenuComponent implements OnInit { +export class SettingMenuComponent implements OnInit { @Input() user:IUser; @Input() showMenu:boolean; @@ -24,7 +24,7 @@ export class SettingsMenuComponent implements OnInit { toggle(event:MouseEvent) { event.stopPropagation(); - this.store.dispatch(new appActions.ToggleSettingsMenu()); + this.store.dispatch(new appActions.ToggleSettingMenu()); } activateRoute() { diff --git a/projects/common/src/fm/reducers/app-common.reducer.ts b/projects/common/src/fm/reducers/app-common.reducer.ts index d9429c0..89aeb48 100644 --- a/projects/common/src/fm/reducers/app-common.reducer.ts +++ b/projects/common/src/fm/reducers/app-common.reducer.ts @@ -26,7 +26,7 @@ export interface State { appMenuVisible: boolean, notificationMenuVisible: boolean, helpMenuVisible: boolean, - settingsMenuVisible: boolean, + settingMenuVisible: boolean, unreadNotifications: number, isOnline: boolean, isPageMode:boolean @@ -48,7 +48,7 @@ export const initialState: State = { appMenuVisible: false, notificationMenuVisible: false, helpMenuVisible: false, - settingsMenuVisible: false, + settingMenuVisible: false, unreadNotifications: 0, isOnline: true, isPageMode: true @@ -108,29 +108,29 @@ export function reducer(state = initialState, action: appCommonActions.Actions ) }); } case appCommonActions.TOGGLEMENU: { - return tassign(state, { menuVisible: !state.menuVisible,accountMenuVisible:!state.menuVisible?false:state.accountMenuVisible,appMenuVisible:!state.menuVisible?false:state.appMenuVisible,notificationMenuVisible:!state.menuVisible?false:state.notificationMenuVisible,helpMenuVisible:!state.menuVisible?false:state.helpMenuVisible,settingsMenuVisible:!state.menuVisible?false:state.settingsMenuVisible }); + return tassign(state, { menuVisible: !state.menuVisible,accountMenuVisible:!state.menuVisible?false:state.accountMenuVisible,appMenuVisible:!state.menuVisible?false:state.appMenuVisible,notificationMenuVisible:!state.menuVisible?false:state.notificationMenuVisible,helpMenuVisible:!state.menuVisible?false:state.helpMenuVisible,settingMenuVisible:!state.menuVisible?false:state.settingMenuVisible }); } case appCommonActions.TOGGLEACCOUNTMENU: { - return tassign(state, { accountMenuVisible: !state.accountMenuVisible,appMenuVisible:false,notificationMenuVisible:false,helpMenuVisible:false,settingsMenuVisible:false }); + return tassign(state, { accountMenuVisible: !state.accountMenuVisible,appMenuVisible:false,notificationMenuVisible:false,helpMenuVisible:false,settingMenuVisible:false }); } case appCommonActions.TOGGLEAPPMENU: { - return tassign(state, { appMenuVisible: !state.appMenuVisible,accountMenuVisible:false,notificationMenuVisible:false,helpMenuVisible:false,settingsMenuVisible:false }); + return tassign(state, { appMenuVisible: !state.appMenuVisible,accountMenuVisible:false,notificationMenuVisible:false,helpMenuVisible:false,settingMenuVisible:false }); } case appCommonActions.TOGGLENOTIFICATIONMENU: { - return tassign(state, { notificationMenuVisible : !state.notificationMenuVisible,accountMenuVisible:false,appMenuVisible:false,helpMenuVisible:false,settingsMenuVisible:false }); + return tassign(state, { notificationMenuVisible : !state.notificationMenuVisible,accountMenuVisible:false,appMenuVisible:false,helpMenuVisible:false,settingMenuVisible:false }); } case appCommonActions.TOGGLEHELPMENU: { - return tassign(state, { helpMenuVisible : !state.helpMenuVisible,accountMenuVisible:false,appMenuVisible:false,notificationMenuVisible:false,settingsMenuVisible:false }); + return tassign(state, { helpMenuVisible : !state.helpMenuVisible,accountMenuVisible:false,appMenuVisible:false,notificationMenuVisible:false,settingMenuVisible:false }); } - case appCommonActions.TOGGLESETTINGSMENU: { - return tassign(state, { settingsMenuVisible : !state.settingsMenuVisible,accountMenuVisible:false,appMenuVisible:false,notificationMenuVisible:false,helpMenuVisible:false }); + case appCommonActions.TOGGLESETTINGMENU: { + return tassign(state, { settingMenuVisible : !state.settingMenuVisible,accountMenuVisible:false,appMenuVisible:false,notificationMenuVisible:false,helpMenuVisible:false }); } case appCommonActions.ESCAPE: { - return tassign(state, { menuVisible: false,accountMenuVisible:false,appMenuVisible: false,notificationMenuVisible:false,helpMenuVisible:false,settingsMenuVisible:false }); + return tassign(state, { menuVisible: false,accountMenuVisible:false,appMenuVisible: false,notificationMenuVisible:false,helpMenuVisible:false,settingMenuVisible:false }); } case appCommonActions.SETMENUVISIBLE: { const a = action as appCommonActions.SetMenuVisible; - return tassign(state, { menuVisible: a.visible,accountMenuVisible:a.visible?false:state.accountMenuVisible,appMenuVisible:a.visible?false:state.appMenuVisible,notificationMenuVisible:a.visible?false:state.notificationMenuVisible,helpMenuVisible:a.visible?false:state.helpMenuVisible,settingsMenuVisible:a.visible?false:state.settingsMenuVisible }); + return tassign(state, { menuVisible: a.visible,accountMenuVisible:a.visible?false:state.accountMenuVisible,appMenuVisible:a.visible?false:state.appMenuVisible,notificationMenuVisible:a.visible?false:state.notificationMenuVisible,helpMenuVisible:a.visible?false:state.helpMenuVisible,settingMenuVisible:a.visible?false:state.settingMenuVisible }); } case appCommonActions.INITUSERPACKAGESSUCCESS:{ const a = action as appCommonActions.InitUserPackagesSuccess; @@ -208,7 +208,7 @@ export const getAccountMenuVisible = (state: State) => state.accountMenuVisible; export const getAppMenuVisible = (state: State) => state.appMenuVisible; export const getNotificationMenuVisible = (state: State) => state.notificationMenuVisible; export const getHelpMenuVisible = (state: State) => state.helpMenuVisible; -export const getSettingsMenuVisible = (state: State) => state.settingsMenuVisible; +export const getSettingMenuVisible = (state: State) => state.settingMenuVisible; export const getUnreadNotifications = (state: State) => state.unreadNotifications; export const getIsOnline = (state: State) => state.isOnline; export const getIsPageMode = (state: State) => state.isPageMode; @@ -233,7 +233,7 @@ export const SelectGetAccountMenuVisible = createSelector(selectAppCommonState,g export const SelectGetAppMenuVisible = createSelector(selectAppCommonState,getAppMenuVisible); export const SelectGetNotificationMenuVisible = createSelector(selectAppCommonState,getNotificationMenuVisible); export const SelectGetHelpMenuVisible = createSelector(selectAppCommonState,getHelpMenuVisible); -export const SelectGetSettingsMenuVisible = createSelector(selectAppCommonState,getSettingsMenuVisible); +export const SelectGetSettingMenuVisible = createSelector(selectAppCommonState,getSettingMenuVisible); export const SelectgetUnreadNotifications = createSelector(selectAppCommonState,getUnreadNotifications); export const SelectGetIsOnline = createSelector(selectAppCommonState,getIsOnline); diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 4f708af..de9f79d 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -20,7 +20,7 @@ const routes = [ { path: '', - canActivate: [NavBarGuard], + //canActivate: [NavBarGuard], component: LandingpageComponent }, { @@ -43,6 +43,11 @@ const routes = [ component: TestComponent, outlet: 'help-menu' }, + { + path: '', + component: TestComponent, + outlet: 'setting-menu' + }, { path: '', component: LogoComponent, From 32b3b98f76b70204f117d730154869d352ee1c71 Mon Sep 17 00:00:00 2001 From: jenkins Date: Mon, 14 Oct 2024 12:11:38 +0000 Subject: [PATCH 06/10] [ci skip] Updated packages #2516 --- package-lock.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index eb254e8..e46395c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -90,7 +90,7 @@ }, "dist/common": { "name": "@farmmaps/common", - "version": "2.1.0", + "version": "4.11.0-prerelease.2515", "dependencies": { "tslib": "^2.3.0" }, @@ -115,7 +115,7 @@ }, "dist/common-map": { "name": "@farmmaps/common-map", - "version": "2.0.0", + "version": "4.11.0-prerelease.2515", "dependencies": { "tslib": "^2.0.0" }, @@ -124,13 +124,13 @@ "@ngrx/effects": "^18.0.2", "@ngrx/router-store": "^18.0.2", "@ngrx/store": "^18.0.2", - "ngrx-store-localstorage": "^18", + "ngrx-store-localstorage": "^18.0.0", "tassign": "^1.0.0" } }, "dist/common-map3d": { "name": "@farmmaps/common-map3d", - "version": "2.0.0", + "version": "4.11.0-prerelease.2515", "dependencies": { "tslib": "^2.0.0" }, @@ -143,7 +143,7 @@ }, "dist/ng-openlayers": { "name": "@farmmaps/ng-openlayers", - "version": "18.0.0", + "version": "4.11.0-prerelease.2515", "license": "MPL-2.0", "dependencies": { "tslib": "^2.3.0" From 349a76395be9af3c12030fd4b495fbcbd162a72a Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Mon, 14 Oct 2024 15:12:41 +0200 Subject: [PATCH 07/10] AW-6410 Fix settings menu --- .../setting-menu/setting-menu.component.scss | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/projects/common/src/fm/components/setting-menu/setting-menu.component.scss b/projects/common/src/fm/components/setting-menu/setting-menu.component.scss index 94b425b..486449e 100644 --- a/projects/common/src/fm/components/setting-menu/setting-menu.component.scss +++ b/projects/common/src/fm/components/setting-menu/setting-menu.component.scss @@ -68,16 +68,6 @@ div.menu-button > span { } } -.mobile-hide { - display: inherit; -} - -@media screen and (max-width: 768px) { - .mobile-hide { - display: none; - } -} - .unread { display: block; position: absolute; From 1d6b30edff82d96347b516f3ed8aa08f28005ac3 Mon Sep 17 00:00:00 2001 From: jenkins Date: Mon, 14 Oct 2024 13:15:00 +0000 Subject: [PATCH 08/10] [ci skip] Updated packages #2517 --- package-lock.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index e46395c..9d27a7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -90,7 +90,7 @@ }, "dist/common": { "name": "@farmmaps/common", - "version": "4.11.0-prerelease.2515", + "version": "4.11.0-prerelease.2516", "dependencies": { "tslib": "^2.3.0" }, @@ -115,7 +115,7 @@ }, "dist/common-map": { "name": "@farmmaps/common-map", - "version": "4.11.0-prerelease.2515", + "version": "4.11.0-prerelease.2516", "dependencies": { "tslib": "^2.0.0" }, @@ -130,7 +130,7 @@ }, "dist/common-map3d": { "name": "@farmmaps/common-map3d", - "version": "4.11.0-prerelease.2515", + "version": "4.11.0-prerelease.2516", "dependencies": { "tslib": "^2.0.0" }, @@ -143,7 +143,7 @@ }, "dist/ng-openlayers": { "name": "@farmmaps/ng-openlayers", - "version": "4.11.0-prerelease.2515", + "version": "4.11.0-prerelease.2516", "license": "MPL-2.0", "dependencies": { "tslib": "^2.3.0" From 31f9b48bd750f2c4be858ce5d93e9adbe83eedd3 Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Tue, 22 Oct 2024 14:38:17 +0200 Subject: [PATCH 09/10] AW-6410 Add beforeLocationBack event --- .../components/back-button/back-button.component.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/projects/common/src/fm/components/back-button/back-button.component.ts b/projects/common/src/fm/components/back-button/back-button.component.ts index c960942..fd980bc 100644 --- a/projects/common/src/fm/components/back-button/back-button.component.ts +++ b/projects/common/src/fm/components/back-button/back-button.component.ts @@ -1,6 +1,6 @@ -import {Component, HostListener} from '@angular/core'; -import {Location} from "@angular/common"; -import { DeviceService} from '../../services/device.service'; +import { Location } from "@angular/common"; +import { Component, EventEmitter, HostListener, Output } from '@angular/core'; +import { DeviceService } from '../../services/device.service'; @Component({ selector: 'fm-back-button', @@ -8,16 +8,18 @@ import { DeviceService} from '../../services/device.service'; styleUrls: ['./back-button.component.scss'] }) export class BackButtonComponent { + @Output() beforeLocationBack = new EventEmitter(); @HostListener('click') onBackClicked() { + this.beforeLocationBack.emit(); this.location.back(); } - constructor(private location: Location,private deviceService:DeviceService) { } + constructor(private location: Location,private deviceService:DeviceService) { + } public show() { return !this.deviceService.IsMobile(); } - } From 6b95fb7f77aa2598d128db3bccfbc51a9f57c13c Mon Sep 17 00:00:00 2001 From: jenkins Date: Tue, 22 Oct 2024 12:40:18 +0000 Subject: [PATCH 10/10] [ci skip] Updated packages #2518 --- package-lock.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9d27a7e..f3f4390 100644 --- a/package-lock.json +++ b/package-lock.json @@ -90,7 +90,7 @@ }, "dist/common": { "name": "@farmmaps/common", - "version": "4.11.0-prerelease.2516", + "version": "4.11.0-prerelease.2517", "dependencies": { "tslib": "^2.3.0" }, @@ -115,7 +115,7 @@ }, "dist/common-map": { "name": "@farmmaps/common-map", - "version": "4.11.0-prerelease.2516", + "version": "4.11.0-prerelease.2517", "dependencies": { "tslib": "^2.0.0" }, @@ -130,7 +130,7 @@ }, "dist/common-map3d": { "name": "@farmmaps/common-map3d", - "version": "4.11.0-prerelease.2516", + "version": "4.11.0-prerelease.2517", "dependencies": { "tslib": "^2.0.0" }, @@ -143,7 +143,7 @@ }, "dist/ng-openlayers": { "name": "@farmmaps/ng-openlayers", - "version": "4.11.0-prerelease.2516", + "version": "4.11.0-prerelease.2517", "license": "MPL-2.0", "dependencies": { "tslib": "^2.3.0"