Skip to content

Commit

Permalink
integrate main and admin component links within app
Browse files Browse the repository at this point in the history
  • Loading branch information
newmanw committed Aug 28, 2024
1 parent fa2c221 commit 1a5272f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion web-app/admin/src/ng1/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function config($httpProvider, $stateProvider, $urlRouterProvider, $animateProvi
};
}

$urlRouterProvider.otherwise('/');
$urlRouterProvider.otherwise('/admin');

$stateProvider.state('admin', {
redirectTo: 'admin.dashboard',
Expand Down
18 changes: 5 additions & 13 deletions web-app/admin/src/ng1/navbar/navbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,22 @@
<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start">
<a class="material-icons mdc-top-app-bar__navigation-icon mobile-only" ng-click="$ctrl.openMenu = !$ctrl.openMenu">menu</a>
<button class="material-icons mdc-icon-button" ng-if="$ctrl.state === 'map'" ng-click="$ctrl.toggleFeed()">menu</button>
<button class="mdc-button top-app-bar-button" onclick="window.location.href='#/map'">
<a class="mdc-button top-app-bar-button" href="/#/home">
<span class="mdc-top-app-bar__title">MAGE</span>
</button>
</a>
</section>
<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end">
<div class="mage-tooltip">
<button class="mdc-button top-app-bar-button" onclick="window.location.href='#/profile'">
<a class="mdc-button top-app-bar-button" href="/#/profile">
<span class="mdc-button__icon">
<user-avatar [user]="$ctrl.myself" avatar-width="25" avatar-height="25"></user-avatar>
</span>
<span style="padding-left: 10px;" class="mdc-button__label">{{$ctrl.myself.displayName}}</span>
</button>
</a>
<span class="tooltiptext">My Profile</span>
</div>
<div class="mage-tooltip" ng-if="$ctrl.hasAdminPermission">
<button class="material-icons mdc-icon-button"
aria-label="Admin"
data-tooltip="Admin"
onclick="window.location.href='#/admin'">settings
</button>
<span class="tooltiptext">Administration Options</span>
</div>
<div class="mage-tooltip">
<button class="material-icons mdc-icon-button" aria-label="About" onclick="window.location.href='#/about'">info</button>
<a class="material-icons mdc-icon-button" aria-label="About" href="/#/about">info</a>
<span class="tooltiptext">About MAGE</span>
</div>
<div class="mage-tooltip">
Expand Down
2 changes: 1 addition & 1 deletion web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"scripts": {
"start:app": "ng serve --project=app --configuration development",
"start:admin": "ng serve --project=admin --configuration development",
"build": "npm-run-all clean build:core-lib build:app:dev build:admin:dev",
"build": "npm-run-all clean build:core-lib build:app:dev build:admin:dev combine",
"build:prod": "npm-run-all clean build:core-lib build:app:prod build:app:prod",
"build:app:dev": "ng build --project=app --configuration development",
"build:admin:dev": "ng build --project=admin --configuration development",
Expand Down
3 changes: 2 additions & 1 deletion web-app/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, ApplicationRef, DoBootstrap } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { CommonModule } from '@angular/common';
import { CommonModule, HashLocationStrategy, LocationStrategy } from '@angular/common';
import { AppComponent } from './app.component';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { MatDialogModule } from '@angular/material/dialog';
Expand All @@ -25,6 +25,7 @@ import { TokenInterceptorService } from './http/token.interceptor';
providers: [
LocalStorageService,
TokenInterceptorService,
{ provide: LocationStrategy, useClass: HashLocationStrategy },
{ provide: HTTP_INTERCEPTORS, useClass: TokenInterceptorService, multi: true }
]
})
Expand Down
2 changes: 1 addition & 1 deletion web-app/src/app/navigation/navigation.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<mat-icon>file_download</mat-icon>
</button>

<a mat-button href="/mage-admin/admin">
<a mat-button href="admin/#/admin/">
<mat-icon>admin_panel_settings</mat-icon>
</a>

Expand Down

0 comments on commit 1a5272f

Please sign in to comment.