Partly done migration to angular 15

This commit is contained in:
rubikscraft
2022-12-20 16:21:25 +01:00
parent e6b70d0b1c
commit 9e5178db8b
20 changed files with 2354 additions and 1888 deletions

View File

@@ -22,15 +22,15 @@
"purge": "rm -rf dist && rm -rf node_modules"
},
"dependencies": {
"@fastify/helmet": "^10.0.1",
"@fastify/multipart": "^7.2.0",
"@fastify/static": "^6.5.0",
"@nestjs/common": "^9.1.4",
"@fastify/helmet": "^10.1.0",
"@fastify/multipart": "^7.3.0",
"@fastify/static": "^6.6.0",
"@nestjs/common": "^9.2.1",
"@nestjs/config": "^2.2.0",
"@nestjs/core": "^9.1.4",
"@nestjs/core": "^9.2.1",
"@nestjs/jwt": "^9.0.0",
"@nestjs/passport": "^9.0.0",
"@nestjs/platform-fastify": "^9.1.4",
"@nestjs/platform-fastify": "^9.2.1",
"@nestjs/serve-static": "^3.0.0",
"@nestjs/typeorm": "^9.0.1",
"bcrypt": "^5.1.0",
@@ -47,40 +47,40 @@
"pg": "^8.8.0",
"picsur-shared": "*",
"posix.js": "^0.1.1",
"qoi-img": "^2.1.0",
"qoi-img": "^2.1.1",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.5.7",
"sharp": "^0.31.1",
"rxjs": "^7.8.0",
"sharp": "^0.31.2",
"stream-parser": "^0.3.1",
"thunks": "^4.9.6",
"typeorm": "0.3.10",
"zod": "^3.19.1"
"typeorm": "0.3.11",
"zod": "^3.20.2"
},
"devDependencies": {
"@nestjs/cli": "^9.1.4",
"@nestjs/cli": "^9.1.5",
"@nestjs/schematics": "^9.0.3",
"@nestjs/testing": "^9.1.4",
"@nestjs/testing": "^9.2.1",
"@types/bcrypt": "^5.0.0",
"@types/cors": "^2.8.12",
"@types/cors": "^2.8.13",
"@types/ms": "^0.7.31",
"@types/multer": "^1.4.7",
"@types/node": "^18.8.4",
"@types/passport-jwt": "^3.0.7",
"@types/node": "^18.11.17",
"@types/passport-jwt": "^3.0.8",
"@types/passport-local": "^1.0.34",
"@types/passport-strategy": "^0.2.35",
"@types/sharp": "^0.31.0",
"@types/supertest": "^2.0.12",
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0",
"eslint": "^8.25.0",
"@typescript-eslint/eslint-plugin": "^5.47.0",
"@typescript-eslint/parser": "^5.47.0",
"eslint": "^8.30.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.7.1",
"prettier": "^2.8.1",
"source-map-support": "^0.5.21",
"ts-loader": "^9.4.1",
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.1.0",
"typescript": "4.8.4"
"tsconfig-paths": "^4.1.1",
"typescript": "^4.9.4"
}
}

View File

@@ -21,7 +21,7 @@
"sourceRoot": "src",
"architect": {
"build": {
"builder": "@angular-builders/custom-webpack:browser",
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
@@ -44,10 +44,7 @@
"moment"
],
"optimization": true,
"webWorkerTsConfig": "tsconfig.worker.json",
"customWebpackConfig": {
"path": "./custom-webpack.config.js"
}
"webWorkerTsConfig": "tsconfig.worker.json"
},
"configurations": {
"production": {
@@ -102,6 +99,5 @@
}
}
}
},
"defaultProject": "picsur-frontend"
}
}

View File

