Skip to content

Commit

Permalink
bug fixes and add ui/ux for admin page
Browse files Browse the repository at this point in the history
  • Loading branch information
Pop John committed Aug 13, 2024
1 parent cc56a3c commit dd788d1
Show file tree
Hide file tree
Showing 12 changed files with 199 additions and 3 deletions.
4 changes: 4 additions & 0 deletions frontend/src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ export const routes: Routes = [
{
path: RoutesList.MULTI_MODAL.ROOT,
loadChildren: () => import('./modules/multi-modal/multi-modal.module').then((m) => m.MultiModalModule)
},
{
path: RoutesList.ADMIN.ROOT,
loadChildren: () => import('./modules/admin/admin.module').then((m) => m.AdminModule)
}
]
}
Expand Down
32 changes: 32 additions & 0 deletions frontend/src/app/modules/admin/admin-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2024 Cisco Systems, Inc. and its affiliates

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// SPDX-License-Identifier: Apache-2.0

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AdminComponent } from './components/admin/admin.component';

const ADMIN_ROUTES: Routes = [
{
path: '',
component: AdminComponent
}
];

@NgModule({
imports: [RouterModule.forChild(ADMIN_ROUTES)],
exports: [RouterModule]
})
export class AdminRoutingModule {}
41 changes: 41 additions & 0 deletions frontend/src/app/modules/admin/admin.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2024 Cisco Systems, Inc. and its affiliates

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// SPDX-License-Identifier: Apache-2.0

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { MatButtonToggleModule } from '@angular/material/button-toggle';
import { MatCardModule } from '@angular/material/card';
import { MatDividerModule } from '@angular/material/divider';
import { MatIconModule } from '@angular/material/icon';
import { MatTooltipModule } from '@angular/material/tooltip';
import { AdminRoutingModule } from './admin-routing.module';
import { AdminComponent } from './components/admin/admin.component';

@NgModule({
declarations: [AdminComponent],
imports: [
CommonModule,
AdminRoutingModule,
MatDividerModule,
MatIconModule,
MatTooltipModule,
MatButtonToggleModule,
ReactiveFormsModule,
MatCardModule
]
})
export class AdminModule {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!-- Copyright 2024 Cisco Systems, Inc. and its affiliates
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache-2.0 -->

<div class="admin-settings-container">
<p class="heading-primary-title">Admin</p>

<p class="paragraph-regular-p3-default">
The Global Settings Admin Page allows administrators to manage and customize key app configurations, all from one
central location.
</p>

<div class="divider-container mb-2">
<mat-divider></mat-divider>
</div>

<mat-card class="ms-card default-mode-card">
<div class="default-mode-header">
<div class="flex items-center mr-1">
<mat-icon
fontSet="ms"
fontIcon="icon-Info"
matTooltip="Allows users to choose the default startup mode for the app, determining how it will open each time. Users can select their preferred interface or workflow, ensuring the app starts in the most convenient way for their needs.">
</mat-icon>
</div>

<div class="paragraph-bold-p3-small-bold flex items-center">Default mode:</div>
</div>

<div class="mt-2 mb-2">
<mat-divider></mat-divider>
</div>

<mat-button-toggle-group class="mode-toggle-group">
<mat-button-toggle value="guided">Guided</mat-button-toggle>
<mat-button-toggle value="expert">Expert</mat-button-toggle>
</mat-button-toggle-group>
</mat-card>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2024 Cisco Systems, Inc. and its affiliates

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// SPDX-License-Identifier: Apache-2.0

.divider-container {
margin-bottom: 20px;
}

.default-mode-card {
width: 300px;
}

.default-mode-header {
display: flex;
}

.mode-toggle-group {
display: flex;
justify-content: center;
}
26 changes: 26 additions & 0 deletions frontend/src/app/modules/admin/components/admin/admin.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2024 Cisco Systems, Inc. and its affiliates

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// SPDX-License-Identifier: Apache-2.0

import { Component } from '@angular/core';

@Component({
selector: 'ms-admin',
templateUrl: './admin.component.html',
styleUrl: './admin.component.scss'
})
export class AdminComponent {
defaultSelectedMode?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ export const RoutesList = {
AWQ: {
ROOT: 'awq'
},
ADMIN: {
ROOT: 'admin'
},
DEMO: {
ROOT: 'demo',
BUTTONS: 'buttons',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { Sidenav, SidenavItem } from '../interfaces/sidenav.interface';

const common: SidenavItem[] = [
{
route: 'admin',
route: RoutesList.ADMIN.ROOT,
label: 'Admin',
icon: 'icon-Admin'
}
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/app/modules/wizard/wizard.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatChipsModule } from '@angular/material/chips';
import { MatIconModule } from '@angular/material/icon';
import { MsCardSelectorComponent } from '../shared/components/ms-card-selector/ms-card-selector.component';
Expand Down Expand Up @@ -56,7 +57,8 @@ import { WizardRoutingModule } from './wizard-routing.module';
MsTerminalComponent,
MsCardSelectorComponent,
MatIconModule,
MatChipsModule
MatChipsModule,
MatButtonModule
],
providers: [WizardUtilsService]
})
Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/styles/theme/_ms-theme-common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ $ms-typography: mat.m2-define-rem-typography-config(
@mixin create-theme($theme) {
@include mat.core-theme($theme);
@include mat.button-theme($theme);
@include mat.button-toggle-theme($theme);
@include mat.form-field-theme($theme);
@include mat.input-theme($theme);
@include mat.menu-theme($theme);
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/app/styles/theme/components/_ms-buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ button.ms-white-stroked-button {
}
}
}

.mat-button-toggle-group .mat-button-toggle {
margin: 0 5px;
font-size: 0.875rem;
}
1 change: 0 additions & 1 deletion frontend/src/app/styles/theme/components/_ms-cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ mat-card.ms-card {
cursor: pointer;

&:hover {
transform: scale(1.02);
box-shadow: 0px 5px 15px 0px #0000001f;
background-color: var(--backgrounds-80);
}
Expand Down

0 comments on commit dd788d1

Please sign in to comment.