@@ -14,30 +14,30 @@
"purge": "rm -rf dist && rm -rf node_modules && rm -rf .angular"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^14.0.1",
"@angular-devkit/build-angular": "14.2.5",
"@angular/animations": "^14.2.5",
"@angular/cdk": "^14.2.4",
"@angular/cli": "^14.2.5",
"@angular/common": "^14.2.5",
"@angular/compiler": "^14.2.5",
"@angular/compiler-cli": "^14.2.5",
"@angular/core": "^14.2.5",
"@angular/forms": "^14.2.5",
"@angular/material": "^14.2.4",
"@angular/platform-browser": "^14.2.5",
"@angular/platform-browser-dynamic": "^14.2.5",
"@angular/router": "^14.2.5",
"@angular-devkit/build-angular": "^15.0.4",
"@angular/animations": "^15.0.4",
"@angular/cdk": "^15.0.3",
"@angular/cli": "^15.0.4",
"@angular/common": "^15.0.4",
"@angular/compiler": "^15.0.4",
"@angular/compiler-cli": "^15.0.4",
"@angular/core": "^15.0.4",
"@angular/forms": "^15.0.4",
"@angular/material": "^15.0.3",
"@angular/platform-browser": "^15.0.4",
"@angular/platform-browser-dynamic": "^15.0.4",
"@angular/router": "^15.0.4",
"@fontsource/material-icons": "^4.5.4",
"@fontsource/material-icons-outlined": "^4.5.4",
"@fontsource/roboto": "^4.5.8",
"@ng-web-apis/common": "^2.0.1",
"@ng-web-apis/common": "^2.1.0",
"@ng-web-apis/resize-observer": "^2.0.0",
"@ngui/common": "^1.0.0",
"@types/node": "^18.8.4",
"@types/node": "^18.11.17",
"@types/resize-observer-browser": "^0.1.7",
"@types/validator": "^13.7.7",
"bootstrap": "^5.2.2",
"@types/validator": "^13.7.10",
"bootstrap": "^5.2.3",
"caniuse-lite": "^1.0.30001439",
"fuse.js": "^6.6.2",
"jwt-decode": "^3.1.2",
"moment": "^2.29.4",
@@ -47,10 +47,10 @@
"ngx-moment": "^6.0.2",
"picsur-shared": "*",
"reflect-metadata": "^0.1.13",
"rxjs": "~7.5.7",
"tslib": "^2.4.0",
"typescript": "4.8.4",
"zod": "^3.19.1",
"zone.js": "~0.11.8"
"rxjs": "^7.8.0",
"tslib": "^2.4.1",
"typescript": "^4.9.4",
"zod": "^3.20.2",
"zone.js": "^0.12.0"
}
}

View File

@@ -3,7 +3,7 @@ footer {
flex-direction: column;
align-items: center;
margin-top: 16px;
margin-top: 1em;
text-align: center;
}

View File

@@ -56,9 +56,9 @@
<mat-menu #menu="matMenu" xPosition="before">
<ng-template matMenuContent>
<span mat-menu-item disabled>
<div class="centered">
<h2>{{ user?.username }}</h2>
<span>
<div class="menu-username center-horizontally">
<h2 class="mat-typography">{{ user?.username }}</h2>
</div>
</span>
<button *ngIf="canUpload" mat-menu-item (click)="doImages()">

View File

@@ -28,8 +28,9 @@
}
}
.mat-menu-item[disabled] {
color: inherit;
.menu-username {
margin-top: .5rem;
margin-bottom: 1rem;
}
h2 {

View File

@@ -7,3 +7,17 @@ mat-form-field {
display: flex;
flex-direction: column;
}
mat-form-field::before {
content: '';
display: inline-block;
height: 16px;
}
h3 {
margin: 0;
}
mat-slide-toggle {
margin-block: 1rem;
}

View File

@@ -1,5 +1,6 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { MatDividerModule } from '@angular/material/divider';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
@@ -13,6 +14,7 @@ import { PrefOptionComponent } from './pref-option.component';
MatFormFieldModule,
MatInputModule,
MatDividerModule,
MatSlideToggleModule,
],
declarations: [PrefOptionComponent],

View File

@@ -1,6 +1,6 @@
<mat-form-field class="value-picker" appearance="outline" color="accent">
<mat-label>{{ nameCapMul }}</mat-label>
<mat-chip-list #chipList>
<mat-chip-grid #chipList>
<mat-chip
*ngFor="let item of this.myControl.value"
[removable]="!isDisabled(item)"
@@ -23,7 +23,7 @@
autocorrect="off"
autocapitalize="none"
/>
</mat-chip-list>
</mat-chip-grid>
<mat-autocomplete
#auto="matAutocomplete"
(optionSelected)="addItemSelect($event)"

View File

@@ -11,7 +11,7 @@
Permissions
</mat-header-cell>
<mat-cell class="d-none d-md-flex" *matCellDef="let role">
<mat-chip-list aria-label="Role Permissions">
<mat-chip-listbox aria-label="Role Permissions">
<mat-chip
[disableRipple]="true"
[disabled]="true"
@@ -33,7 +33,7 @@
>
+{{ role.permissions.length - permissionsTruncate }}
</mat-chip>
</mat-chip-list>
</mat-chip-listbox>
</mat-cell>
</ng-container>

View File

@@ -1,16 +1,16 @@
<mat-nav-list>
<ng-container *ngIf="personalRoutes.length > 0">
<span mat-subheader>Personal</span>
<div mat-subheader>Personal</div>
<a
*ngFor="let route of personalRoutes"
mat-list-item
[routerLink]="'/settings/' + route.path"
routerLinkActive="active"
>
<mat-icon fontSet="material-icons-outlined" mat-list-icon>
<mat-icon fontSet="material-icons-outlined" matListItemIcon>
{{ route.data?.page?.icon }}
</mat-icon>
<span mat-line>{{ route.data?.page?.title }}</span>
<span matListItemTitle>{{ route.data?.page?.title }}</span>
</a>
</ng-container>
@@ -18,17 +18,17 @@
</mat-divider>
<ng-container *ngIf="systemRoutes.length > 0">
<span mat-subheader>System</span>
<div mat-subheader>System</div>
<a
*ngFor="let route of systemRoutes"
mat-list-item
[routerLink]="'/settings/' + route.path"
routerLinkActive="active"
>
<mat-icon fontSet="material-icons-outlined" mat-list-icon>
<mat-icon fontSet="material-icons-outlined" matListItemIcon>
{{ route.data?.page?.icon }}
</mat-icon>
<span mat-line>{{ route.data?.page?.title }}</span>
<span matListItemTitle>{{ route.data?.page?.title }}</span>
</a>
</ng-container>
</mat-nav-list>

View File

@@ -60,14 +60,14 @@
<h3>Effective Permissions</h3>
</div>
<div class="col-12">
<mat-chip-list aria-label="User Permissions">
<mat-chip-listbox aria-label="User Permissions">
<mat-chip
*ngFor="let permission of getEffectivePermissions()"
[disableRipple]="true"
>
{{ permission }}
</mat-chip>
</mat-chip-list>
</mat-chip-listbox>
</div>
</div>

View File

@@ -11,7 +11,7 @@
>Roles</mat-header-cell
>
<mat-cell class="d-none d-md-flex" *matCellDef="let user">
<mat-chip-list aria-label="User Roles">
<mat-chip-listbox aria-label="User Roles">
<mat-chip
[disableRipple]="true"
[disabled]="true"
@@ -31,7 +31,7 @@
>
+{{ user.roles.length - rolesTruncate }}
</mat-chip>
</mat-chip-list>
</mat-chip-listbox>
</mat-cell>
</ng-container>

View File

@@ -1,5 +1,5 @@
// Include bootstrap-grid.scss from node_modules
@use '../node_modules/bootstrap/scss/bootstrap-grid.scss' with (
@use '../../../node_modules/bootstrap/scss/bootstrap-grid.scss' with (
$grid-breakpoints: (
xs: 0,
sm: 576px,

View File

@@ -1,4 +1,4 @@
@use '../node_modules/bootstrap/scss/bootstrap-grid.scss' as bs;
@use '../../../node_modules/bootstrap/scss/bootstrap-grid.scss' as bs;
// Fabs
.fab-wrapper {

View File

@@ -2,6 +2,8 @@
@use '@angular/material' as mat;
@use './material-theme-custom.scss' as custom-mat;
mat.$theme-ignore-duplication-warnings: true;
@include mat.core();
$dark-primary-text: rgba(black, 0.87);
@@ -151,28 +153,33 @@ $mat-dark-theme-background-palette: (
);
$mat-theme: (
primary: $picsur-primary,
accent: $picsur-accent,
warn: $picsur-warn,
is-dark: true,
background: $mat-dark-theme-background-palette,
foreground: $mat-dark-theme-foreground-palette,
color: (
primary: $picsur-primary,
accent: $picsur-accent,
warn: $picsur-warn,
background: $mat-dark-theme-background-palette,
foreground: $mat-dark-theme-foreground-palette,
),
);
$mat-theme-light: (
primary: $picsur-primary,
accent: $picsur-accent,
warn: $picsur-warn,
is-dark: false,
background: $mat-light-theme-background-palette,
foreground: $mat-light-theme-foreground-palette,
$mat-theme-light: mat.define-light-theme(
(
color: (
primary: $picsur-primary,
accent: $picsur-accent,
warn: $picsur-warn,
background: $mat-light-theme-background-palette,
foreground: $mat-light-theme-foreground-palette,
),
)
);
@include mat.all-component-themes($mat-theme);
@include mat.all-component-typographies($mat-theme);
@include custom-mat.custom-material($mat-theme);
.theme-alternate {
@include mat.all-component-themes($mat-theme-light);
@include mat.all-component-colors($mat-theme-light);
@include custom-mat.custom-material($mat-theme-light);
}

View File

@@ -1,49 +1,57 @@
.snackbar {
background: #272727;
color: white;
& .mdc-snackbar__surface {
background: #272727;
& .mdc-snackbar__label {
color: white;
}
}
&.snack-success {
&.snack-success .mdc-snackbar__surface {
background: #274e29;
}
&.snack-error {
&.snack-error .mdc-snackbar__surface {
background: #761919;
}
&.snack-warning {
&.snack-warning .mdc-snackbar__surface {
background: #934d06;
}
&.snack-info {
&.snack-info .mdc-snackbar__surface {
background: #125e87;
}
&.snack-default {
&.snack-default .mdc-snackbar__surface {
background: #272727;
}
}
.theme-alternate .snackbar {
background: #f8f9fa;
color: black;
& .mdc-snackbar__surface {
background: #f8f9fa;
& .mdc-snackbar__label {
color: black;
}
}
&.snack-success {
&.snack-success .mdc-snackbar__surface {
background: #28a745;
}
&.snack-error {
&.snack-error .mdc-snackbar__surface {
background: #dc3545;
}
&.snack-warning {
&.snack-warning .mdc-snackbar__surface {
background: #ffc107;
}
&.snack-info {
&.snack-info .mdc-snackbar__surface {
background: #007bff;
}
&.snack-default {
&.snack-default .mdc-snackbar__surface {
background: #f8f9fa;
}
}

View File

@@ -21,13 +21,13 @@
"fastify": ">=4.8.1",
"terser": ">=5.14.2",
"typeorm": ">=0.3.9",
"typescript": "4.7.4",
"typescript": "~4.8.2",
"fastify-static": "npm:@fastify/static@*",
"fastify-formbody": "npm:@fastify/formbody@*",
"minimist": "npm:minimist-lite@*"
},
"devDependencies": {
"prettier": "^2.7.1",
"prettier": "^2.8.1",
"prettier-plugin-sh": "^0.12.8"
},
"packageManager": "yarn@3.2.2"

View File

@@ -8,12 +8,12 @@
"type": "module",
"main": "./dist/index.js",
"dependencies": {
"zod": "^3.19.1"
"zod": "^3.20.2"
},
"devDependencies": {
"@types/node": "^18.8.4",
"tsc-watch": "^5.0.3",
"typescript": "4.8.4"
"@types/node": "^18.11.17",
"tsc-watch": "^6.0.0",
"typescript": "^4.9.4"
},
"scripts": {
"clean": "rm -rf ./dist",

3996
yarn.lock

File diff suppressed because it is too large Load Diff