diff --git a/.browserslistrc b/.browserslistrc deleted file mode 100644 index 04c200922..000000000 --- a/.browserslistrc +++ /dev/null @@ -1,14 +0,0 @@ -# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. -# For additional information regarding the format and rule options, please see: -# https://github.com/browserslist/browserslist#queries - -# You can see what browsers were selected by your queries by running: -# npx browserslist - -last 2 Chrome version -last 2 Firefox version -last 2 Edge major versions -last 2 Safari major version -last 2 iOS major versions -Firefox ESR -not IE 9-11 # For IE 9-11 support, remove 'not'. diff --git a/.eslintrc.json b/.eslintrc.json index c28709165..c492c7a0d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -18,8 +18,10 @@ "plugin:@angular-eslint/recommended", "plugin:@angular-eslint/template/process-inline-templates" ], - "rules": {} - }, + "rules": { + "@angular-eslint/prefer-standalone": "off" + } + }, { "files": [ "*.html" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9bfb58fc4..fc4bf205b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: docker/metadata-action@v3 + - uses: docker/metadata-action@v5 name: Extract metadata (tags, labels) and establish version id: meta with: @@ -30,13 +30,13 @@ jobs: type=ref,event=branch - name: Log in to the container registry (${{ env.REGISTRY }}) - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - uses: docker/build-push-action@v2 + - uses: docker/build-push-action@v6 name: Build and push image with: build-args: | @@ -50,9 +50,9 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - uses: docker/metadata-action@v3 + - uses: docker/metadata-action@v5 name: Extract metadata (tags, labels) and establish version id: meta with: @@ -63,13 +63,13 @@ jobs: type=ref,event=pr - name: Log in to the container registry (${{ env.REGISTRY }}) - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - uses: docker/build-push-action@v2 + - uses: docker/build-push-action@v6 name: Build and push image with: build-args: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 94206fc94..25d18fe92 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,17 +14,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x - id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v2 + - uses: actions/cache@v4 id: yarn-cache with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} @@ -36,23 +36,23 @@ jobs: run: yarn install --non-interactive --frozen-lockfile --prefer-offline - name: Test - run: yarn test -- --watch=false --browsers=ChromeHeadless + run: yarn test --watch=false --browsers=ChromeHeadless lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x - id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v2 + - uses: actions/cache@v4 id: yarn-cache with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} @@ -71,9 +71,9 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - uses: docker/metadata-action@v3 + - uses: docker/metadata-action@v5 name: Extract metadata (tags, labels) and establish version id: meta with: @@ -81,7 +81,7 @@ jobs: tags: | type=ref,event=pr - - uses: docker/build-push-action@v2 + - uses: docker/build-push-action@v6 name: Build and push image with: build-args: | diff --git a/.yarnrc b/.yarnrc deleted file mode 100644 index 8c08f9074..000000000 --- a/.yarnrc +++ /dev/null @@ -1,2 +0,0 @@ -network-timeout 100000 -registry "https://registry.npmjs.org" diff --git a/Dockerfile b/Dockerfile index 1872a2773..05fad14e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,33 +1,23 @@ -FROM node:20.11-alpine as build +FROM node:20-alpine as build -ARG BASE_HREF=/veidemann/ ARG VERSION -# Install git because git dependency in package.json -# Install gettext because envsubst -RUN apk add --update --no-cache git gettext - -COPY package.json yarn.lock .yarnrc /usr/src/app/ WORKDIR /usr/src/app + +COPY package.json yarn.lock ./ + RUN yarn install --non-interactive --frozen-lockfile COPY . . -# Give the application a version RUN sed -i "s/version: ''/version: '${VERSION}'/" src/environments/*.ts -RUN yarn ng build \ ---configuration production \ ---base-href=${BASE_HREF} \ ---output-path=dist/${BASE_HREF} - -# Configure nginx location -RUN envsubst \$BASE_HREF < nginx/default.template.conf > nginx/default.conf +RUN yarn ng build --configuration production FROM nginx:stable-alpine LABEL maintainer="nettarkivet@nb.no" -COPY --from=build /usr/src/app/dist /usr/share/nginx/app +COPY --from=build /usr/src/app/dist /usr/share/nginx COPY --from=build /usr/src/app/nginx/default.conf /etc/nginx/conf.d/ diff --git a/angular.json b/angular.json index a7d54fbb9..5a2e2b7a6 100644 --- a/angular.json +++ b/angular.json @@ -17,8 +17,10 @@ "build": { "builder": "@angular-devkit/build-angular:application", "options": { + "baseHref": "/veidemann/", "outputPath": { - "base": "dist" + "base": "dist/app", + "browser": "veidemann" }, "index": "src/index.html", "tsConfig": "tsconfig.app.json", diff --git a/nginx/default.template.conf b/nginx/default.conf similarity index 52% rename from nginx/default.template.conf rename to nginx/default.conf index 106189f70..218ecc28a 100644 --- a/nginx/default.template.conf +++ b/nginx/default.conf @@ -3,7 +3,7 @@ server { root /usr/share/nginx/app; index index.html; - location ${BASE_HREF} { - try_files $uri $uri/ ${BASE_HREF}/index.html =404; + location /veidemann { + try_files $uri $uri/ /veidemann/index.html =404; } } diff --git a/package.json b/package.json index 8fe2edf63..0fe3b0cea 100644 --- a/package.json +++ b/package.json @@ -16,78 +16,71 @@ "extract-i18n": "ng xi18n --output-path src/locale --locale no && xliffmerge --profile xliffmerge.json no en" }, "dependencies": { - "@angular-material-components/datetime-picker": "^16.0.1", - "@angular-material-components/moment-adapter": "^16.0.1", - "@angular/animations": "^18.1.4", - "@angular/cdk": "^18.1.4", - "@angular/common": "^18.1.4", - "@angular/compiler": "^18.1.4", - "@angular/core": "^18.1.4", + "@angular/animations": "^19.1.5", + "@angular/cdk": "^19.1.3", + "@angular/common": "^19.1.5", + "@angular/compiler": "^19.1.5", + "@angular/core": "^19.1.5", "@angular/flex-layout": "^15.0.0-beta.42", - "@angular/forms": "^18.1.4", - "@angular/localize": "^18.1.4", - "@angular/material": "^18.1.4", - "@angular/material-moment-adapter": "^18.1.4", - "@angular/platform-browser": "^18.1.4", - "@angular/platform-browser-dynamic": "^18.1.4", - "@angular/router": "^18.1.4", - "@casl/ability": "^6.7.1", - "@casl/angular": "^8.2.7", - "@fullcalendar/angular": "^6.1.15", + "@angular/forms": "^19.1.5", + "@angular/localize": "^19.1.5", + "@angular/material": "^19.1.3", + "@angular/platform-browser": "^19.1.5", + "@angular/platform-browser-dynamic": "^19.1.5", + "@angular/router": "^19.1.5", + "@casl/ability": "^6.7.3", + "@casl/angular": "^9.0.3", + "@fullcalendar/angular": "^6.1.16", "@fullcalendar/core": "^6.1.15", "@fullcalendar/daygrid": "^6.1.15", "@fullcalendar/interaction": "^6.1.15", "@fullcalendar/timegrid": "^6.1.15", "@materia-ui/ngx-monaco-editor": "^6.0.0", - "@ngneat/spectator": "^19.0.0", - "@types/moment-duration-format": "^2.2.6", - "@types/prismjs": "^1.26.4", - "angular-oauth2-oidc": "~17.0.2", + "@ngneat/spectator": "^19.4.1", + "@types/prismjs": "^1.26.5", + "angular-oauth2-oidc": "~19.0.0", "angular-oauth2-oidc-jwks": "^17.0.2", "chroma-js": "^2.6.0", "cron-parser": "^4.9.0", - "echarts": "^5.5.1", + "dayjs": "^1.11.13", + "echarts": "^5.6.0", "filesize": "^9.0.11", - "google-protobuf": "^3.21.2", + "google-protobuf": "^3.21.4", "grpc-web": "^1.5.0", - "hammerjs": "^2.0.8", "ip-address": "^9.0.5", "minimist": "~1.2.8", - "moment": "^2.30.1", - "moment-duration-format": "^2.3.2", - "moment-timezone": "^0.5.45", - "monaco-editor": "^0.50.0", + "monaco-editor": "^0.52.2", "ng-keyboard-shortcuts": "^13.0.8", - "ng-mocks": "^14.13.0", - "ngx-echarts": "^18.0.0", + "ng-mocks": "^14.13.2", + "ngx-echarts": "^19.0.0", "ngx-filesize": "^3.0.4", "prismjs": "^1.29.0", "rxjs": "~7.8.1", - "tslib": "^2.6.3", - "zone.js": "~0.14.10" + "tslib": "^2.8.1", + "zone.js": "~0.15.0" }, "resolutions": { "minimist": "~1.2.5" }, "devDependencies": { - "@angular-devkit/build-angular": "^18.1.4", - "@angular-eslint/builder": "^18.3.0", - "@angular-eslint/eslint-plugin": "^18.3.0", - "@angular-eslint/eslint-plugin-template": "^18.3.0", - "@angular-eslint/schematics": "^18.2.0", - "@angular-eslint/template-parser": "^18.3.0", - "@angular/cli": "^18.1.4", - "@angular/compiler-cli": "^18.1.4", - "@angular/language-service": "^18.1.4", + "@angular-devkit/build-angular": "^19.1.6", + "@angular-eslint/builder": "^19.1.0", + "@angular-eslint/eslint-plugin": "^19.1.0", + "@angular-eslint/eslint-plugin-template": "^19.1.0", + "@angular-eslint/schematics": "^19.1.0", + "@angular-eslint/template-parser": "^19.1.0", + "@angular/cli": "^19.1.6", + "@angular/compiler-cli": "^19.1.5", + "@angular/language-service": "^19.1.5", "@juggle/resize-observer": "^3.4.0", "@types/google-protobuf": "^3.15.12", - "@types/jasmine": "~5.1.4", + "@types/jasmine": "~5.1.5", "@types/jasminewd2": "~2.0.13", - "@types/node": "^20.8.9", - "@typescript-eslint/eslint-plugin": "^8.1.0", - "@typescript-eslint/parser": "^8.1.0", - "eslint": "^9.9.0", - "jasmine-core": "~5.2.0", + "@types/node": "^22.0.3", + "@typescript-eslint/eslint-plugin": "^8.24.0", + "@typescript-eslint/parser": "^8.24.0", + "eslint": "^9.20.0", + "jasmine-core": "~5.6.0", "jasmine-spec-reporter": "~7.0.0", "karma": "~6.4.4", "karma-chrome-launcher": "~3.2.0", diff --git a/src/app/components/about-dialog/about-dialog.component.ts b/src/app/components/about-dialog/about-dialog.component.ts index 76e957e39..7ed28821c 100644 --- a/src/app/components/about-dialog/about-dialog.component.ts +++ b/src/app/components/about-dialog/about-dialog.component.ts @@ -2,9 +2,10 @@ import {Component} from '@angular/core'; import {environment} from '../../../environments/environment'; @Component({ - selector: 'app-about-dialog', - templateUrl: './about-dialog.component.html', - styleUrls: ['./about-dialog.component.css'] + selector: 'app-about-dialog', + templateUrl: './about-dialog.component.html', + styleUrls: ['./about-dialog.component.css'], + standalone: false }) export class AboutDialogComponent { diff --git a/src/app/components/app/app.component.html b/src/app/components/app/app.component.html index bca8334f6..c1d1b1902 100644 --- a/src/app/components/app/app.component.html +++ b/src/app/components/app/app.component.html @@ -1,101 +1,104 @@
- - - - - + + + + + + - + - + - + - - help - - - Docs - About - + + help + + + Docs + About + - + - - + + - -
-

Loading module...

- -
+
+

Loading module...

+ +
- -
- - - -
+ +
+ + + +
+
diff --git a/src/app/components/app/app.component.ts b/src/app/components/app/app.component.ts index 7704ac620..038d6654b 100644 --- a/src/app/components/app/app.component.ts +++ b/src/app/components/app/app.component.ts @@ -1,22 +1,30 @@ import {AfterViewInit, ChangeDetectionStrategy, Component, OnInit} from '@angular/core'; -import {ActivatedRoute, RouteConfigLoadEnd, RouteConfigLoadStart, Router, RouterEvent} from '@angular/router'; +import {ActivatedRoute, RouteConfigLoadEnd, RouteConfigLoadStart, Router} from '@angular/router'; import {Observable} from 'rxjs'; import {filter, map} from 'rxjs/operators'; -import {AppInitializerService, ControllerApiService, ErrorService, SnackBarService} from '../../../modules/core/services'; +import { + AppInitializerService, + ControllerApiService, + ErrorService, + SnackBarService +} from '../../../modules/core/services'; import {AuthService, GuardService} from '../../../modules/core/services/auth'; import {MatDialog} from '@angular/material/dialog'; import {AboutDialogComponent} from '../about-dialog/about-dialog.component'; import {ShortcutEventOutput, ShortcutInput} from 'ng-keyboard-shortcuts'; import {ScheduleOverviewComponent} from '../schedule-overview/schedule-overview.component'; +import {AbilityService} from "@casl/angular"; @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class AppComponent implements OnInit, AfterViewInit { + readonly ability$: Observable; isModuleLoading$: Observable; private moduleLoadSemaphore = 0; @@ -30,7 +38,9 @@ export class AppComponent implements OnInit, AfterViewInit { private guardService: GuardService, private snackBarService: SnackBarService, private dialog: MatDialog, - private errorService: ErrorService) { + private errorService: ErrorService, + private abilityService: AbilityService) { + this.ability$ = this.abilityService.ability$; this.isModuleLoading$ = this.router.events.pipe( filter(event => event instanceof RouteConfigLoadStart || event instanceof RouteConfigLoadEnd), map(event => { diff --git a/src/app/components/crawlerstatus-dialog/crawlerstatus-dialog.component.ts b/src/app/components/crawlerstatus-dialog/crawlerstatus-dialog.component.ts index 28fc295d6..5045f7fa0 100644 --- a/src/app/components/crawlerstatus-dialog/crawlerstatus-dialog.component.ts +++ b/src/app/components/crawlerstatus-dialog/crawlerstatus-dialog.component.ts @@ -2,10 +2,11 @@ import {ChangeDetectionStrategy, Component, Inject} from '@angular/core'; import {MAT_DIALOG_DATA} from '@angular/material/dialog'; @Component({ - selector: 'app-crawlerstatus-dialog', - templateUrl: './crawlerstatus-dialog.component.html', - styleUrls: ['./crawlerstatus-dialog.component.css'], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-crawlerstatus-dialog', + templateUrl: './crawlerstatus-dialog.component.html', + styleUrls: ['./crawlerstatus-dialog.component.css'], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class CrawlerStatusDialogComponent { shouldPause: boolean; diff --git a/src/app/components/crawlerstatus/crawlerstatus.component.html b/src/app/components/crawlerstatus/crawlerstatus.component.html index 15fd67758..f7a7f8bb7 100644 --- a/src/app/components/crawlerstatus/crawlerstatus.component.html +++ b/src/app/components/crawlerstatus/crawlerstatus.component.html @@ -1,11 +1,12 @@
+

Crawler status

RUNNING

diff --git a/src/app/components/crawlerstatus/crawlerstatus.component.ts b/src/app/components/crawlerstatus/crawlerstatus.component.ts index e24c546d1..7e784926a 100644 --- a/src/app/components/crawlerstatus/crawlerstatus.component.ts +++ b/src/app/components/crawlerstatus/crawlerstatus.component.ts @@ -1,16 +1,24 @@ import {ChangeDetectionStrategy, Component, EventEmitter, Input, Output} from '@angular/core'; import {RunStatus} from '../../../shared/models/controller'; import {CrawlerStatus} from '../../../shared/models/controller/controller.model'; +import {Observable} from "rxjs"; +import {AbilityService} from "@casl/angular"; @Component({ - selector: 'app-crawlerstatus', - templateUrl: './crawlerstatus.component.html', - styleUrls: ['./crawlerstatus.component.css'], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-crawlerstatus', + templateUrl: './crawlerstatus.component.html', + styleUrls: ['./crawlerstatus.component.css'], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class CrawlerStatusComponent { readonly RunStatus = RunStatus; + readonly ability$: Observable; + + constructor(private abilityService: AbilityService) { + this.ability$ = this.abilityService.ability$; + } @Input() crawlerStatus: CrawlerStatus; diff --git a/src/app/components/dialog/dialog.component.ts b/src/app/components/dialog/dialog.component.ts index 884973c97..de9f2f8fb 100644 --- a/src/app/components/dialog/dialog.component.ts +++ b/src/app/components/dialog/dialog.component.ts @@ -9,9 +9,10 @@ import {ErrorService} from '../../../modules/core/services'; @Component({ - selector: 'app-dialog', - template: '', - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-dialog', + template: '', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class DialogComponent implements OnInit, OnDestroy { diff --git a/src/app/components/error-dialog/error-dialog.component.ts b/src/app/components/error-dialog/error-dialog.component.ts index 1247e1343..872fbdb9c 100644 --- a/src/app/components/error-dialog/error-dialog.component.ts +++ b/src/app/components/error-dialog/error-dialog.component.ts @@ -2,14 +2,15 @@ import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog'; import {ChangeDetectionStrategy, Component, Inject} from '@angular/core'; @Component({ - selector: 'app-error-dialog', - template: `

{{title}}

+ selector: 'app-error-dialog', + template: `

{{title}}

{{content}}
`, - changeDetection: ChangeDetectionStrategy.OnPush, + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class ErrorDialogComponent { title: string; diff --git a/src/app/components/home/home.component.html b/src/app/components/home/home.component.html index 3eb6422a5..deb60af5e 100644 --- a/src/app/components/home/home.component.html +++ b/src/app/components/home/home.component.html @@ -1,9 +1,12 @@ -
+ +
- + (changeRunStatus)="onChangeRunStatus($event)"> +
+
diff --git a/src/app/components/home/home.component.ts b/src/app/components/home/home.component.ts index 50a349afa..81fa7f84d 100644 --- a/src/app/components/home/home.component.ts +++ b/src/app/components/home/home.component.ts @@ -5,20 +5,25 @@ import {ControllerApiService, ErrorService} from '../../../modules/core/services import {CrawlerStatusDialogComponent} from '../index'; import {MatDialog} from '@angular/material/dialog'; import {CrawlerStatus} from '../../../shared/models/controller/controller.model'; +import {AbilityService} from "@casl/angular"; @Component({ - selector: 'app-home', - templateUrl: './home.component.html', - styleUrls: ['./home.component.css'] + selector: 'app-home', + templateUrl: './home.component.html', + styleUrls: ['./home.component.css'], + standalone: false }) export class HomeComponent implements OnInit { + readonly ability$: Observable; updateRunStatus: Subject = new Subject(); crawlerStatus$: Observable; constructor(private errorService: ErrorService, private controllerApiService: ControllerApiService, - private dialog: MatDialog) { + private dialog: MatDialog, + private abilityService: AbilityService) { + this.ability$ = this.abilityService.ability$; } ngOnInit(): void { diff --git a/src/app/components/schedule-event-dialog/schedule-event-dialog.component.ts b/src/app/components/schedule-event-dialog/schedule-event-dialog.component.ts index 84c557277..d36914c45 100644 --- a/src/app/components/schedule-event-dialog/schedule-event-dialog.component.ts +++ b/src/app/components/schedule-event-dialog/schedule-event-dialog.component.ts @@ -2,9 +2,10 @@ import {Component, Inject} from '@angular/core'; import {MAT_DIALOG_DATA} from '@angular/material/dialog'; @Component({ - selector: 'app-schedule-event-dialog', - templateUrl: './schedule-event-dialog.component.html', - styleUrls: ['./schedule-event-dialog.component.css'] + selector: 'app-schedule-event-dialog', + templateUrl: './schedule-event-dialog.component.html', + styleUrls: ['./schedule-event-dialog.component.css'], + standalone: false }) export class ScheduleEventDialogComponent { diff --git a/src/app/components/schedule-overview/schedule-overview.component.ts b/src/app/components/schedule-overview/schedule-overview.component.ts index b090d6c50..a5bf6bf48 100644 --- a/src/app/components/schedule-overview/schedule-overview.component.ts +++ b/src/app/components/schedule-overview/schedule-overview.component.ts @@ -16,14 +16,17 @@ import {takeUntil, toArray} from 'rxjs/operators'; import * as cronParser from 'cron-parser'; import {MatDialog} from '@angular/material/dialog'; import {ScheduleEventDialogComponent} from '../schedule-event-dialog/schedule-event-dialog.component'; -import * as momentTimezone from 'moment-timezone'; -import moment from 'moment'; import {colorScales} from './colors'; import {DateClickArg} from '@fullcalendar/interaction'; import {CalendarOptions, EventClickArg} from '@fullcalendar/core'; import dayGridPlugin from '@fullcalendar/daygrid'; import timeGridPlugin from '@fullcalendar/timegrid'; import interactionPlugin from '@fullcalendar/interaction'; +import dayjs from 'dayjs' +import timezone from 'dayjs/plugin/timezone' +import isBetween from 'dayjs/plugin/isBetween' +dayjs.extend(timezone) +dayjs.extend(isBetween) interface ScheduledJob { crawlJobName: string; @@ -40,12 +43,13 @@ interface ScheduleValidRange { } @Component({ - selector: 'app-schedule-overview', - templateUrl: './schedule-overview.component.html', - styleUrls: ['./schedule-overview.component.css'], - providers: [ConfigApiService], - changeDetection: ChangeDetectionStrategy.OnPush, - encapsulation: ViewEncapsulation.Emulated, + selector: 'app-schedule-overview', + templateUrl: './schedule-overview.component.html', + styleUrls: ['./schedule-overview.component.css'], + providers: [ConfigApiService], + changeDetection: ChangeDetectionStrategy.OnPush, + encapsulation: ViewEncapsulation.Emulated, + standalone: false }) export class ScheduleOverviewComponent implements OnInit, OnDestroy { private crawlJobs: ConfigObject[]; @@ -189,7 +193,7 @@ export class ScheduleOverviewComponent implements OnInit, OnDestroy { endDate: new Date(this.viewDate.getFullYear(), this.viewDate.getMonth() + 1, 1), utc: true, iterator: true, - tz: momentTimezone.tz.guess(), + tz: dayjs.tz.guess(), }; const prevOptions = { @@ -197,7 +201,7 @@ export class ScheduleOverviewComponent implements OnInit, OnDestroy { endDate: this.viewDate, iterator: true, utc: true, - tz: momentTimezone.tz.guess(), + tz: dayjs.tz.guess(), }; const schedule = []; @@ -312,9 +316,9 @@ export class ScheduleOverviewComponent implements OnInit, OnDestroy { } private isDateInRange(startDate: string, validRange: ScheduleValidRange) { - const eventStart = moment(startDate); - const validFrom = validRange.validFrom ? moment(validRange.validFrom) : moment().startOf('year'); - const validTo = validRange.validTo ? moment(validRange.validTo) : moment().endOf('year'); - return moment(eventStart).isBetween(validFrom, validTo); + const eventStart = dayjs(startDate); + const validFrom = validRange.validFrom ? dayjs(validRange.validFrom) : dayjs().startOf('year'); + const validTo = validRange.validTo ? dayjs(validRange.validTo) : dayjs().endOf('year'); + return dayjs(eventStart).isBetween(validFrom, validTo); } } diff --git a/src/app/components/time/time.component.ts b/src/app/components/time/time.component.ts index ff4c1462d..be57f09ad 100644 --- a/src/app/components/time/time.component.ts +++ b/src/app/components/time/time.component.ts @@ -4,10 +4,11 @@ import {map} from 'rxjs/operators'; @Component({ - selector: 'app-time', - template: `{{time$ | async | date: 'long': 'UTC'}}`, - styleUrls: ['./time.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + selector: 'app-time', + template: `{{time$ | async | date: 'long': 'UTC'}}`, + styleUrls: ['./time.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class TimeComponent { time$: Observable; diff --git a/src/assets/config.json b/src/assets/config.json index 46dbc8038..d9c316ce9 100644 --- a/src/assets/config.json +++ b/src/assets/config.json @@ -5,7 +5,7 @@ "redirectUri": "https://localhost:4200/", "requestAccessToken": false, "oidc": true, - "responseType": "id_token", + "responseType": "code", "clientId": "veidemann-dashboard", "scope": "openid profile email groups offline_access audience:server:client_id:veidemann-api", "requireHttps": true diff --git a/src/assets/logo/veidemann_horizontal_white.png b/src/assets/logo/veidemann_horizontal_white.png index dbb7b4f86..a85807b56 100644 Binary files a/src/assets/logo/veidemann_horizontal_white.png and b/src/assets/logo/veidemann_horizontal_white.png differ diff --git a/src/assets/logo/veidemann_logo_inline_black.png b/src/assets/logo/veidemann_logo_inline_black.png index 6b6b66e2a..313d2d1c8 100644 Binary files a/src/assets/logo/veidemann_logo_inline_black.png and b/src/assets/logo/veidemann_logo_inline_black.png differ diff --git a/src/main.ts b/src/main.ts index cf93fdd31..d80a61d4d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,7 +2,6 @@ import {enableProdMode} from '@angular/core'; import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; -import 'hammerjs'; import {AppModule} from './app/app.module'; import {environment} from './environments/environment'; diff --git a/src/modules/commons/commons.module.ts b/src/modules/commons/commons.module.ts index bec6365a0..ae8e2b4ba 100644 --- a/src/modules/commons/commons.module.ts +++ b/src/modules/commons/commons.module.ts @@ -9,7 +9,6 @@ import {ActionDirective, ExtraDirective, FilterDirective, HighlightDirective, Sh import {NgxFilesizeModule} from 'ngx-filesize'; import {DurationFormatPipe} from './pipes/duration-format.pipe'; import {UrlFormatPipe} from './pipes/url-format.pipe'; -import {AbilityModule} from '@casl/angular'; import {KeyboardShortcutsModule} from 'ng-keyboard-shortcuts'; @@ -32,7 +31,6 @@ import {KeyboardShortcutsModule} from 'ng-keyboard-shortcuts'; RouterModule, DragDropModule, NgxFilesizeModule, - AbilityModule, KeyboardShortcutsModule, ], exports: [ @@ -50,7 +48,6 @@ import {KeyboardShortcutsModule} from 'ng-keyboard-shortcuts'; DurationFormatPipe, HighlightDirective, UrlFormatPipe, - AbilityModule, KeyboardShortcutsModule, ], providers: [ diff --git a/src/modules/commons/components/base-list/base-list.ts b/src/modules/commons/components/base-list/base-list.ts index 892161356..6c2ff6553 100644 --- a/src/modules/commons/components/base-list/base-list.ts +++ b/src/modules/commons/components/base-list/base-list.ts @@ -24,7 +24,7 @@ import {ShortcutEventOutput, ShortcutInput} from 'ng-keyboard-shortcuts'; @Directive() // eslint-disable-next-line @angular-eslint/directive-class-suffix -export abstract class BaseListComponent implements OnChanges, AfterViewInit { +export abstract class BaseListComponent implements AfterViewInit { readonly Kind = Kind; length$: BehaviorSubject; @@ -117,16 +117,6 @@ export abstract class BaseListComponent implements OnChanges this.length$ = new BehaviorSubject(0); } - ngOnChanges(changes: SimpleChanges): void { - if (changes.sortDirection && changes.sortActive) { - // ugly hack see https://github.com/angular/components/issues/10242 and https://github.com/angular/components/issues/10524 - const sortHeader = (this.matSort.sortables.get(this.sortActive) as MatSortHeader); - if (sortHeader) { - sortHeader._setAnimationTransitionState({toState: 'active'}); - } - } - } - ngAfterViewInit() { this.shortcuts.push( diff --git a/src/modules/commons/directives/action.directive.ts b/src/modules/commons/directives/action.directive.ts index 6e5483fde..1ca6dd5fe 100644 --- a/src/modules/commons/directives/action.directive.ts +++ b/src/modules/commons/directives/action.directive.ts @@ -1,7 +1,8 @@ import {Directive} from '@angular/core'; @Directive({ - selector: '[appAction]' + selector: '[appAction]', + standalone: false }) export class ActionDirective { } diff --git a/src/modules/commons/directives/extra.directive.ts b/src/modules/commons/directives/extra.directive.ts index 915aefc96..632dfcf16 100644 --- a/src/modules/commons/directives/extra.directive.ts +++ b/src/modules/commons/directives/extra.directive.ts @@ -1,7 +1,8 @@ import {Directive} from '@angular/core'; @Directive({ - selector: '[appExtra]' + selector: '[appExtra]', + standalone: false }) export class ExtraDirective { } diff --git a/src/modules/commons/directives/filter.directive.ts b/src/modules/commons/directives/filter.directive.ts index 98c3e048b..150f87804 100644 --- a/src/modules/commons/directives/filter.directive.ts +++ b/src/modules/commons/directives/filter.directive.ts @@ -1,7 +1,8 @@ import {Directive} from '@angular/core'; @Directive({ - selector: '[appFilter]' + selector: '[appFilter]', + standalone: false }) export class FilterDirective { diff --git a/src/modules/commons/directives/prismjs.directive.ts b/src/modules/commons/directives/prismjs.directive.ts index feb80687f..c76eb9cb2 100644 --- a/src/modules/commons/directives/prismjs.directive.ts +++ b/src/modules/commons/directives/prismjs.directive.ts @@ -7,7 +7,8 @@ import 'prismjs/components/prism-python'; // import 'prismjs/plugins/match-braces/prism-match-braces'; @Directive({ - selector: '[appHighlight]' + selector: '[appHighlight]', + standalone: false }) export class HighlightDirective implements AfterViewChecked { private done = false; diff --git a/src/modules/commons/directives/shortcut.directive.ts b/src/modules/commons/directives/shortcut.directive.ts index a38dc532e..bd31a56f9 100644 --- a/src/modules/commons/directives/shortcut.directive.ts +++ b/src/modules/commons/directives/shortcut.directive.ts @@ -1,7 +1,8 @@ import {Directive} from '@angular/core'; @Directive({ - selector: '[appShortcut]' + selector: '[appShortcut]', + standalone: false }) export class ShortcutDirective { } diff --git a/src/modules/commons/material.module.ts b/src/modules/commons/material.module.ts index 211d3c1ec..76a5777af 100644 --- a/src/modules/commons/material.module.ts +++ b/src/modules/commons/material.module.ts @@ -24,14 +24,15 @@ import {MatSortModule} from '@angular/material/sort'; import {MatTableModule} from '@angular/material/table'; import {MatToolbarModule} from '@angular/material/toolbar'; import {MatTooltipModule} from '@angular/material/tooltip'; -import {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MatMomentDateModule} from '@angular/material-moment-adapter'; import {MatAutocompleteModule} from '@angular/material/autocomplete'; import {MatTreeModule} from '@angular/material/tree'; import {MatTabsModule} from '@angular/material/tabs'; import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {NgxMatDatetimePickerModule, NgxMatTimepickerModule} from '@angular-material-components/datetime-picker'; -import {NgxMatMomentModule} from '@angular-material-components/moment-adapter'; -import {MAT_FORM_FIELD_DEFAULT_OPTIONS} from '@angular/material/form-field'; +import {MatTimepickerModule} from "@angular/material/timepicker"; +import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from "@angular/material/core"; +import {DayjsDateAdapter, MAT_DAYJS_DATE_ADAPTER_OPTIONS, MAT_DAYJS_DATE_FORMATS} from "../dayjs-date-adapter"; +import {MAT_FORM_FIELD_DEFAULT_OPTIONS} from "@angular/material/form-field"; +import {LocaleService} from "../core/services"; const modules = [ MatTabsModule, @@ -56,7 +57,6 @@ const modules = [ MatPaginatorModule, MatSortModule, MatDatepickerModule, - MatMomentDateModule, MatButtonToggleModule, MatProgressBarModule, MatBadgeModule, @@ -64,17 +64,26 @@ const modules = [ MatAutocompleteModule, MatTreeModule, MatProgressSpinnerModule, - NgxMatDatetimePickerModule, - NgxMatTimepickerModule, - NgxMatMomentModule, + MatTimepickerModule, ]; @NgModule({ imports: modules, exports: modules, providers: [ - {provide: MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: 'no-NO'}, - {provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: {floatLabel: 'auto'}} + { + provide: DateAdapter, + useClass: DayjsDateAdapter, + deps: [MAT_DATE_LOCALE, MAT_DAYJS_DATE_ADAPTER_OPTIONS] + }, + {provide: MAT_DAYJS_DATE_ADAPTER_OPTIONS, useValue: {useUtc: false, strict: true}}, + {provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: {floatLabel: 'auto'}}, + {provide: MAT_DATE_FORMATS, useValue: MAT_DAYJS_DATE_FORMATS}, + { + provide: MAT_DATE_LOCALE, + useFactory: (localeService: LocaleService) => localeService.getLocale(), + deps: [LocaleService] + }, ] }) export class MaterialModule { diff --git a/src/modules/commons/pipes/duration-format.pipe.spec.ts b/src/modules/commons/pipes/duration-format.pipe.spec.ts deleted file mode 100644 index 810ff005a..000000000 --- a/src/modules/commons/pipes/duration-format.pipe.spec.ts +++ /dev/null @@ -1,28 +0,0 @@ -import {DurationFormatPipe} from './duration-format.pipe'; - -describe('DurationFormatPipe', () => { - // This pipe is a pure, stateless function so no need for BeforeEach - // TODO: Would be better to test the datetime-function. - const pipe = new DurationFormatPipe(); - - it('transforms 10 to 10s', () => { - expect(pipe.transform(10, 's')).toBe('10s'); - }); - - it('transforms 70 to 1min:10s', () => { - expect(pipe.transform(70, 's')).toBe('1min:10s'); - }); - - it('transforms 31536000 s to 1 year', () => { - expect(pipe.transform(31536000, 's')).toBe('365days'); - }); - - it('transforms 100 ms to 100ms', () => { - expect(pipe.transform(100, 'ms')).toBe('100ms'); - }); - - it('transforms 2000 ms to 2s', () => { - expect(pipe.transform(2000, 'ms')).toBe('2s'); - }); - -}); diff --git a/src/modules/commons/pipes/duration-format.pipe.ts b/src/modules/commons/pipes/duration-format.pipe.ts index ee12ddbda..c659b39a1 100644 --- a/src/modules/commons/pipes/duration-format.pipe.ts +++ b/src/modules/commons/pipes/duration-format.pipe.ts @@ -2,7 +2,8 @@ import {Pipe, PipeTransform} from '@angular/core'; import {timeToDuration} from '../../../shared/func'; @Pipe({ - name: 'durationFormat' + name: 'durationFormat', + standalone: false }) export class DurationFormatPipe implements PipeTransform { diff --git a/src/modules/commons/pipes/url-format.pipe.ts b/src/modules/commons/pipes/url-format.pipe.ts index 31b3c12c7..e36acd66d 100644 --- a/src/modules/commons/pipes/url-format.pipe.ts +++ b/src/modules/commons/pipes/url-format.pipe.ts @@ -3,7 +3,8 @@ import {DomSanitizer, SafeHtml} from '@angular/platform-browser'; import {SedPipe} from '../../report/pipe/sed.pipe'; @Pipe({ - name: 'urlFormat' + name: 'urlFormat', + standalone: false }) export class UrlFormatPipe implements PipeTransform { diff --git a/src/modules/config/components/annotation/annotation.component.html b/src/modules/config/components/annotation/annotation.component.html index bf1c04027..0b4076207 100644 --- a/src/modules/config/components/annotation/annotation.component.html +++ b/src/modules/config/components/annotation/annotation.component.html @@ -1,66 +1,68 @@ -
-
- - Annotation - - - - {{group.key + ':' + value}} - cancel - - - - - -
+ +
+
+ + Annotation + + + + {{ group.key + ':' + value }} + cancel + + + + + +
-
- - - note - Edit annotation - - - - - - Can't be empty or contain a colon. - - - - - - Can't be empty. - - - + + + + note + Edit annotation + + + + + + Can't be empty or contain a colon. + + + + + + Can't be empty. + + + - - - - - - -
+ + + + + + +
+ diff --git a/src/modules/config/components/annotation/annotation.component.spec.ts b/src/modules/config/components/annotation/annotation.component.spec.ts index 3ed7c2d07..ad10e56ff 100644 --- a/src/modules/config/components/annotation/annotation.component.spec.ts +++ b/src/modules/config/components/annotation/annotation.component.spec.ts @@ -4,7 +4,6 @@ import {AnnotationComponent} from './annotation.component'; import {UntypedFormBuilder} from '@angular/forms'; import {AuthService} from '../../../core/services/auth'; import {CoreTestingModule} from '../../../core/core.testing.module'; -import {AbilityModule} from '@casl/angular'; describe('AnnotationComponent', () => { let component: AnnotationComponent; @@ -12,7 +11,7 @@ describe('AnnotationComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CoreTestingModule.forRoot(), AbilityModule], + imports: [CoreTestingModule.forRoot()], providers: [UntypedFormBuilder, { provide: AuthService, diff --git a/src/modules/config/components/annotation/annotation.component.ts b/src/modules/config/components/annotation/annotation.component.ts index e3b2aedce..e01e932ec 100644 --- a/src/modules/config/components/annotation/annotation.component.ts +++ b/src/modules/config/components/annotation/annotation.component.ts @@ -15,15 +15,18 @@ import {MatChipInputEvent} from '@angular/material/chips'; import {NO_COLON} from '../../../../shared/validation/patterns'; import {BehaviorSubject, Observable} from 'rxjs'; import {AuthService} from '../../../core/services/auth'; +import {AbilityService} from "@casl/angular"; @Component({ - selector: 'app-annotation', - templateUrl: './annotation.component.html', - styleUrls: ['./annotation.component.css'], - providers: [{provide: NG_VALUE_ACCESSOR, useExisting: AnnotationComponent, multi: true}], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-annotation', + templateUrl: './annotation.component.html', + styleUrls: ['./annotation.component.css'], + providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: AnnotationComponent, multi: true }], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class AnnotationComponent implements ControlValueAccessor, OnInit { + readonly ability$: Observable; @Input() removable = true; @@ -49,8 +52,10 @@ export class AnnotationComponent implements ControlValueAccessor, OnInit { constructor(protected fb: UntypedFormBuilder, protected cdr: ChangeDetectorRef, - protected authService: AuthService) { + protected authService: AuthService, + private abilityService: AbilityService) { this.createForm(); + this.ability$ = this.abilityService.ability$; } get canEdit(): boolean { diff --git a/src/modules/config/components/annotation/script-annotation/script-annotation.component.html b/src/modules/config/components/annotation/script-annotation/script-annotation.component.html index 2ac7275f0..404e916ec 100644 --- a/src/modules/config/components/annotation/script-annotation/script-annotation.component.html +++ b/src/modules/config/components/annotation/script-annotation/script-annotation.component.html @@ -1,7 +1,9 @@ -
+ +
{{annotation.key}}:{{annotation.value}}
+
diff --git a/src/modules/config/components/annotation/script-annotation/script-annotation.component.spec.ts b/src/modules/config/components/annotation/script-annotation/script-annotation.component.spec.ts index 0caf72d39..f19d1a94b 100644 --- a/src/modules/config/components/annotation/script-annotation/script-annotation.component.spec.ts +++ b/src/modules/config/components/annotation/script-annotation/script-annotation.component.spec.ts @@ -1,7 +1,6 @@ import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; import {UntypedFormBuilder} from '@angular/forms'; -import {AbilityModule} from '@casl/angular'; import {AuthService} from '../../../../core/services/auth'; import {CoreTestingModule} from '../../../../core/core.testing.module'; import {ScriptAnnotationComponent} from './script-annotation.component'; @@ -12,7 +11,7 @@ describe('ScriptAnnotationComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CoreTestingModule.forRoot(), AbilityModule], + imports: [CoreTestingModule.forRoot()], providers: [UntypedFormBuilder, { provide: AuthService, diff --git a/src/modules/config/components/annotation/script-annotation/script-annotation.component.ts b/src/modules/config/components/annotation/script-annotation/script-annotation.component.ts index 44af9591e..8ac445993 100644 --- a/src/modules/config/components/annotation/script-annotation/script-annotation.component.ts +++ b/src/modules/config/components/annotation/script-annotation/script-annotation.component.ts @@ -1,16 +1,20 @@ import {ChangeDetectionStrategy, Component, Input, OnInit} from '@angular/core'; import {Annotation} from '../../../../../shared/models/config'; +import {Observable} from "rxjs"; +import {AbilityService} from "@casl/angular"; @Component({ - selector: 'app-script-annotation', - templateUrl: './script-annotation.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-script-annotation', + templateUrl: './script-annotation.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class ScriptAnnotationComponent { - +readonly ability$: Observable; @Input() annotations: Annotation[]; - constructor() { + constructor(abilityService: AbilityService) { + this.ability$ = abilityService.ability$; } } diff --git a/src/modules/config/components/browserconfig/browserconfig-details/browserconfig-details.component.spec.ts b/src/modules/config/components/browserconfig/browserconfig-details/browserconfig-details.component.spec.ts index f31cb0000..5099479a5 100644 --- a/src/modules/config/components/browserconfig/browserconfig-details/browserconfig-details.component.spec.ts +++ b/src/modules/config/components/browserconfig/browserconfig-details/browserconfig-details.component.spec.ts @@ -19,7 +19,6 @@ import { Label, Meta } from '../../../../../shared/models'; -import {AbilityModule} from '@casl/angular'; import {AuthService} from '../../../../core/services'; import {ReactiveFormsModule} from '@angular/forms'; import {MockComponent} from 'ng-mocks'; @@ -122,7 +121,6 @@ describe('BrowserConfigDetailsComponent', () => { TestBed.configureTestingModule({ imports: [ ReactiveFormsModule, - AbilityModule, MaterialModule, RouterTestingModule, CoreTestingModule.forRoot(), diff --git a/src/modules/config/components/browserconfig/browserconfig-details/browserconfig-details.component.ts b/src/modules/config/components/browserconfig/browserconfig-details/browserconfig-details.component.ts index e16cc8c45..9714aa097 100644 --- a/src/modules/config/components/browserconfig/browserconfig-details/browserconfig-details.component.ts +++ b/src/modules/config/components/browserconfig/browserconfig-details/browserconfig-details.component.ts @@ -7,9 +7,10 @@ import {UnitOfTime} from '../../../../../shared/models/duration/unit-time.model' @Component({ - selector: 'app-browserconfig-details', - templateUrl: './browserconfig-details.component.html', - changeDetection: ChangeDetectionStrategy.OnPush + selector: 'app-browserconfig-details', + templateUrl: './browserconfig-details.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class BrowserConfigDetailsComponent implements OnChanges { readonly Kind = Kind; diff --git a/src/modules/config/components/browserconfig/browserconfig-dialog/browserconfig-dialog.component.spec.ts b/src/modules/config/components/browserconfig/browserconfig-dialog/browserconfig-dialog.component.spec.ts index c90f33122..964916ed9 100644 --- a/src/modules/config/components/browserconfig/browserconfig-dialog/browserconfig-dialog.component.spec.ts +++ b/src/modules/config/components/browserconfig/browserconfig-dialog/browserconfig-dialog.component.spec.ts @@ -11,7 +11,6 @@ import {ConfigDialogData} from '../../../func'; import {LabelService} from '../../../services'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {of} from 'rxjs'; -import {AbilityModule} from '@casl/angular'; import {CoreTestingModule} from '../../../../core/core.testing.module'; import {AuthService} from '../../../../core/services'; @@ -31,7 +30,6 @@ describe('BrowserConfigDialogComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [CoreTestingModule.forRoot(), - AbilityModule, CommonsModule, NoopAnimationsModule, MatDialogModule, ReactiveFormsModule], diff --git a/src/modules/config/components/browserconfig/browserconfig-dialog/browserconfig-dialog.component.ts b/src/modules/config/components/browserconfig/browserconfig-dialog/browserconfig-dialog.component.ts index 5b634bf46..bee863ac1 100644 --- a/src/modules/config/components/browserconfig/browserconfig-dialog/browserconfig-dialog.component.ts +++ b/src/modules/config/components/browserconfig/browserconfig-dialog/browserconfig-dialog.component.ts @@ -7,9 +7,10 @@ import {ConfigDialogData} from '../../../func'; import {ConfigObject} from '../../../../../shared/models/config'; @Component({ - selector: 'app-browserconfig-dialog', - templateUrl: './browserconfig-dialog.component.html', - styleUrls: ['./browserconfig-dialog.component.css'] + selector: 'app-browserconfig-dialog', + templateUrl: './browserconfig-dialog.component.html', + styleUrls: ['./browserconfig-dialog.component.css'], + standalone: false }) export class BrowserConfigDialogComponent extends BrowserConfigDetailsComponent implements OnInit { diff --git a/src/modules/config/components/browserconfig/browserconfig-multi-dialog/browserconfig-multi-dialog.component.ts b/src/modules/config/components/browserconfig/browserconfig-multi-dialog/browserconfig-multi-dialog.component.ts index 891df58e0..7c896c4a8 100644 --- a/src/modules/config/components/browserconfig/browserconfig-multi-dialog/browserconfig-multi-dialog.component.ts +++ b/src/modules/config/components/browserconfig/browserconfig-multi-dialog/browserconfig-multi-dialog.component.ts @@ -9,10 +9,11 @@ import {NUMBER_OR_EMPTY_STRING} from '../../../../../shared/validation/patterns' import {LabelMultiComponent} from '../../label/label-multi/label-multi.component'; @Component({ - selector: 'app-browserconfig-multi-dialog', - templateUrl: './browserconfig-multi-dialog.component.html', - styleUrls: ['./browserconfig-multi-dialog.component.css'], - changeDetection: ChangeDetectionStrategy.OnPush + selector: 'app-browserconfig-multi-dialog', + templateUrl: './browserconfig-multi-dialog.component.html', + styleUrls: ['./browserconfig-multi-dialog.component.css'], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class BrowserConfigMultiDialogComponent extends BrowserConfigDetailsComponent implements OnInit { diff --git a/src/modules/config/components/browserconfig/browserconfig-preview/browserconfig-preview.component.spec.ts b/src/modules/config/components/browserconfig/browserconfig-preview/browserconfig-preview.component.spec.ts index 8c6cbf699..7f7833696 100644 --- a/src/modules/config/components/browserconfig/browserconfig-preview/browserconfig-preview.component.spec.ts +++ b/src/modules/config/components/browserconfig/browserconfig-preview/browserconfig-preview.component.spec.ts @@ -4,7 +4,6 @@ import {BrowserconfigPreviewComponent} from './browserconfig-preview.component'; import {CommonsModule} from '../../../../commons'; import {ConfigObject, Kind} from '../../../../../shared/models'; import {ShortcutListComponent} from '../../shortcut/shortcut-list/shortcut-list.component'; -import {AbilityModule} from '@casl/angular'; import {CoreTestingModule} from '../../../../core/core.testing.module'; describe('BrowserconfigPreviewComponent', () => { @@ -13,7 +12,7 @@ describe('BrowserconfigPreviewComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommonsModule, CoreTestingModule.forRoot(), AbilityModule], + imports: [CommonsModule, CoreTestingModule.forRoot()], declarations: [BrowserconfigPreviewComponent, ShortcutListComponent], providers: [] }) diff --git a/src/modules/config/components/browserconfig/browserconfig-preview/browserconfig-preview.component.ts b/src/modules/config/components/browserconfig/browserconfig-preview/browserconfig-preview.component.ts index 7c1d6751b..fb497c363 100644 --- a/src/modules/config/components/browserconfig/browserconfig-preview/browserconfig-preview.component.ts +++ b/src/modules/config/components/browserconfig/browserconfig-preview/browserconfig-preview.component.ts @@ -2,9 +2,10 @@ import {Component, Input} from '@angular/core'; import {ConfigObject} from '../../../../../shared/models/config'; @Component({ - selector: 'app-browserconfig-preview', - templateUrl: './browserconfig-preview.component.html', - styleUrls: ['./browserconfig-preview.component.css'] + selector: 'app-browserconfig-preview', + templateUrl: './browserconfig-preview.component.html', + styleUrls: ['./browserconfig-preview.component.css'], + standalone: false }) export class BrowserconfigPreviewComponent { @Input() diff --git a/src/modules/config/components/browserscript/browserscript-details/browserscript-details.component.spec.ts b/src/modules/config/components/browserscript/browserscript-details/browserscript-details.component.spec.ts index 37a8b96e5..3a4ebf98d 100644 --- a/src/modules/config/components/browserscript/browserscript-details/browserscript-details.component.spec.ts +++ b/src/modules/config/components/browserscript/browserscript-details/browserscript-details.component.spec.ts @@ -18,7 +18,6 @@ import {LabelService} from '../../../services'; import {of} from 'rxjs'; import {AuthService} from '../../../../core/services/auth'; import {AnnotationComponent, LabelComponent, MetaComponent} from '../..'; -import {AbilityModule} from '@casl/angular'; import {HarnessLoader} from '@angular/cdk/testing'; import {MatButtonHarness} from '@angular/material/button/testing'; import {MatSelectHarness} from '@angular/material/select/testing'; @@ -66,7 +65,6 @@ describe('BrowserScriptDetailsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - AbilityModule, RouterTestingModule, CommonsModule, NoopAnimationsModule, diff --git a/src/modules/config/components/browserscript/browserscript-details/browserscript-details.component.ts b/src/modules/config/components/browserscript/browserscript-details/browserscript-details.component.ts index 46d949a22..fb47221d5 100644 --- a/src/modules/config/components/browserscript/browserscript-details/browserscript-details.component.ts +++ b/src/modules/config/components/browserscript/browserscript-details/browserscript-details.component.ts @@ -16,10 +16,11 @@ import {MatChipInputEvent} from '@angular/material/chips'; import {MonacoEditorConstructionOptions, MonacoEditorLoaderService, MonacoStandaloneCodeEditor} from '@materia-ui/ngx-monaco-editor'; @Component({ - changeDetection: ChangeDetectionStrategy.OnPush, - selector: 'app-browserscript-details', - templateUrl: './browserscript-details.component.html', - styleUrls: ['./browserscript-details.component.scss'] + changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-browserscript-details', + templateUrl: './browserscript-details.component.html', + styleUrls: ['./browserscript-details.component.scss'], + standalone: false }) export class BrowserScriptDetailsComponent implements OnChanges { readonly BrowserScriptType = BrowserScriptType; diff --git a/src/modules/config/components/browserscript/browserscript-dialog/browserscript-dialog.component.spec.ts b/src/modules/config/components/browserscript/browserscript-dialog/browserscript-dialog.component.spec.ts index 0e5121584..ad720a283 100644 --- a/src/modules/config/components/browserscript/browserscript-dialog/browserscript-dialog.component.spec.ts +++ b/src/modules/config/components/browserscript/browserscript-dialog/browserscript-dialog.component.spec.ts @@ -11,7 +11,6 @@ import {LabelService} from '../../../services'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {of} from 'rxjs'; import {AnnotationComponent} from '../../annotation/annotation.component'; -import {AbilityModule} from '@casl/angular'; import {CoreTestingModule} from '../../../../core/core.testing.module'; import {AuthService} from '../../../../core/services'; import {MonacoEditorComponent} from '@materia-ui/ngx-monaco-editor'; @@ -29,7 +28,6 @@ describe('BrowserScriptDialogComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - AbilityModule, CoreTestingModule.forRoot(), CommonsModule, NoopAnimationsModule diff --git a/src/modules/config/components/browserscript/browserscript-dialog/browserscript-dialog.component.ts b/src/modules/config/components/browserscript/browserscript-dialog/browserscript-dialog.component.ts index 4db8b8910..4b72a85e5 100644 --- a/src/modules/config/components/browserscript/browserscript-dialog/browserscript-dialog.component.ts +++ b/src/modules/config/components/browserscript/browserscript-dialog/browserscript-dialog.component.ts @@ -8,9 +8,10 @@ import {ConfigObject} from '../../../../../shared/models/config'; import {MonacoEditorLoaderService} from '@materia-ui/ngx-monaco-editor'; @Component({ - selector: 'app-browserscript-dialog', - templateUrl: './browserscript-dialog.component.html', - styleUrls: ['./browserscript-dialog.component.css'] + selector: 'app-browserscript-dialog', + templateUrl: './browserscript-dialog.component.html', + styleUrls: ['./browserscript-dialog.component.css'], + standalone: false }) export class BrowserScriptDialogComponent extends BrowserScriptDetailsComponent implements OnInit { diff --git a/src/modules/config/components/browserscript/browserscript-multi-dialog/browserscript-multi-dialog.component.ts b/src/modules/config/components/browserscript/browserscript-multi-dialog/browserscript-multi-dialog.component.ts index 6863c8729..dcee09cd2 100644 --- a/src/modules/config/components/browserscript/browserscript-multi-dialog/browserscript-multi-dialog.component.ts +++ b/src/modules/config/components/browserscript/browserscript-multi-dialog/browserscript-multi-dialog.component.ts @@ -9,9 +9,10 @@ import {LabelMultiComponent} from '../../label/label-multi/label-multi.component import {MonacoEditorLoaderService} from '@materia-ui/ngx-monaco-editor'; @Component({ - selector: 'app-browserscript-multi-dialog', - templateUrl: './browserscript-multi-dialog.component.html', - styleUrls: ['./browserscript-multi-dialog.component.css'] + selector: 'app-browserscript-multi-dialog', + templateUrl: './browserscript-multi-dialog.component.html', + styleUrls: ['./browserscript-multi-dialog.component.css'], + standalone: false }) export class BrowserScriptMultiDialogComponent extends BrowserScriptDetailsComponent implements OnInit { diff --git a/src/modules/config/components/browserscript/browserscript-preview/browserscript-preview.component.ts b/src/modules/config/components/browserscript/browserscript-preview/browserscript-preview.component.ts index 349057f33..389e40efe 100644 --- a/src/modules/config/components/browserscript/browserscript-preview/browserscript-preview.component.ts +++ b/src/modules/config/components/browserscript/browserscript-preview/browserscript-preview.component.ts @@ -3,9 +3,10 @@ import {BrowserScriptType, ConfigObject} from '../../../../../shared/models/conf import {MonacoEditorConstructionOptions, MonacoStandaloneCodeEditor} from '@materia-ui/ngx-monaco-editor'; @Component({ - selector: 'app-browserscript-preview', - templateUrl: './browserscript-preview.component.html', - styleUrls: ['./browserscript-preview.component.css'] + selector: 'app-browserscript-preview', + templateUrl: './browserscript-preview.component.html', + styleUrls: ['./browserscript-preview.component.css'], + standalone: false }) export class BrowserscriptPreviewComponent implements OnInit { readonly BrowserScriptType = BrowserScriptType; diff --git a/src/modules/config/components/collection-meta/collection-meta.component.spec.ts b/src/modules/config/components/collection-meta/collection-meta.component.spec.ts index 4edf2cdf7..f2b7fb108 100644 --- a/src/modules/config/components/collection-meta/collection-meta.component.spec.ts +++ b/src/modules/config/components/collection-meta/collection-meta.component.spec.ts @@ -15,7 +15,6 @@ import {AnnotationComponent} from '../annotation/annotation.component'; import {LabelService} from '../../services'; import {of} from 'rxjs'; import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; -import {AbilityModule} from '@casl/angular'; import {AuthService} from '../../../core/services'; import {expect} from '@angular/flex-layout/_private-utils/testing'; import {VALID_COLLECTION_NAME} from '../../../../shared/validation/patterns'; @@ -32,7 +31,6 @@ describe('CollectionMetaComponent', () => { TestBed.configureTestingModule({ imports: [ ReactiveFormsModule, - AbilityModule, MaterialModule, RouterTestingModule, CommonsModule, diff --git a/src/modules/config/components/collection-meta/collection-meta.component.ts b/src/modules/config/components/collection-meta/collection-meta.component.ts index 7f23952cc..867b88be8 100644 --- a/src/modules/config/components/collection-meta/collection-meta.component.ts +++ b/src/modules/config/components/collection-meta/collection-meta.component.ts @@ -8,13 +8,14 @@ import {Observable, of} from 'rxjs'; import {first, map, tap} from 'rxjs/operators'; @Component({ - selector: 'app-collection-meta', - templateUrl: './collection-meta.component.html', - styleUrls: ['./collection-meta.component.css'], - providers: [ - {provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => CollectionMetaComponent), multi: true}, - ], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-collection-meta', + templateUrl: './collection-meta.component.html', + styleUrls: ['./collection-meta.component.css'], + providers: [ + { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => CollectionMetaComponent), multi: true }, + ], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class CollectionMetaComponent extends MetaComponent { diff --git a/src/modules/config/components/collection/collection-details/collection-details.component.spec.ts b/src/modules/config/components/collection/collection-details/collection-details.component.spec.ts index f95d8ba47..3c51734d2 100644 --- a/src/modules/config/components/collection/collection-details/collection-details.component.spec.ts +++ b/src/modules/config/components/collection/collection-details/collection-details.component.spec.ts @@ -19,7 +19,6 @@ import { RotationPolicy, subCollectionTypes } from '../../../../../shared/models'; -import {AbilityModule} from '@casl/angular'; import {AuthService} from '../../../../core/services'; import {HarnessLoader} from '@angular/cdk/testing'; import {MatButtonHarness} from '@angular/material/button/testing'; @@ -78,7 +77,6 @@ describe('CollectionDetailsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - AbilityModule, RouterTestingModule, CommonsModule, NoopAnimationsModule, diff --git a/src/modules/config/components/collection/collection-details/collection-details.component.ts b/src/modules/config/components/collection/collection-details/collection-details.component.ts index 92af373a3..ba2f28975 100644 --- a/src/modules/config/components/collection/collection-details/collection-details.component.ts +++ b/src/modules/config/components/collection/collection-details/collection-details.component.ts @@ -14,10 +14,11 @@ import {VALID_COLLECTION_NAME} from '../../../../../shared/validation/patterns'; @Component({ - selector: 'app-collection-details', - templateUrl: './collection-details.component.html', - styleUrls: ['./collection-details.component.css'], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-collection-details', + templateUrl: './collection-details.component.html', + styleUrls: ['./collection-details.component.css'], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class CollectionDetailsComponent implements OnChanges { diff --git a/src/modules/config/components/collection/collection-dialog/collection-dialog.component.spec.ts b/src/modules/config/components/collection/collection-dialog/collection-dialog.component.spec.ts index 87d11acf1..4d43d37e7 100644 --- a/src/modules/config/components/collection/collection-dialog/collection-dialog.component.spec.ts +++ b/src/modules/config/components/collection/collection-dialog/collection-dialog.component.spec.ts @@ -12,7 +12,6 @@ import {AnnotationComponent, FilesizeInputComponent, LabelComponent, MetaCompone import {LabelService} from '../../../services'; import {of} from 'rxjs'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; -import {AbilityModule} from '@casl/angular'; import {AuthService} from '../../../../core/services'; import {CollectionMetaComponent} from '../../collection-meta/collection-meta.component'; @@ -31,7 +30,7 @@ describe('CollectionDialogComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommonsModule, CoreTestingModule.forRoot(), MatDialogModule, MatIconModule, NoopAnimationsModule, AbilityModule], + imports: [CommonsModule, CoreTestingModule.forRoot(), MatDialogModule, MatIconModule, NoopAnimationsModule], declarations: [CollectionDialogComponent, CollectionMetaComponent, FilesizeInputComponent, LabelComponent, AnnotationComponent], providers: [UntypedFormBuilder, { diff --git a/src/modules/config/components/collection/collection-dialog/collection-dialog.component.ts b/src/modules/config/components/collection/collection-dialog/collection-dialog.component.ts index 02d175565..749876912 100644 --- a/src/modules/config/components/collection/collection-dialog/collection-dialog.component.ts +++ b/src/modules/config/components/collection/collection-dialog/collection-dialog.component.ts @@ -7,10 +7,11 @@ import {ConfigDialogData} from '../../../func'; import {ConfigObject} from '../../../../../shared/models/config'; @Component({ - selector: 'app-collection-dialog', - templateUrl: './collection-dialog.component.html', - styleUrls: ['./collection-dialog.component.css'], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-collection-dialog', + templateUrl: './collection-dialog.component.html', + styleUrls: ['./collection-dialog.component.css'], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class CollectionDialogComponent extends CollectionDetailsComponent implements OnInit { diff --git a/src/modules/config/components/collection/collection-preview/collection-preview.component.ts b/src/modules/config/components/collection/collection-preview/collection-preview.component.ts index 155ebad2a..30d97b7a5 100644 --- a/src/modules/config/components/collection/collection-preview/collection-preview.component.ts +++ b/src/modules/config/components/collection/collection-preview/collection-preview.component.ts @@ -2,9 +2,10 @@ import {Component, Input, OnInit} from '@angular/core'; import {ConfigObject, RotationPolicy, SubCollectionType} from '../../../../../shared/models/config'; @Component({ - selector: 'app-collection-preview', - templateUrl: './collection-preview.component.html', - styleUrls: ['./collection-preview.component.css'] + selector: 'app-collection-preview', + templateUrl: './collection-preview.component.html', + styleUrls: ['./collection-preview.component.css'], + standalone: false }) export class CollectionPreviewComponent { readonly RotationPolicy = RotationPolicy; diff --git a/src/modules/config/components/config-list/config-list.component.ts b/src/modules/config/components/config-list/config-list.component.ts index 034581d0f..bd21bbb51 100644 --- a/src/modules/config/components/config-list/config-list.component.ts +++ b/src/modules/config/components/config-list/config-list.component.ts @@ -5,26 +5,27 @@ import {BASE_LIST} from '../../../../shared/directives'; import {animate, state, style, transition, trigger} from '@angular/animations'; @Component({ - selector: 'app-config-list', - templateUrl: '../../../commons/components/base-list/base-list.html', - styleUrls: [ - '../../../commons/components/base-list/base-list.scss', - '../../../commons/components/base-list/base-list-odd-preview.scss', - ], - changeDetection: ChangeDetectionStrategy.OnPush, - providers: [ - { - provide: BASE_LIST, - useExisting: forwardRef(() => ConfigListComponent) - } - ], - animations: [ - trigger('detailExpand', [ - state('collapsed', style({height: '0px', minHeight: '0', opacity: 0})), - state('expanded', style({height: '*', opacity: 1})), - transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')), - ]), - ], + selector: 'app-config-list', + templateUrl: '../../../commons/components/base-list/base-list.html', + styleUrls: [ + '../../../commons/components/base-list/base-list.scss', + '../../../commons/components/base-list/base-list-odd-preview.scss', + ], + changeDetection: ChangeDetectionStrategy.OnPush, + providers: [ + { + provide: BASE_LIST, + useExisting: forwardRef(() => ConfigListComponent) + } + ], + animations: [ + trigger('detailExpand', [ + state('collapsed', style({ height: '0px', minHeight: '0', opacity: 0 })), + state('expanded', style({ height: '*', opacity: 1 })), + transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')), + ]), + ], + standalone: false }) export class ConfigListComponent extends BaseListComponent { diff --git a/src/modules/config/components/config-query/config-query.component.ts b/src/modules/config/components/config-query/config-query.component.ts index 7ea423457..9625b825d 100644 --- a/src/modules/config/components/config-query/config-query.component.ts +++ b/src/modules/config/components/config-query/config-query.component.ts @@ -17,10 +17,11 @@ import {ShortcutEventOutput, ShortcutInput} from 'ng-keyboard-shortcuts'; @Component({ - selector: 'app-config-query', - styleUrls: ['config-query.component.scss'], - templateUrl: './config-query.component.html', - changeDetection: ChangeDetectionStrategy.OnPush + selector: 'app-config-query', + styleUrls: ['config-query.component.scss'], + templateUrl: './config-query.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class ConfigQueryComponent extends QueryComponent implements OnChanges, AfterViewInit { readonly Kind = Kind; diff --git a/src/modules/config/components/crawl-execution-status/crawl-execution-status.component.ts b/src/modules/config/components/crawl-execution-status/crawl-execution-status.component.ts index 4589dfb66..e5f409f37 100644 --- a/src/modules/config/components/crawl-execution-status/crawl-execution-status.component.ts +++ b/src/modules/config/components/crawl-execution-status/crawl-execution-status.component.ts @@ -2,11 +2,11 @@ import {ChangeDetectionStrategy, Component, Input} from '@angular/core'; import {CrawlExecutionState, CrawlExecutionStatus} from '../../../../shared/models/report'; @Component({ - selector: 'app-config-crawl-execution-status', - templateUrl: './crawl-execution-status.component.html', - styleUrls: ['./crawl-execution-status.component.css'], - changeDetection: ChangeDetectionStrategy.OnPush - + selector: 'app-config-crawl-execution-status', + templateUrl: './crawl-execution-status.component.html', + styleUrls: ['./crawl-execution-status.component.css'], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class CrawlExecutionStatusComponent { readonly CrawlExecutionState = CrawlExecutionState; diff --git a/src/modules/config/components/crawlconfig/crawlconfig-details/crawlconfig-details.component.spec.ts b/src/modules/config/components/crawlconfig/crawlconfig-details/crawlconfig-details.component.spec.ts index a0123ac22..11de56463 100644 --- a/src/modules/config/components/crawlconfig/crawlconfig-details/crawlconfig-details.component.spec.ts +++ b/src/modules/config/components/crawlconfig/crawlconfig-details/crawlconfig-details.component.spec.ts @@ -9,7 +9,6 @@ import {LabelComponent} from '../../label/label.component'; import {LabelService} from '../../../services'; import {of} from 'rxjs'; import {AnnotationComponent} from '../../annotation/annotation.component'; -import {AbilityModule} from '@casl/angular'; import {AuthService} from '../../../../core/services'; import {HarnessLoader} from '@angular/cdk/testing'; import {ExtraConfig} from '../../../../../shared/models/config/crawlconfig.model'; @@ -68,7 +67,6 @@ describe('CrawlConfigDetailsComponent', () => { TestBed.configureTestingModule({ imports: [ ReactiveFormsModule, - AbilityModule, MaterialModule, RouterTestingModule, CoreTestingModule.forRoot(), diff --git a/src/modules/config/components/crawlconfig/crawlconfig-details/crawlconfig-details.component.ts b/src/modules/config/components/crawlconfig/crawlconfig-details/crawlconfig-details.component.ts index 6c4857586..711129518 100644 --- a/src/modules/config/components/crawlconfig/crawlconfig-details/crawlconfig-details.component.ts +++ b/src/modules/config/components/crawlconfig/crawlconfig-details/crawlconfig-details.component.ts @@ -5,9 +5,10 @@ import {ConfigObject, ConfigRef, CrawlConfig, Kind, Meta} from '../../../../../s import {AuthService} from '../../../../core/services/auth'; @Component({ - selector: 'app-crawlconfig-details', - templateUrl: './crawlconfig-details.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-crawlconfig-details', + templateUrl: './crawlconfig-details.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class CrawlConfigDetailsComponent implements OnChanges { readonly Kind = Kind; diff --git a/src/modules/config/components/crawlconfig/crawlconfig-dialog/crawlconfig-dialog.component.spec.ts b/src/modules/config/components/crawlconfig/crawlconfig-dialog/crawlconfig-dialog.component.spec.ts index 226572f1b..b536f7982 100644 --- a/src/modules/config/components/crawlconfig/crawlconfig-dialog/crawlconfig-dialog.component.spec.ts +++ b/src/modules/config/components/crawlconfig/crawlconfig-dialog/crawlconfig-dialog.component.spec.ts @@ -12,7 +12,6 @@ import {LabelService} from '../../../services'; import {of} from 'rxjs'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {AnnotationComponent} from '../../annotation/annotation.component'; -import {AbilityModule} from '@casl/angular'; import {AuthService} from '../../../../core/services'; describe('CrawlConfigDialogComponent', () => { @@ -26,7 +25,7 @@ describe('CrawlConfigDialogComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [AbilityModule, CoreTestingModule.forRoot(), CommonsModule, NoopAnimationsModule], + imports: [CoreTestingModule.forRoot(), CommonsModule, NoopAnimationsModule], declarations: [CrawlConfigDialogComponent, MetaComponent, LabelComponent, AnnotationComponent], providers: [ { diff --git a/src/modules/config/components/crawlconfig/crawlconfig-dialog/crawlconfig-dialog.component.ts b/src/modules/config/components/crawlconfig/crawlconfig-dialog/crawlconfig-dialog.component.ts index 9e3b5a158..4cb34e78f 100644 --- a/src/modules/config/components/crawlconfig/crawlconfig-dialog/crawlconfig-dialog.component.ts +++ b/src/modules/config/components/crawlconfig/crawlconfig-dialog/crawlconfig-dialog.component.ts @@ -7,9 +7,10 @@ import {ConfigDialogData} from '../../../func'; import {ConfigObject} from '../../../../../shared/models/config'; @Component({ - selector: 'app-crawlconfig-dialog', - templateUrl: './crawlconfig-dialog.component.html', - styleUrls: ['./crawlconfig-dialog.component.css'] + selector: 'app-crawlconfig-dialog', + templateUrl: './crawlconfig-dialog.component.html', + styleUrls: ['./crawlconfig-dialog.component.css'], + standalone: false }) export class CrawlConfigDialogComponent extends CrawlConfigDetailsComponent implements OnInit { diff --git a/src/modules/config/components/crawlconfig/crawlconfig-multi-dialog/crawlconfig-multi-dialog.component.ts b/src/modules/config/components/crawlconfig/crawlconfig-multi-dialog/crawlconfig-multi-dialog.component.ts index fd8d7dac2..5b8087d04 100644 --- a/src/modules/config/components/crawlconfig/crawlconfig-multi-dialog/crawlconfig-multi-dialog.component.ts +++ b/src/modules/config/components/crawlconfig/crawlconfig-multi-dialog/crawlconfig-multi-dialog.component.ts @@ -9,9 +9,10 @@ import {NUMBER_OR_EMPTY_STRING} from '../../../../../shared/validation/patterns' import {LabelMultiComponent} from '../../label/label-multi/label-multi.component'; @Component({ - selector: 'app-crawlconfig-multi-dialog', - templateUrl: './crawlconfig-multi-dialog.component.html', - styleUrls: ['./crawlconfig-multi-dialog.component.css'] + selector: 'app-crawlconfig-multi-dialog', + templateUrl: './crawlconfig-multi-dialog.component.html', + styleUrls: ['./crawlconfig-multi-dialog.component.css'], + standalone: false }) export class CrawlConfigMultiDialogComponent extends CrawlConfigDetailsComponent implements OnInit { diff --git a/src/modules/config/components/crawlconfig/crawlconfig-preview/crawlconfig-preview.component.ts b/src/modules/config/components/crawlconfig/crawlconfig-preview/crawlconfig-preview.component.ts index 26519e3bd..6b48885ac 100644 --- a/src/modules/config/components/crawlconfig/crawlconfig-preview/crawlconfig-preview.component.ts +++ b/src/modules/config/components/crawlconfig/crawlconfig-preview/crawlconfig-preview.component.ts @@ -2,9 +2,10 @@ import {Component, Input, OnInit} from '@angular/core'; import {ConfigObject} from '../../../../../shared/models/config'; @Component({ - selector: 'app-crawlconfig-preview', - templateUrl: './crawlconfig-preview.component.html', - styleUrls: ['./crawlconfig-preview.component.css'] + selector: 'app-crawlconfig-preview', + templateUrl: './crawlconfig-preview.component.html', + styleUrls: ['./crawlconfig-preview.component.css'], + standalone: false }) export class CrawlconfigPreviewComponent { @Input() diff --git a/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-details/crawlhostgroupconfig-details.component.spec.ts b/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-details/crawlhostgroupconfig-details.component.spec.ts index a65cd5716..8b6121498 100644 --- a/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-details/crawlhostgroupconfig-details.component.spec.ts +++ b/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-details/crawlhostgroupconfig-details.component.spec.ts @@ -9,7 +9,6 @@ import {CoreTestingModule} from '../../../../core/core.testing.module'; import {LabelService} from '../../../services'; import {of} from 'rxjs'; import {AnnotationComponent, DurationPickerComponent, LabelComponent, MetaComponent} from '../..'; -import {AbilityModule} from '@casl/angular'; import {AuthService} from '../../../../core/services'; import {HarnessLoader} from '@angular/cdk/testing'; import {MatButtonHarness} from '@angular/material/button/testing'; @@ -65,7 +64,6 @@ describe('CrawlHostGroupConfigDetailsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - AbilityModule, CommonsModule, RouterTestingModule, NoopAnimationsModule, diff --git a/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-details/crawlhostgroupconfig-details.component.ts b/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-details/crawlhostgroupconfig-details.component.ts index 1b710b0ce..b99fd11d7 100644 --- a/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-details/crawlhostgroupconfig-details.component.ts +++ b/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-details/crawlhostgroupconfig-details.component.ts @@ -12,10 +12,11 @@ import { import {UnitOfTime} from 'src/shared/models/duration/unit-time.model'; @Component({ - selector: 'app-crawlhostgroupconfig-details', - templateUrl: './crawlhostgroupconfig-details.component.html', - styleUrls: ['./crawlhostgroupconfig-details.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-crawlhostgroupconfig-details', + templateUrl: './crawlhostgroupconfig-details.component.html', + styleUrls: ['./crawlhostgroupconfig-details.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class CrawlHostGroupConfigDetailsComponent implements OnChanges { readonly UnitOfTime = UnitOfTime; diff --git a/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-dialog/crawlhostgroupconfig-dialog.component.spec.ts b/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-dialog/crawlhostgroupconfig-dialog.component.spec.ts index 293188008..6ab27d2ca 100644 --- a/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-dialog/crawlhostgroupconfig-dialog.component.spec.ts +++ b/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-dialog/crawlhostgroupconfig-dialog.component.spec.ts @@ -12,7 +12,6 @@ import {LabelService} from '../../../services'; import {of} from 'rxjs'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {AnnotationComponent} from '../../annotation/annotation.component'; -import {AbilityModule} from '@casl/angular'; import {AuthService} from '../../../../core/services'; import {DurationPickerComponent} from '../../durationpicker/duration-picker'; @@ -27,7 +26,7 @@ describe('CrawlHostGroupConfigDialogComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CoreTestingModule.forRoot(), AbilityModule, CommonsModule, NoopAnimationsModule], + imports: [CoreTestingModule.forRoot(), CommonsModule, NoopAnimationsModule], providers: [ { provide: LabelService, diff --git a/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-dialog/crawlhostgroupconfig-dialog.component.ts b/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-dialog/crawlhostgroupconfig-dialog.component.ts index 8438cbac5..a0ba3a4a9 100644 --- a/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-dialog/crawlhostgroupconfig-dialog.component.ts +++ b/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-dialog/crawlhostgroupconfig-dialog.component.ts @@ -7,9 +7,10 @@ import {ConfigObject} from '../../../../../shared/models/config'; import {CrawlHostGroupConfigDetailsComponent} from '..'; @Component({ - selector: 'app-crawlhostgroupconfig-dialog', - templateUrl: './crawlhostgroupconfig-dialog.component.html', - styleUrls: ['./crawlhostgroupconfig-dialog.component.css'] + selector: 'app-crawlhostgroupconfig-dialog', + templateUrl: './crawlhostgroupconfig-dialog.component.html', + styleUrls: ['./crawlhostgroupconfig-dialog.component.css'], + standalone: false }) export class CrawlHostGroupConfigDialogComponent extends CrawlHostGroupConfigDetailsComponent implements OnInit { diff --git a/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-multi-dialog/crawlhostgroupconfig-multi-dialog.component.spec.ts b/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-multi-dialog/crawlhostgroupconfig-multi-dialog.component.spec.ts index ae523f759..757b54c09 100644 --- a/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-multi-dialog/crawlhostgroupconfig-multi-dialog.component.spec.ts +++ b/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-multi-dialog/crawlhostgroupconfig-multi-dialog.component.spec.ts @@ -12,7 +12,6 @@ import {AuthService} from '../../../../core/services'; import {DurationPickerComponent} from '../../durationpicker/duration-picker'; import {CommonsModule} from '../../../../commons'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; -import {AbilityModule} from '@casl/angular'; import {of} from 'rxjs'; describe('CrawlHostGroupConfigMultiDialogComponent', () => { @@ -26,7 +25,7 @@ describe('CrawlHostGroupConfigMultiDialogComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CoreTestingModule.forRoot(), AbilityModule, CommonsModule, NoopAnimationsModule], + imports: [CoreTestingModule.forRoot(), CommonsModule, NoopAnimationsModule], providers: [UntypedFormBuilder, { provide: LabelService, diff --git a/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-multi-dialog/crawlhostgroupconfig-multi-dialog.component.ts b/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-multi-dialog/crawlhostgroupconfig-multi-dialog.component.ts index e3ae04691..fedf241db 100644 --- a/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-multi-dialog/crawlhostgroupconfig-multi-dialog.component.ts +++ b/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-multi-dialog/crawlhostgroupconfig-multi-dialog.component.ts @@ -9,9 +9,10 @@ import {LabelMultiComponent} from '../../label/label-multi/label-multi.component import {ANY_DECIMAL_NUMBER_OR_EMPTY_STRING, NUMBER_OR_EMPTY_STRING} from '../../../../../shared/validation/patterns'; @Component({ - selector: 'app-crawlhostgroupconfig-multi-dialog', - templateUrl: './crawlhostgroupconfig-multi-dialog.component.html', - styleUrls: ['./crawlhostgroupconfig-multi-dialog.component.css'] + selector: 'app-crawlhostgroupconfig-multi-dialog', + templateUrl: './crawlhostgroupconfig-multi-dialog.component.html', + styleUrls: ['./crawlhostgroupconfig-multi-dialog.component.css'], + standalone: false }) export class CrawlHostGroupConfigMultiDialogComponent extends CrawlHostGroupConfigDetailsComponent implements OnInit { diff --git a/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-preview/crawlhostgroupconfig-preview.component.ts b/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-preview/crawlhostgroupconfig-preview.component.ts index f99b7dee6..bda0936fe 100644 --- a/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-preview/crawlhostgroupconfig-preview.component.ts +++ b/src/modules/config/components/crawlhostgroupconfig/crawlhostgroupconfig-preview/crawlhostgroupconfig-preview.component.ts @@ -2,9 +2,10 @@ import {Component, Input} from '@angular/core'; import {ConfigObject} from '../../../../../shared/models/config'; @Component({ - selector: 'app-crawlhostgroupconfig-preview', - templateUrl: './crawlhostgroupconfig-preview.component.html', - styleUrls: ['./crawlhostgroupconfig-preview.component.css'] + selector: 'app-crawlhostgroupconfig-preview', + templateUrl: './crawlhostgroupconfig-preview.component.html', + styleUrls: ['./crawlhostgroupconfig-preview.component.css'], + standalone: false }) export class CrawlhostgroupconfigPreviewComponent { @Input() diff --git a/src/modules/config/components/crawljobs/crawljob-details/crawl-job-details.component.spec.ts b/src/modules/config/components/crawljobs/crawljob-details/crawl-job-details.component.spec.ts index b2001c315..d0442c582 100644 --- a/src/modules/config/components/crawljobs/crawljob-details/crawl-job-details.component.spec.ts +++ b/src/modules/config/components/crawljobs/crawljob-details/crawl-job-details.component.spec.ts @@ -27,7 +27,6 @@ import { Label, Meta } from '../../../../../shared/models'; -import {AbilityModule} from '@casl/angular'; import {AuthService} from '../../../../core/services'; import {HarnessLoader} from '@angular/cdk/testing'; import {MatButtonHarness} from '@angular/material/button/testing'; @@ -158,7 +157,6 @@ describe('CrawljobDetailsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - AbilityModule, CommonsModule, RouterTestingModule, NoopAnimationsModule, diff --git a/src/modules/config/components/crawljobs/crawljob-details/crawl-job-details.component.ts b/src/modules/config/components/crawljobs/crawljob-details/crawl-job-details.component.ts index 4f5a4fc82..c6401a606 100644 --- a/src/modules/config/components/crawljobs/crawljob-details/crawl-job-details.component.ts +++ b/src/modules/config/components/crawljobs/crawljob-details/crawl-job-details.component.ts @@ -7,9 +7,10 @@ import {UnitOfTime} from '../../../../../shared/models/duration/unit-time.model' @Component({ - selector: 'app-crawljob-details', - templateUrl: './crawl-job-details.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-crawljob-details', + templateUrl: './crawl-job-details.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class CrawlJobDetailsComponent implements OnChanges { readonly Kind = Kind; diff --git a/src/modules/config/components/crawljobs/crawljob-dialog/crawljob-dialog.component.spec.ts b/src/modules/config/components/crawljobs/crawljob-dialog/crawljob-dialog.component.spec.ts index cce4e5593..cdc11c4af 100644 --- a/src/modules/config/components/crawljobs/crawljob-dialog/crawljob-dialog.component.spec.ts +++ b/src/modules/config/components/crawljobs/crawljob-dialog/crawljob-dialog.component.spec.ts @@ -15,7 +15,6 @@ import { } from '../..'; import {CommonsModule} from '../../../../commons'; import {LabelService} from '../../../services'; -import {AbilityModule} from '@casl/angular'; import {of} from 'rxjs'; import {AuthService} from '../../../../core/services'; @@ -30,7 +29,7 @@ describe('CrawlJobDialogComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [AbilityModule, CommonsModule, NoopAnimationsModule, CoreTestingModule.forRoot()], + imports: [CommonsModule, NoopAnimationsModule, CoreTestingModule.forRoot()], declarations: [ MetaComponent, CrawlJobDialogComponent, diff --git a/src/modules/config/components/crawljobs/crawljob-dialog/crawljob-dialog.component.ts b/src/modules/config/components/crawljobs/crawljob-dialog/crawljob-dialog.component.ts index e264b898f..87d7978ac 100644 --- a/src/modules/config/components/crawljobs/crawljob-dialog/crawljob-dialog.component.ts +++ b/src/modules/config/components/crawljobs/crawljob-dialog/crawljob-dialog.component.ts @@ -7,9 +7,10 @@ import {ConfigDialogData} from '../../../func'; import {BrowserScriptType, ConfigObject} from '../../../../../shared/models/config'; @Component({ - selector: 'app-crawljob-dialog', - templateUrl: './crawljob-dialog.component.html', - styleUrls: ['./crawljob-dialog.component.css'] + selector: 'app-crawljob-dialog', + templateUrl: './crawljob-dialog.component.html', + styleUrls: ['./crawljob-dialog.component.css'], + standalone: false }) export class CrawlJobDialogComponent extends CrawlJobDetailsComponent implements OnInit { diff --git a/src/modules/config/components/crawljobs/crawljob-multi-dialog/crawljobs-multi-dialog.component.ts b/src/modules/config/components/crawljobs/crawljob-multi-dialog/crawljobs-multi-dialog.component.ts index 7fd7b64c0..6ee1b7c8a 100644 --- a/src/modules/config/components/crawljobs/crawljob-multi-dialog/crawljobs-multi-dialog.component.ts +++ b/src/modules/config/components/crawljobs/crawljob-multi-dialog/crawljobs-multi-dialog.component.ts @@ -9,9 +9,10 @@ import {NUMBER_OR_EMPTY_STRING} from '../../../../../shared/validation/patterns' import {LabelMultiComponent} from '../../label/label-multi/label-multi.component'; @Component({ - selector: 'app-crawljobs-multi-dialog', - templateUrl: './crawljobs-multi-dialog.component.html', - styleUrls: ['./crawljobs-multi-dialog.component.css'] + selector: 'app-crawljobs-multi-dialog', + templateUrl: './crawljobs-multi-dialog.component.html', + styleUrls: ['./crawljobs-multi-dialog.component.css'], + standalone: false }) export class CrawlJobMultiDialogComponent extends CrawlJobDetailsComponent implements OnInit { diff --git a/src/modules/config/components/crawljobs/crawljob-preview/crawljob-preview.component.ts b/src/modules/config/components/crawljobs/crawljob-preview/crawljob-preview.component.ts index a0c333965..ad8264778 100644 --- a/src/modules/config/components/crawljobs/crawljob-preview/crawljob-preview.component.ts +++ b/src/modules/config/components/crawljobs/crawljob-preview/crawljob-preview.component.ts @@ -2,9 +2,10 @@ import {Component, Input} from '@angular/core'; import {ConfigObject} from '../../../../../shared/models/config'; @Component({ - selector: 'app-crawljob-preview', - templateUrl: './crawljob-preview.component.html', - styleUrls: ['./crawljob-preview.component.css'] + selector: 'app-crawljob-preview', + templateUrl: './crawljob-preview.component.html', + styleUrls: ['./crawljob-preview.component.css'], + standalone: false }) export class CrawljobPreviewComponent { diff --git a/src/modules/config/components/delete-dialog/delete-dialog.component.ts b/src/modules/config/components/delete-dialog/delete-dialog.component.ts index 6a061a036..008b10a14 100644 --- a/src/modules/config/components/delete-dialog/delete-dialog.component.ts +++ b/src/modules/config/components/delete-dialog/delete-dialog.component.ts @@ -3,8 +3,9 @@ import {MAT_DIALOG_DATA} from '@angular/material/dialog'; import {ConfigObject, Kind} from '../../../../shared/models/config'; @Component({ - selector: 'app-delete-dialog', - templateUrl: 'delete-dialog.component.html' + selector: 'app-delete-dialog', + templateUrl: 'delete-dialog.component.html', + standalone: false }) export class DeleteDialogComponent { readonly Kind = Kind; diff --git a/src/modules/config/components/delete-multi-dialog/delete-multi-dialog.component.ts b/src/modules/config/components/delete-multi-dialog/delete-multi-dialog.component.ts index f9552c84f..2e1d415d0 100644 --- a/src/modules/config/components/delete-multi-dialog/delete-multi-dialog.component.ts +++ b/src/modules/config/components/delete-multi-dialog/delete-multi-dialog.component.ts @@ -6,9 +6,10 @@ export interface DeleteDialogData { } @Component({ - selector: 'app-delete-multi-dialog', - styleUrls: ['delete-multi-dialog.component.scss'], - templateUrl: 'delete-multi-dialog.component.html' + selector: 'app-delete-multi-dialog', + styleUrls: ['delete-multi-dialog.component.scss'], + templateUrl: 'delete-multi-dialog.component.html', + standalone: false }) export class DeleteMultiDialogComponent { diff --git a/src/modules/config/components/durationpicker/duration-picker.ts b/src/modules/config/components/durationpicker/duration-picker.ts index feeccf9cb..3a1daa1a5 100644 --- a/src/modules/config/components/durationpicker/duration-picker.ts +++ b/src/modules/config/components/durationpicker/duration-picker.ts @@ -13,24 +13,28 @@ import {Duration} from '../../../../shared/models/duration/duration.model'; import {takeUntil} from 'rxjs/operators'; import {Subject} from 'rxjs'; import {NUMBER_OR_EMPTY_STRING} from '../../../../shared/validation/patterns'; -import * as moment from 'moment'; +import dayjs from 'dayjs'; +import duration from 'dayjs/plugin/duration'; +dayjs.extend(duration); @Component({ - selector: 'app-duration-picker', - templateUrl: './duration-picker.component.html', - styleUrls: ['./duration-picker.component.scss'], - providers: [ - { - provide: NG_VALUE_ACCESSOR, - useExisting: forwardRef(() => DurationPickerComponent), - multi: true - }, - { - provide: NG_VALIDATORS, - useExisting: forwardRef(() => DurationPickerComponent), - multi: true - }], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-duration-picker', + templateUrl: './duration-picker.component.html', + styleUrls: ['./duration-picker.component.scss'], + providers: [ + { + provide: NG_VALUE_ACCESSOR, + useExisting: forwardRef(() => DurationPickerComponent), + multi: true + }, + { + provide: NG_VALIDATORS, + useExisting: forwardRef(() => DurationPickerComponent), + multi: true + } + ], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class DurationPickerComponent implements ControlValueAccessor, OnInit, AfterViewInit, OnDestroy { @@ -149,7 +153,7 @@ export class DurationPickerComponent implements ControlValueAccessor, OnInit, Af } secondsToDuration(seconds: number): Duration { - const s = moment.duration(seconds, 'seconds'); + const s = dayjs.duration(seconds, 'seconds'); return new Duration({ days: s.days(), hours: s.hours(), @@ -160,7 +164,7 @@ export class DurationPickerComponent implements ControlValueAccessor, OnInit, Af } msToDuration(milliseconds: number): Duration { - const ms = moment.duration(milliseconds); + const ms = dayjs.duration(milliseconds); return new Duration({ days: null, hours: null, diff --git a/src/modules/config/components/entity/entity-details/entity-details.component.spec.ts b/src/modules/config/components/entity/entity-details/entity-details.component.spec.ts index 0a95fe049..bc2c3b7d4 100644 --- a/src/modules/config/components/entity/entity-details/entity-details.component.spec.ts +++ b/src/modules/config/components/entity/entity-details/entity-details.component.spec.ts @@ -5,7 +5,6 @@ import {LabelService} from '../../../services'; import {of} from 'rxjs'; import {AnnotationComponent, LabelComponent, MetaComponent} from '../..'; import {Annotation, ConfigObject, CrawlEntity, Kind, Label, Meta} from '../../../../../shared/models'; -import {AbilityModule} from '@casl/angular'; import {CoreTestingModule} from '../../../../core/core.testing.module'; import {AuthService} from '../../../../core/services'; import {RouterTestingModule} from '@angular/router/testing'; @@ -46,7 +45,6 @@ describe('EntityDetailsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - AbilityModule, CommonsModule, RouterTestingModule, NoopAnimationsModule, diff --git a/src/modules/config/components/entity/entity-details/entity-details.component.ts b/src/modules/config/components/entity/entity-details/entity-details.component.ts index eb62b06d3..2f4cb66e0 100644 --- a/src/modules/config/components/entity/entity-details/entity-details.component.ts +++ b/src/modules/config/components/entity/entity-details/entity-details.component.ts @@ -4,9 +4,10 @@ import {AuthService} from '../../../../core/services/auth'; import {ConfigObject, Kind, Meta} from '../../../../../shared/models'; @Component({ - selector: 'app-entity-details', - templateUrl: './entity-details.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-entity-details', + templateUrl: './entity-details.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class EntityDetailsComponent implements OnChanges { diff --git a/src/modules/config/components/entity/entity-dialog/entity-dialog.component.ts b/src/modules/config/components/entity/entity-dialog/entity-dialog.component.ts index 244042d6d..40cddb743 100644 --- a/src/modules/config/components/entity/entity-dialog/entity-dialog.component.ts +++ b/src/modules/config/components/entity/entity-dialog/entity-dialog.component.ts @@ -7,9 +7,10 @@ import {ConfigDialogData} from '../../../func'; import {ConfigObject} from '../../../../../shared/models/config'; @Component({ - selector: 'app-entity-dialog', - templateUrl: './entity-dialog.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-entity-dialog', + templateUrl: './entity-dialog.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class EntityDialogComponent extends EntityDetailsComponent implements OnInit { constructor(protected fb: UntypedFormBuilder, diff --git a/src/modules/config/components/entity/entity-multi-dialog/entity-multi-dialog.component.ts b/src/modules/config/components/entity/entity-multi-dialog/entity-multi-dialog.component.ts index d80a10318..70bd40d50 100644 --- a/src/modules/config/components/entity/entity-multi-dialog/entity-multi-dialog.component.ts +++ b/src/modules/config/components/entity/entity-multi-dialog/entity-multi-dialog.component.ts @@ -8,8 +8,9 @@ import {ConfigObject, Kind, Label} from '../../../../../shared/models/config'; import {LabelMultiComponent} from '../../label/label-multi/label-multi.component'; @Component({ - selector: 'app-entity-multi-dialog', - templateUrl: './entity-multi-dialog.component.html', + selector: 'app-entity-multi-dialog', + templateUrl: './entity-multi-dialog.component.html', + standalone: false }) export class EntityMultiDialogComponent extends EntityDetailsComponent implements OnInit { diff --git a/src/modules/config/components/entity/entity-view/entity-view.component.ts b/src/modules/config/components/entity/entity-view/entity-view.component.ts index a7b728c8b..ed3df7de4 100644 --- a/src/modules/config/components/entity/entity-view/entity-view.component.ts +++ b/src/modules/config/components/entity/entity-view/entity-view.component.ts @@ -2,9 +2,10 @@ import {ChangeDetectionStrategy, Component, Input} from '@angular/core'; import {ConfigObject, Label} from '../../../../../shared/models'; @Component({ - selector: 'app-entity-view', - templateUrl: './entity-view.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-entity-view', + templateUrl: './entity-view.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class EntityViewComponent { diff --git a/src/modules/config/components/filesize-input/filesize-input.component.ts b/src/modules/config/components/filesize-input/filesize-input.component.ts index 09abfbe64..906fa3731 100644 --- a/src/modules/config/components/filesize-input/filesize-input.component.ts +++ b/src/modules/config/components/filesize-input/filesize-input.component.ts @@ -33,21 +33,22 @@ const incrementBases = { }; @Component({ - selector: 'app-filesize-input', - templateUrl: './filesize-input.component.html', - providers: [ - { - provide: NG_VALUE_ACCESSOR, - useExisting: forwardRef(() => FilesizeInputComponent), - multi: true - }, - { - provide: NG_VALIDATORS, - useExisting: forwardRef(() => FilesizeInputComponent), - multi: true - } - ], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-filesize-input', + templateUrl: './filesize-input.component.html', + providers: [ + { + provide: NG_VALUE_ACCESSOR, + useExisting: forwardRef(() => FilesizeInputComponent), + multi: true + }, + { + provide: NG_VALIDATORS, + useExisting: forwardRef(() => FilesizeInputComponent), + multi: true + } + ], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class FilesizeInputComponent implements ControlValueAccessor, AfterViewInit, OnDestroy { diff --git a/src/modules/config/components/job-execution-status/job-status.component.ts b/src/modules/config/components/job-execution-status/job-status.component.ts index eebefd4d6..670c8660f 100644 --- a/src/modules/config/components/job-execution-status/job-status.component.ts +++ b/src/modules/config/components/job-execution-status/job-status.component.ts @@ -2,10 +2,11 @@ import {ChangeDetectionStrategy, Component, Input} from '@angular/core'; import {JobExecutionState, JobExecutionStatus} from '../../../../shared/models/report'; @Component({ - selector: 'app-config-job-execution-status', - templateUrl: './job-status.component.html', - styleUrls: ['./job-status.component.css'], - changeDetection: ChangeDetectionStrategy.OnPush + selector: 'app-config-job-execution-status', + templateUrl: './job-status.component.html', + styleUrls: ['./job-status.component.css'], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class JobStatusComponent { readonly JobExecutionState = JobExecutionState; diff --git a/src/modules/config/components/label/label-multi/label-multi.component.ts b/src/modules/config/components/label/label-multi/label-multi.component.ts index 2b767704b..1a154487b 100644 --- a/src/modules/config/components/label/label-multi/label-multi.component.ts +++ b/src/modules/config/components/label/label-multi/label-multi.component.ts @@ -9,9 +9,10 @@ import {LabelService} from '../../../services/label.service'; import {UntypedFormControl} from '@angular/forms'; @Component({ - selector: 'app-label-multi', - templateUrl: './label-multi.component.html', - styleUrls: ['./label-multi.component.css'] + selector: 'app-label-multi', + templateUrl: './label-multi.component.html', + styleUrls: ['./label-multi.component.css'], + standalone: false }) export class LabelMultiComponent implements OnInit { @Input() diff --git a/src/modules/config/components/label/label.component.ts b/src/modules/config/components/label/label.component.ts index 9ae797c6a..f1d663933 100644 --- a/src/modules/config/components/label/label.component.ts +++ b/src/modules/config/components/label/label.component.ts @@ -26,11 +26,12 @@ import {LabelService} from '../../services/label.service'; @Component({ - selector: 'app-labels', - templateUrl: './label.component.html', - styleUrls: ['./label.component.scss'], - providers: [{provide: NG_VALUE_ACCESSOR, useExisting: LabelComponent, multi: true}], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-labels', + templateUrl: './label.component.html', + styleUrls: ['./label.component.scss'], + providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: LabelComponent, multi: true }], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class LabelComponent implements ControlValueAccessor, OnInit { diff --git a/src/modules/config/components/meta/meta-preview/meta-preview.component.ts b/src/modules/config/components/meta/meta-preview/meta-preview.component.ts index 5f364db77..1383e4874 100644 --- a/src/modules/config/components/meta/meta-preview/meta-preview.component.ts +++ b/src/modules/config/components/meta/meta-preview/meta-preview.component.ts @@ -3,9 +3,10 @@ import {ConfigObject} from '../../../../../shared/models/config'; import {AuthService, SnackBarService} from '../../../../core/services'; @Component({ - selector: 'app-meta-preview', - templateUrl: './meta-preview.component.html', - styleUrls: ['./meta-preview.component.css'] + selector: 'app-meta-preview', + templateUrl: './meta-preview.component.html', + styleUrls: ['./meta-preview.component.css'], + standalone: false }) export class MetaPreviewComponent { diff --git a/src/modules/config/components/meta/meta.component.spec.ts b/src/modules/config/components/meta/meta.component.spec.ts index 0c573e97a..6f1918bad 100644 --- a/src/modules/config/components/meta/meta.component.spec.ts +++ b/src/modules/config/components/meta/meta.component.spec.ts @@ -9,7 +9,6 @@ import {CoreTestingModule} from '../../../core/core.testing.module'; import {CommonsModule} from '../../../commons'; import {LabelComponent} from '../label/label.component'; import {AnnotationComponent} from '../annotation/annotation.component'; -import {AbilityModule} from '@casl/angular'; import {AuthService} from '../../../core/services'; describe('MetaComponent', () => { @@ -20,7 +19,6 @@ describe('MetaComponent', () => { TestBed.configureTestingModule({ declarations: [MetaComponent, LabelComponent, AnnotationComponent], imports: [ - AbilityModule, CoreTestingModule.forRoot(), CommonsModule, NoopAnimationsModule diff --git a/src/modules/config/components/meta/meta.component.ts b/src/modules/config/components/meta/meta.component.ts index 07e171d03..f8e944edb 100644 --- a/src/modules/config/components/meta/meta.component.ts +++ b/src/modules/config/components/meta/meta.component.ts @@ -17,14 +17,15 @@ import {takeUntil} from 'rxjs/operators'; @Component({ - selector: 'app-meta', - templateUrl: './meta.component.html', - styleUrls: ['./meta.component.css'], - providers: [ - {provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => MetaComponent), multi: true}, - {provide: NG_VALIDATORS, useExisting: forwardRef(() => MetaComponent), multi: true}, - ], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-meta', + templateUrl: './meta.component.html', + styleUrls: ['./meta.component.css'], + providers: [ + { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => MetaComponent), multi: true }, + { provide: NG_VALIDATORS, useExisting: forwardRef(() => MetaComponent), multi: true }, + ], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class MetaComponent implements AfterViewInit, OnInit, OnDestroy, ControlValueAccessor, Validator { diff --git a/src/modules/config/components/politenessconfig/politenessconfig-details/politenessconfig-details.component.spec.ts b/src/modules/config/components/politenessconfig/politenessconfig-details/politenessconfig-details.component.spec.ts index 3b766634a..6d674e640 100644 --- a/src/modules/config/components/politenessconfig/politenessconfig-details/politenessconfig-details.component.spec.ts +++ b/src/modules/config/components/politenessconfig/politenessconfig-details/politenessconfig-details.component.spec.ts @@ -17,7 +17,6 @@ import { RobotsPolicy } from '../../../../../shared/models'; import {AnnotationComponent, DurationPickerComponent, LabelComponent, MetaComponent} from '../..'; -import {AbilityModule} from '@casl/angular'; import {AuthService} from '../../../../core/services'; import {HarnessLoader} from '@angular/cdk/testing'; import {MatButtonHarness} from '@angular/material/button/testing'; @@ -68,7 +67,6 @@ describe('PolitenessConfigDetailsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - AbilityModule, RouterTestingModule, NoopAnimationsModule, CoreTestingModule.forRoot(), diff --git a/src/modules/config/components/politenessconfig/politenessconfig-details/politenessconfig-details.component.ts b/src/modules/config/components/politenessconfig/politenessconfig-details/politenessconfig-details.component.ts index 3ff9315b1..12d6bd41e 100644 --- a/src/modules/config/components/politenessconfig/politenessconfig-details/politenessconfig-details.component.ts +++ b/src/modules/config/components/politenessconfig/politenessconfig-details/politenessconfig-details.component.ts @@ -7,9 +7,10 @@ import {UnitOfTime} from '../../../../../shared/models/duration/unit-time.model' @Component({ - selector: 'app-politenessconfig-details', - templateUrl: './politenessconfig-details.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-politenessconfig-details', + templateUrl: './politenessconfig-details.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class PolitenessConfigDetailsComponent implements OnChanges { diff --git a/src/modules/config/components/politenessconfig/politenessconfig-dialog/politenessconfig-dialog.component.spec.ts b/src/modules/config/components/politenessconfig/politenessconfig-dialog/politenessconfig-dialog.component.spec.ts index cc7866c78..b8350d518 100644 --- a/src/modules/config/components/politenessconfig/politenessconfig-dialog/politenessconfig-dialog.component.spec.ts +++ b/src/modules/config/components/politenessconfig/politenessconfig-dialog/politenessconfig-dialog.component.spec.ts @@ -17,7 +17,6 @@ import {CommonsModule} from '../../../../commons'; import {LabelService} from '../../../services'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {of} from 'rxjs'; -import {AbilityModule} from '@casl/angular'; import {AuthService} from '../../../../core/services'; describe('PolitenessConfigDialogComponent', () => { @@ -32,7 +31,7 @@ describe('PolitenessConfigDialogComponent', () => { }; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [AbilityModule, CoreTestingModule.forRoot(), MatDialogModule, CommonsModule, NoopAnimationsModule], + imports: [CoreTestingModule.forRoot(), MatDialogModule, CommonsModule, NoopAnimationsModule], declarations: [PolitenessConfigDialogComponent, DurationPickerComponent, SelectorComponent, diff --git a/src/modules/config/components/politenessconfig/politenessconfig-dialog/politenessconfig-dialog.component.ts b/src/modules/config/components/politenessconfig/politenessconfig-dialog/politenessconfig-dialog.component.ts index ab86eebf8..aa4e6ba4a 100644 --- a/src/modules/config/components/politenessconfig/politenessconfig-dialog/politenessconfig-dialog.component.ts +++ b/src/modules/config/components/politenessconfig/politenessconfig-dialog/politenessconfig-dialog.component.ts @@ -7,9 +7,10 @@ import {ConfigDialogData} from '../../../func'; import {ConfigObject} from '../../../../../shared/models/config'; @Component({ - selector: 'app-politenessconfig-dialog', - templateUrl: './politenessconfig-dialog.component.html', - styleUrls: ['./politenessconfig-dialog.component.css'] + selector: 'app-politenessconfig-dialog', + templateUrl: './politenessconfig-dialog.component.html', + styleUrls: ['./politenessconfig-dialog.component.css'], + standalone: false }) export class PolitenessConfigDialogComponent extends PolitenessConfigDetailsComponent implements OnInit { diff --git a/src/modules/config/components/politenessconfig/politenessconfig-multi-dialog/politenessconfig-multi-dialog.component.ts b/src/modules/config/components/politenessconfig/politenessconfig-multi-dialog/politenessconfig-multi-dialog.component.ts index 4650ae08d..9c408dc93 100644 --- a/src/modules/config/components/politenessconfig/politenessconfig-multi-dialog/politenessconfig-multi-dialog.component.ts +++ b/src/modules/config/components/politenessconfig/politenessconfig-multi-dialog/politenessconfig-multi-dialog.component.ts @@ -9,9 +9,10 @@ import {NUMBER_OR_EMPTY_STRING} from '../../../../../shared/validation/patterns' import {LabelMultiComponent} from '../../label/label-multi/label-multi.component'; @Component({ - selector: 'app-politenessconfig-multi-dialog', - templateUrl: './politenessconfig-multi-dialog.component.html', - styleUrls: ['./politenessconfig-multi-dialog.component.css'] + selector: 'app-politenessconfig-multi-dialog', + templateUrl: './politenessconfig-multi-dialog.component.html', + styleUrls: ['./politenessconfig-multi-dialog.component.css'], + standalone: false }) export class PolitenessConfigMultiDialogComponent extends PolitenessConfigDetailsComponent implements OnInit { diff --git a/src/modules/config/components/politenessconfig/politenessconfig-preview/politenessconfig-preview.component.ts b/src/modules/config/components/politenessconfig/politenessconfig-preview/politenessconfig-preview.component.ts index aa9bce820..bb2297c55 100644 --- a/src/modules/config/components/politenessconfig/politenessconfig-preview/politenessconfig-preview.component.ts +++ b/src/modules/config/components/politenessconfig/politenessconfig-preview/politenessconfig-preview.component.ts @@ -2,9 +2,10 @@ import {Component, Input} from '@angular/core'; import {ConfigObject, RobotsPolicy} from '../../../../../shared/models/config'; @Component({ - selector: 'app-politenessconfig-preview', - templateUrl: './politenessconfig-preview.component.html', - styleUrls: ['./politenessconfig-preview.component.css'] + selector: 'app-politenessconfig-preview', + templateUrl: './politenessconfig-preview.component.html', + styleUrls: ['./politenessconfig-preview.component.css'], + standalone: false }) export class PolitenessconfigPreviewComponent { readonly RobotsPolicy = RobotsPolicy; diff --git a/src/modules/config/components/preview/preview.component.ts b/src/modules/config/components/preview/preview.component.ts index 484417bf3..4880fbbcf 100644 --- a/src/modules/config/components/preview/preview.component.ts +++ b/src/modules/config/components/preview/preview.component.ts @@ -4,10 +4,11 @@ import {ActivatedRoute, Router} from '@angular/router'; import {ErrorService} from '../../../core/services'; @Component({ - selector: 'app-preview', - templateUrl: './preview.component.html', - styleUrls: ['./preview.component.css'], - changeDetection: ChangeDetectionStrategy.OnPush + selector: 'app-preview', + templateUrl: './preview.component.html', + styleUrls: ['./preview.component.css'], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class PreviewComponent { readonly Kind = Kind; diff --git a/src/modules/config/components/rolemapping/rolemapping-details/rolemapping-details.component.ts b/src/modules/config/components/rolemapping/rolemapping-details/rolemapping-details.component.ts index 585c89202..71d6d3441 100644 --- a/src/modules/config/components/rolemapping/rolemapping-details/rolemapping-details.component.ts +++ b/src/modules/config/components/rolemapping/rolemapping-details/rolemapping-details.component.ts @@ -5,9 +5,10 @@ import {ConfigObject, Kind, Meta, Role, RoleMapping} from '../../../../../shared @Component({ - selector: 'app-rolemapping-details', - templateUrl: './rolemapping-details.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-rolemapping-details', + templateUrl: './rolemapping-details.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class RoleMappingDetailsComponent implements OnChanges { diff --git a/src/modules/config/components/rolemapping/rolemapping-dialog/rolemapping-dialog.component.ts b/src/modules/config/components/rolemapping/rolemapping-dialog/rolemapping-dialog.component.ts index 24313112d..0afe8f167 100644 --- a/src/modules/config/components/rolemapping/rolemapping-dialog/rolemapping-dialog.component.ts +++ b/src/modules/config/components/rolemapping/rolemapping-dialog/rolemapping-dialog.component.ts @@ -7,9 +7,10 @@ import {ConfigDialogData} from '../../../func'; import {ConfigObject} from '../../../../../shared/models/config'; @Component({ - selector: 'app-rolemapping-dialog', - templateUrl: './rolemapping-dialog.component.html', - styleUrls: ['./rolemapping-dialog.component.css'] + selector: 'app-rolemapping-dialog', + templateUrl: './rolemapping-dialog.component.html', + styleUrls: ['./rolemapping-dialog.component.css'], + standalone: false }) export class RoleMappingDialogComponent extends RoleMappingDetailsComponent implements OnInit { diff --git a/src/modules/config/components/rolemapping/rolemapping-list/rolemapping-list.component.ts b/src/modules/config/components/rolemapping/rolemapping-list/rolemapping-list.component.ts index 12a20a274..e93729c0f 100644 --- a/src/modules/config/components/rolemapping/rolemapping-list/rolemapping-list.component.ts +++ b/src/modules/config/components/rolemapping/rolemapping-list/rolemapping-list.component.ts @@ -5,16 +5,17 @@ import {BASE_LIST} from '../../../../../shared/directives'; @Component({ - selector: 'app-rolemapping-list', - templateUrl: './rolemapping-list.component.html', - styleUrls: ['../../../../commons/components/base-list/base-list.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, - providers: [ - { - provide: BASE_LIST, - useExisting: forwardRef(() => RoleMappingListComponent) - } - ] + selector: 'app-rolemapping-list', + templateUrl: './rolemapping-list.component.html', + styleUrls: ['../../../../commons/components/base-list/base-list.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, + providers: [ + { + provide: BASE_LIST, + useExisting: forwardRef(() => RoleMappingListComponent) + } + ], + standalone: false }) export class RoleMappingListComponent extends BaseListComponent { diff --git a/src/modules/config/components/rolemapping/rolemapping-multi-dialog/rolemapping-multi-dialog.component.ts b/src/modules/config/components/rolemapping/rolemapping-multi-dialog/rolemapping-multi-dialog.component.ts index c2e5ecf86..2d3575f41 100644 --- a/src/modules/config/components/rolemapping/rolemapping-multi-dialog/rolemapping-multi-dialog.component.ts +++ b/src/modules/config/components/rolemapping/rolemapping-multi-dialog/rolemapping-multi-dialog.component.ts @@ -7,9 +7,10 @@ import {CustomValidators} from '../../../../../shared/validation'; import {ConfigObject, Kind} from '../../../../../shared/models/config'; @Component({ - selector: 'app-rolemapping-multi-dialog', - templateUrl: './rolemapping-multi-dialog.component.html', - styleUrls: ['./rolemapping-multi-dialog.component.css'] + selector: 'app-rolemapping-multi-dialog', + templateUrl: './rolemapping-multi-dialog.component.html', + styleUrls: ['./rolemapping-multi-dialog.component.css'], + standalone: false }) export class RoleMappingMultiDialogComponent extends RoleMappingDetailsComponent implements OnInit { diff --git a/src/modules/config/components/run-crawl-dialog/run-crawl-dialog.component.ts b/src/modules/config/components/run-crawl-dialog/run-crawl-dialog.component.ts index 800b74d1e..3236c50b5 100644 --- a/src/modules/config/components/run-crawl-dialog/run-crawl-dialog.component.ts +++ b/src/modules/config/components/run-crawl-dialog/run-crawl-dialog.component.ts @@ -4,9 +4,10 @@ import {RunCrawlReply, RunCrawlRequest} from '../../../../shared/models/controll import {ConfigObject, Kind} from '../../../../shared/models/config'; @Component({ - selector: 'app-run-crawl-dialog', - templateUrl: './run-crawl-dialog.component.html', - styleUrls: ['./run-crawl-dialog.component.css'] + selector: 'app-run-crawl-dialog', + templateUrl: './run-crawl-dialog.component.html', + styleUrls: ['./run-crawl-dialog.component.css'], + standalone: false }) export class RunCrawlDialogComponent { diff --git a/src/modules/config/components/schedule/schedule-details/schedule-details.component.html b/src/modules/config/components/schedule/schedule-details/schedule-details.component.html index 60350b4dd..9719f58c1 100644 --- a/src/modules/config/components/schedule/schedule-details/schedule-details.component.html +++ b/src/modules/config/components/schedule/schedule-details/schedule-details.component.html @@ -78,6 +78,7 @@

Time limit

+ {{validFrom.errors | json}} diff --git a/src/modules/config/components/schedule/schedule-details/schedule-details.component.spec.ts b/src/modules/config/components/schedule/schedule-details/schedule-details.component.spec.ts index 646f65050..8ed6586c0 100644 --- a/src/modules/config/components/schedule/schedule-details/schedule-details.component.spec.ts +++ b/src/modules/config/components/schedule/schedule-details/schedule-details.component.spec.ts @@ -7,7 +7,6 @@ import {CoreTestingModule} from '../../../../core/core.testing.module'; import {LabelService} from '../../../services'; import {of} from 'rxjs'; import {AnnotationComponent, LabelComponent, MetaComponent} from '../..'; -import {AbilityModule} from '@casl/angular'; import {AuthService} from '../../../../core/services'; import {HarnessLoader} from '@angular/cdk/testing'; import {MatButtonHarness} from '@angular/material/button/testing'; @@ -19,7 +18,8 @@ import { MatDatepickerToggleHarness } from '@angular/material/datepicker/testing'; import {MatFormFieldHarness} from '@angular/material/form-field/testing'; -import moment from 'moment'; +import dayjs from 'dayjs'; +import {MAT_DATE_LOCALE} from "@angular/material/core"; const exampleCrawlSchedule: ConfigObject = { id: 'configObject_id', @@ -72,7 +72,6 @@ describe('ScheduleDetailsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - AbilityModule, CommonsModule, NoopAnimationsModule, CoreTestingModule.forRoot(), @@ -84,6 +83,10 @@ describe('ScheduleDetailsComponent', () => { AnnotationComponent ], providers: [ + { + provide: MAT_DATE_LOCALE, + useValue: 'nb', + }, { provide: AuthService, useValue: { @@ -384,22 +387,7 @@ describe('ScheduleDetailsComponent', () => { }); }); - // TODO: - // use no-nb as locale when inputting dates ? - // Use updateButton.click() instead of component.onUpdate().(Gets error fixture already destroyed when using click()) - - /** Testing datepicker component. - * When checking validation for entering invalid dates, output from calendar is in en-US locale. - * Same goes for when typing in input. - * ex: writing dd.mm.yyyy in test (24.12.2022), is invalid. - * Tested on live page (where locale is set), and works as expected (24.12.2022 is valid and 12.24.2022 is invalid). - * - * At the end of each test the updated configObject (from prepareSave), is validated to be as expected. - * - */ - it('setting valid from date in calendar sets timestamp to beginning of day', async () => { - let update: ConfigObject | undefined; component.update.subscribe((config: ConfigObject) => { update = config; @@ -411,42 +399,49 @@ describe('ScheduleDetailsComponent', () => { await fromCal.selectCell(dates[0]); await validFromToggle.closeCalendar(); fixture.detectChanges(); - const expectedFromDate = moment().add(1, 'M').month() + '/1/' + moment().year(); - expect(await validFrom.getValue()).toEqual(expectedFromDate); + + // Calculate the expected date and timestamp reliably + const expectedDate = dayjs().locale('nb').startOf('month'); + const expected = expectedDate.format('l'); + + expect(await validFrom.getValue()).toEqual(expected); expect(component.canUpdate).toBeTruthy(); + fixture.detectChanges(); component.onUpdate(); - const expectedTimestamp = moment().startOf('month').format('YYYY-MM-DD') + 'T00:00:00.000Z'; + + const expectedTimestamp = expectedDate.format('YYYY-MM-DD') + 'T00:00:00.000Z'; expect(update.crawlScheduleConfig.validFrom).toBe(expectedTimestamp); }); - it('setting valid from date in input sets timestamp to end of day', async () => { + it('setting valid from date in input sets timestamp to start of day', async () => { let update: ConfigObject | undefined; component.update.subscribe((config: ConfigObject) => { update = config; }); - await validFrom.setValue('1.32.2022'); + await validFrom.setValue('32.1.2022'); fixture.detectChanges(); await validFrom.blur(); expect(await validFromFormField.isControlValid()).toBeFalsy(); expect(component.canUpdate).toBeFalsy(); - await validFrom.setValue('13.1.2022'); + + await validFrom.setValue('1.13.2022'); await validFrom.blur(); expect(await validFromFormField.isControlValid()).toBeFalsy(); expect(component.canUpdate).toBeFalsy(); + await validFrom.setValue('1.1.2022'); await validFrom.blur(); - expect(await validFromFormField.isControlValid()).toBeTruthy(); expect(component.canUpdate).toBeTruthy(); component.onUpdate(); + expect(update.crawlScheduleConfig.validFrom).toBe('2022-01-01T00:00:00.000Z'); }); it('setting valid to date in calendar sets timestamp to end of day', async () => { - let update: ConfigObject | undefined; component.update.subscribe((config: ConfigObject) => { update = config; @@ -455,18 +450,18 @@ describe('ScheduleDetailsComponent', () => { await validToToggle.openCalendar(); const toCal = await validToToggle.getCalendar(); const daysInMonth = await toCal.getCells(); - await toCal.selectCell({text: (daysInMonth.length).toString()}); + await daysInMonth[daysInMonth.length -1].select(); await validToToggle.closeCalendar(); fixture.detectChanges(); - const expectedToDate = moment().add(1, 'M').month() + '/' + daysInMonth.length + '/' + moment().year(); + const expectedToDate = dayjs().locale('nb').endOf('month').format('D.M.YYYY'); expect(await validTo.getValue()).toEqual(expectedToDate); expect(component.canUpdate).toBeTruthy(); component.onUpdate(); - const expectedTimestamp = moment().endOf('month').format('YYYY-MM-DD') + 'T23:59:59.999Z'; + const expectedTimestamp = dayjs().locale('nb').endOf('month').format('YYYY-MM-DD') + 'T23:59:59.999Z'; expect(update.crawlScheduleConfig.validTo).toBe(expectedTimestamp); }); - it('setting valid to date in input sets timestamp to beginning of day', async () => { + it('setting valid to date in input sets timestamp to end of day', async () => { let update: ConfigObject | undefined; component.update.subscribe((config: ConfigObject) => { update = config; @@ -477,16 +472,18 @@ describe('ScheduleDetailsComponent', () => { await validTo.blur(); expect(await validToFormField.isControlValid()).toBeFalsy(); expect(component.canUpdate).toBeFalsy(); - await validTo.setValue('13.1.2022'); + + await validTo.setValue('32.1.2022'); + fixture.detectChanges(); await validTo.blur(); expect(await validToFormField.isControlValid()).toBeFalsy(); expect(component.canUpdate).toBeFalsy(); + await validTo.setValue('1.1.2022'); + fixture.detectChanges(); await validTo.blur(); - expect(await validToFormField.isControlValid()).toBeTruthy(); expect(component.canUpdate).toBeTruthy(); - component.onUpdate(); expect(update.crawlScheduleConfig.validTo).toBe('2022-01-01T23:59:59.999Z'); }); diff --git a/src/modules/config/components/schedule/schedule-details/schedule-details.component.ts b/src/modules/config/components/schedule/schedule-details/schedule-details.component.ts index f80b417b3..fe2f0ba90 100644 --- a/src/modules/config/components/schedule/schedule-details/schedule-details.component.ts +++ b/src/modules/config/components/schedule/schedule-details/schedule-details.component.ts @@ -22,9 +22,10 @@ import {DateTime} from '../../../../../shared/func'; @Component({ - selector: 'app-schedule-details', - templateUrl: './schedule-details.component.html', - styleUrls: ['./schedule-details.component.css'], + selector: 'app-schedule-details', + templateUrl: './schedule-details.component.html', + styleUrls: ['./schedule-details.component.css'], + standalone: false }) export class ScheduleDetailsComponent implements OnChanges { @Input() diff --git a/src/modules/config/components/schedule/schedule-dialog/schedule-dialog.component.spec.ts b/src/modules/config/components/schedule/schedule-dialog/schedule-dialog.component.spec.ts index be3d26df4..f716ac1a4 100644 --- a/src/modules/config/components/schedule/schedule-dialog/schedule-dialog.component.spec.ts +++ b/src/modules/config/components/schedule/schedule-dialog/schedule-dialog.component.spec.ts @@ -9,7 +9,6 @@ import {AnnotationComponent, LabelComponent, MetaComponent} from '../..'; import {ConfigDialogData} from '../../../func'; import {LabelService} from '../../../services'; import {of} from 'rxjs'; -import {AbilityModule} from '@casl/angular'; import {AuthService} from '../../../../core/services'; describe('ScheduleDialogComponent', () => { @@ -24,7 +23,7 @@ describe('ScheduleDialogComponent', () => { { component: ScheduleDialogComponent, declarations: [MetaComponent, LabelComponent, AnnotationComponent], - imports: [AbilityModule, CoreTestingModule.forRoot(), MatDialogModule, CommonsModule], + imports: [CoreTestingModule.forRoot(), MatDialogModule, CommonsModule], providers: [UntypedFormBuilder, { provide: LabelService, diff --git a/src/modules/config/components/schedule/schedule-dialog/schedule-dialog.component.ts b/src/modules/config/components/schedule/schedule-dialog/schedule-dialog.component.ts index 9c08bbfd1..3cf1e8d58 100644 --- a/src/modules/config/components/schedule/schedule-dialog/schedule-dialog.component.ts +++ b/src/modules/config/components/schedule/schedule-dialog/schedule-dialog.component.ts @@ -7,9 +7,10 @@ import {ConfigObject} from '../../../../../shared/models/config'; import {ScheduleDetailsComponent} from '..'; @Component({ - selector: 'app-schedule-dialog', - templateUrl: './schedule-dialog.component.html', - styleUrls: ['./schedule-dialog.component.css'] + selector: 'app-schedule-dialog', + templateUrl: './schedule-dialog.component.html', + styleUrls: ['./schedule-dialog.component.css'], + standalone: false }) export class ScheduleDialogComponent extends ScheduleDetailsComponent implements OnInit { diff --git a/src/modules/config/components/schedule/schedule-multi-dialog/schedule-multi-dialog.component.ts b/src/modules/config/components/schedule/schedule-multi-dialog/schedule-multi-dialog.component.ts index 4eea315df..b54e24589 100644 --- a/src/modules/config/components/schedule/schedule-multi-dialog/schedule-multi-dialog.component.ts +++ b/src/modules/config/components/schedule/schedule-multi-dialog/schedule-multi-dialog.component.ts @@ -9,9 +9,10 @@ import {DateTime} from '../../../../../shared/func'; import {LabelMultiComponent} from '../../label/label-multi/label-multi.component'; @Component({ - selector: 'app-schedule-multi-dialog', - templateUrl: './schedule-multi-dialog.component.html', - styleUrls: ['./schedule-multi-dialog.component.css'] + selector: 'app-schedule-multi-dialog', + templateUrl: './schedule-multi-dialog.component.html', + styleUrls: ['./schedule-multi-dialog.component.css'], + standalone: false }) export class ScheduleMultiDialogComponent extends ScheduleDetailsComponent implements OnInit { diff --git a/src/modules/config/components/schedule/schedule-preview/schedule-preview.component.ts b/src/modules/config/components/schedule/schedule-preview/schedule-preview.component.ts index 9b016531b..f98be8df9 100644 --- a/src/modules/config/components/schedule/schedule-preview/schedule-preview.component.ts +++ b/src/modules/config/components/schedule/schedule-preview/schedule-preview.component.ts @@ -2,9 +2,10 @@ import {Component, Input} from '@angular/core'; import {ConfigObject} from '../../../../../shared/models/config'; @Component({ - selector: 'app-schedule-preview', - templateUrl: './schedule-preview.component.html', - styleUrls: ['./schedule-preview.component.css'] + selector: 'app-schedule-preview', + templateUrl: './schedule-preview.component.html', + styleUrls: ['./schedule-preview.component.css'], + standalone: false }) export class SchedulePreviewComponent { @Input() diff --git a/src/modules/config/components/seed-meta/seed-meta-preview/seed-meta-preview.component.ts b/src/modules/config/components/seed-meta/seed-meta-preview/seed-meta-preview.component.ts index 44295eeaf..4999650c4 100644 --- a/src/modules/config/components/seed-meta/seed-meta-preview/seed-meta-preview.component.ts +++ b/src/modules/config/components/seed-meta/seed-meta-preview/seed-meta-preview.component.ts @@ -3,9 +3,10 @@ import {ConfigObject} from '../../../../../shared/models'; import {AuthService, SnackBarService} from '../../../../core/services'; @Component({ - selector: 'app-seed-meta-preview', - templateUrl: './seed-meta-preview.component.html', - styleUrls: ['./seed-meta-preview.component.css'] + selector: 'app-seed-meta-preview', + templateUrl: './seed-meta-preview.component.html', + styleUrls: ['./seed-meta-preview.component.css'], + standalone: false }) export class SeedMetaPreviewComponent { diff --git a/src/modules/config/components/seed-meta/seed-meta.component.spec.ts b/src/modules/config/components/seed-meta/seed-meta.component.spec.ts index a1a9d655d..39a553c36 100644 --- a/src/modules/config/components/seed-meta/seed-meta.component.spec.ts +++ b/src/modules/config/components/seed-meta/seed-meta.component.spec.ts @@ -7,7 +7,6 @@ import {LabelService} from '../../services'; import {of} from 'rxjs'; import {AnnotationComponent, LabelComponent} from '..'; import {CoreTestingModule} from '../../../core/core.testing.module'; -import {AbilityModule} from '@casl/angular'; import {CommonsModule} from '../../../commons'; import {HarnessLoader} from '@angular/cdk/testing'; import {MatFormFieldHarness} from '@angular/material/form-field/testing'; @@ -104,7 +103,6 @@ describe('SeedMetaComponent', () => { TestBed.configureTestingModule({ imports: [ ReactiveFormsModule, - AbilityModule, MaterialModule, CommonsModule, CoreTestingModule.forRoot(), diff --git a/src/modules/config/components/seed-meta/seed-meta.component.ts b/src/modules/config/components/seed-meta/seed-meta.component.ts index f9a010ab7..33fd917d2 100644 --- a/src/modules/config/components/seed-meta/seed-meta.component.ts +++ b/src/modules/config/components/seed-meta/seed-meta.component.ts @@ -32,14 +32,15 @@ export interface Parcel { } @Component({ - selector: 'app-seed-meta', - templateUrl: './seed-meta.component.html', - styleUrls: ['./seed-meta.component.css'], - providers: [ - {provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SeedMetaComponent), multi: true}, - {provide: NG_ASYNC_VALIDATORS, useExisting: forwardRef(() => SeedMetaComponent), multi: true} - ], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-seed-meta', + templateUrl: './seed-meta.component.html', + styleUrls: ['./seed-meta.component.css'], + providers: [ + { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SeedMetaComponent), multi: true }, + { provide: NG_ASYNC_VALIDATORS, useExisting: forwardRef(() => SeedMetaComponent), multi: true } + ], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class SeedMetaComponent extends MetaComponent implements AsyncValidator { diff --git a/src/modules/config/components/seed/seed-details/seed-details.component.ts b/src/modules/config/components/seed/seed-details/seed-details.component.ts index d458a4fe7..cdb30497e 100644 --- a/src/modules/config/components/seed/seed-details/seed-details.component.ts +++ b/src/modules/config/components/seed/seed-details/seed-details.component.ts @@ -18,9 +18,10 @@ import {Parcel} from '../..'; import {configRefIdRequired} from '../../../../../shared/validation/configref'; @Component({ - selector: 'app-seed-details', - templateUrl: './seed-details.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-seed-details', + templateUrl: './seed-details.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class SeedDetailsComponent implements OnChanges, OnDestroy { diff --git a/src/modules/config/components/seed/seed-dialog/seed-dialog.component.ts b/src/modules/config/components/seed/seed-dialog/seed-dialog.component.ts index 76c6d160e..0fe6dcbae 100644 --- a/src/modules/config/components/seed/seed-dialog/seed-dialog.component.ts +++ b/src/modules/config/components/seed/seed-dialog/seed-dialog.component.ts @@ -7,9 +7,10 @@ import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog'; import {ConfigDialogData} from '../../../func'; @Component({ - selector: 'app-entity-dialog', - templateUrl: './seed-dialog.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-entity-dialog', + templateUrl: './seed-dialog.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class SeedDialogComponent extends SeedDetailsComponent implements OnInit { crawlJobs: ConfigObject[]; diff --git a/src/modules/config/components/seed/seed-multi-dialog/seed-multi-dialog.component.ts b/src/modules/config/components/seed/seed-multi-dialog/seed-multi-dialog.component.ts index c103cb4f8..70f062435 100644 --- a/src/modules/config/components/seed/seed-multi-dialog/seed-multi-dialog.component.ts +++ b/src/modules/config/components/seed/seed-multi-dialog/seed-multi-dialog.component.ts @@ -8,9 +8,10 @@ import {ConfigObject, ConfigRef, Kind, Label} from '../../../../../shared/models import {LabelMultiComponent} from '../../label/label-multi/label-multi.component'; @Component({ - selector: 'app-seed-multi-dialog', - templateUrl: './seed-multi-dialog.component.html', - styleUrls: ['./seed-multi-dialog.component.css'] + selector: 'app-seed-multi-dialog', + templateUrl: './seed-multi-dialog.component.html', + styleUrls: ['./seed-multi-dialog.component.css'], + standalone: false }) export class SeedMultiDialogComponent extends SeedDetailsComponent implements OnInit { diff --git a/src/modules/config/components/seed/seed-preview/seed-preview.component.spec.ts b/src/modules/config/components/seed/seed-preview/seed-preview.component.spec.ts index 2a09052ae..563bbac12 100644 --- a/src/modules/config/components/seed/seed-preview/seed-preview.component.spec.ts +++ b/src/modules/config/components/seed/seed-preview/seed-preview.component.spec.ts @@ -2,7 +2,6 @@ import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; import {SeedPreviewComponent} from './seed-preview.component'; import {RouterTestingModule} from '@angular/router/testing'; -import {MatDialogModule} from '@angular/material/dialog'; import {CoreTestingModule} from '../../../../core/core.testing.module'; import {CommonsModule} from '../../../../commons'; diff --git a/src/modules/config/components/seed/seed-preview/seed-preview.component.ts b/src/modules/config/components/seed/seed-preview/seed-preview.component.ts index 9124bd8d9..67121b2dc 100644 --- a/src/modules/config/components/seed/seed-preview/seed-preview.component.ts +++ b/src/modules/config/components/seed/seed-preview/seed-preview.component.ts @@ -6,9 +6,10 @@ import {AuthService, SnackBarService} from '../../../../core/services'; @Component({ - selector: 'app-seed-preview', - templateUrl: './seed-preview.component.html', - styleUrls: ['./seed-preview.component.css'] + selector: 'app-seed-preview', + templateUrl: './seed-preview.component.html', + styleUrls: ['./seed-preview.component.css'], + standalone: false }) export class SeedPreviewComponent { readonly CrawlExecutionState = CrawlExecutionState; diff --git a/src/modules/config/components/selector/selector.component.ts b/src/modules/config/components/selector/selector.component.ts index 66d3e2f35..60f61412b 100644 --- a/src/modules/config/components/selector/selector.component.ts +++ b/src/modules/config/components/selector/selector.component.ts @@ -6,11 +6,12 @@ import {LabelComponent} from '../label/label.component'; @Component({ - selector: 'app-selector', - templateUrl: '../label/label.component.html', - styleUrls: ['../label/label.component.scss'], - providers: [{provide: NG_VALUE_ACCESSOR, useExisting: SelectorComponent, multi: true}], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-selector', + templateUrl: '../label/label.component.html', + styleUrls: ['../label/label.component.scss'], + providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: SelectorComponent, multi: true }], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class SelectorComponent extends LabelComponent implements OnInit { diff --git a/src/modules/config/components/shortcut/action-shortcut/action-shortcut.component.html b/src/modules/config/components/shortcut/action-shortcut/action-shortcut.component.html index 27c358dfe..ff6c7c03f 100644 --- a/src/modules/config/components/shortcut/action-shortcut/action-shortcut.component.html +++ b/src/modules/config/components/shortcut/action-shortcut/action-shortcut.component.html @@ -1,4 +1,4 @@ - +
Actions
@@ -6,7 +6,7 @@ @@ -17,7 +17,7 @@ play_arrow Crawl seed @@ -26,7 +26,7 @@ play_arrow Run crawljob @@ -35,7 +35,7 @@ file_copy Clone diff --git a/src/modules/config/components/shortcut/action-shortcut/action-shortcut.component.spec.ts b/src/modules/config/components/shortcut/action-shortcut/action-shortcut.component.spec.ts index f1be3024d..5b40ef91d 100644 --- a/src/modules/config/components/shortcut/action-shortcut/action-shortcut.component.spec.ts +++ b/src/modules/config/components/shortcut/action-shortcut/action-shortcut.component.spec.ts @@ -1,5 +1,4 @@ import {ActionShortcutComponent} from './action-shortcut.component'; -import {AbilityModule} from '@casl/angular'; import {CoreTestingModule} from '../../../../core/core.testing.module'; import {ConfigObject, Kind} from '../../../../../shared/models'; import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; @@ -11,7 +10,7 @@ describe('ActionShortcutComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CoreTestingModule.forRoot(), AbilityModule, MatListModule], + imports: [CoreTestingModule.forRoot(), MatListModule], declarations: [ActionShortcutComponent], providers: [] }) diff --git a/src/modules/config/components/shortcut/action-shortcut/action-shortcut.component.ts b/src/modules/config/components/shortcut/action-shortcut/action-shortcut.component.ts index 5d85804e5..571f27123 100644 --- a/src/modules/config/components/shortcut/action-shortcut/action-shortcut.component.ts +++ b/src/modules/config/components/shortcut/action-shortcut/action-shortcut.component.ts @@ -1,12 +1,16 @@ import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; import {ConfigObject, Kind} from '../../../../../shared/models/config'; +import {Observable} from "rxjs"; +import {AbilityService} from "@casl/angular"; @Component({ - selector: 'app-action-shortcut', - templateUrl: './action-shortcut.component.html', + selector: 'app-action-shortcut', + templateUrl: './action-shortcut.component.html', + standalone: false }) export class ActionShortcutComponent { readonly Kind = Kind; + readonly ability$: Observable @Input() configObject: ConfigObject; @@ -21,7 +25,8 @@ export class ActionShortcutComponent { clone = new EventEmitter(); - constructor() { + constructor(private ableService: AbilityService) { + this.ability$ = this.ableService.ability$; } onClone() { diff --git a/src/modules/config/components/shortcut/filter-shortcut/filter-shortcut.component.html b/src/modules/config/components/shortcut/filter-shortcut/filter-shortcut.component.html index 61374140e..183433bd0 100644 --- a/src/modules/config/components/shortcut/filter-shortcut/filter-shortcut.component.html +++ b/src/modules/config/components/shortcut/filter-shortcut/filter-shortcut.component.html @@ -1,11 +1,11 @@ - +
Filters
link @@ -18,7 +18,7 @@ Filters
{ @@ -12,7 +11,7 @@ describe('FilterShortcutComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CoreTestingModule.forRoot(), AbilityModule, MatListModule], + imports: [CoreTestingModule.forRoot(), MatListModule], declarations: [FilterShortcutComponent], providers: [] }) diff --git a/src/modules/config/components/shortcut/filter-shortcut/filter-shortcut.component.ts b/src/modules/config/components/shortcut/filter-shortcut/filter-shortcut.component.ts index ac71618ae..c649b78f5 100644 --- a/src/modules/config/components/shortcut/filter-shortcut/filter-shortcut.component.ts +++ b/src/modules/config/components/shortcut/filter-shortcut/filter-shortcut.component.ts @@ -1,13 +1,17 @@ import {Component, EventEmitter, Input, Output} from '@angular/core'; import {ConfigObject, Kind} from '../../../../../shared/models/config'; import {Params} from '@angular/router'; +import {Observable} from "rxjs"; +import {AbilityService} from "@casl/angular"; @Component({ - selector: 'app-filter-shortcut', - templateUrl: './filter-shortcut.component.html', + selector: 'app-filter-shortcut', + templateUrl: './filter-shortcut.component.html', + standalone: false }) export class FilterShortcutComponent { readonly Kind = Kind; + readonly ability$: Observable; @Input() configObject: ConfigObject; @@ -15,7 +19,8 @@ export class FilterShortcutComponent { @Output() clone = new EventEmitter(); - constructor() { + constructor(private abilityService: AbilityService) { + this.ability$ = this.abilityService.ability$; } getJobRefListQueryParams(configObject: ConfigObject): Params { diff --git a/src/modules/config/components/shortcut/shortcut-list/shortcut-list.component.html b/src/modules/config/components/shortcut/shortcut-list/shortcut-list.component.html index 559342150..2989fc469 100644 --- a/src/modules/config/components/shortcut/shortcut-list/shortcut-list.component.html +++ b/src/modules/config/components/shortcut/shortcut-list/shortcut-list.component.html @@ -1,4 +1,4 @@ - +
Entity
@@ -6,7 +6,7 @@ [routerLink]="['/config', 'entity', configObject.seed.entityRef.id]"> business {{configObject.seed.entityRef.id | getEntityName | async}}
- +
Crawljobs
- +
Schedule
@@ -30,7 +30,7 @@ {{configObject | getCrawlScheduleName | async}}
- +
CrawlConfig
@@ -38,7 +38,7 @@ {{configObject | getCrawlConfigName | async}}
- +
Scope script
web_asset @@ -50,7 +50,7 @@ - +
Collection
@@ -58,7 +58,7 @@ {{configObject | getCollectionName | async}}
- +
BrowserConfig
@@ -66,7 +66,7 @@ {{configObject | getBrowserConfigName | async}}
- +
PolitenessConfig
@@ -79,7 +79,7 @@ + *ngIf="configObject.browserConfig.scriptRefList.length > 0 && ability.can('read', Kind[Kind.BROWSERSCRIPT])">
BrowserScripts
diff --git a/src/modules/config/components/shortcut/shortcut-list/shortcut-list.component.spec.ts b/src/modules/config/components/shortcut/shortcut-list/shortcut-list.component.spec.ts index 94b66ef16..5a04fcf97 100644 --- a/src/modules/config/components/shortcut/shortcut-list/shortcut-list.component.spec.ts +++ b/src/modules/config/components/shortcut/shortcut-list/shortcut-list.component.spec.ts @@ -2,7 +2,6 @@ import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; import {ShortcutListComponent} from './shortcut-list.component'; import {ConfigObject, Kind} from '../../../../../shared/models'; -import {AbilityModule} from '@casl/angular'; import {CoreTestingModule} from '../../../../core/core.testing.module'; import {CommonsModule} from '../../../../commons'; import {EntityNamePipe} from '../../../pipe'; @@ -17,7 +16,7 @@ describe('ShortcutListComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [ShortcutListComponent, EntityNamePipe], - imports: [AbilityModule, CoreTestingModule.forRoot(), RouterTestingModule, CommonsModule], + imports: [CoreTestingModule.forRoot(), RouterTestingModule, CommonsModule], providers: [ { provide: ConfigService, useValue: { diff --git a/src/modules/config/components/shortcut/shortcut-list/shortcut-list.component.ts b/src/modules/config/components/shortcut/shortcut-list/shortcut-list.component.ts index 9a223a618..e21c06ab6 100644 --- a/src/modules/config/components/shortcut/shortcut-list/shortcut-list.component.ts +++ b/src/modules/config/components/shortcut/shortcut-list/shortcut-list.component.ts @@ -1,16 +1,20 @@ import {Component, Input} from '@angular/core'; import {ConfigObject, Kind} from 'src/shared/models'; +import {AbilityService} from "@casl/angular"; @Component({ - selector: 'app-shortcut-list', - templateUrl: './shortcut-list.component.html', + selector: 'app-shortcut-list', + templateUrl: './shortcut-list.component.html', + standalone: false }) export class ShortcutListComponent { readonly Kind = Kind; + readonly ability$: any; @Input() configObject: ConfigObject; - constructor() { + constructor(private abilityService: AbilityService) { + this.ability$ = this.abilityService.ability$; } } diff --git a/src/modules/config/components/shortcut/shortcut.component.ts b/src/modules/config/components/shortcut/shortcut.component.ts index e4412c75d..0b274d69d 100644 --- a/src/modules/config/components/shortcut/shortcut.component.ts +++ b/src/modules/config/components/shortcut/shortcut.component.ts @@ -5,9 +5,10 @@ import {ErrorService} from '../../../core/services'; import {JobExecutionState} from '../../../../shared/models/report'; @Component({ - selector: 'app-shortcut', - templateUrl: './shortcut.component.html', - styleUrls: ['./shortcut.component.scss'] + selector: 'app-shortcut', + templateUrl: './shortcut.component.html', + styleUrls: ['./shortcut.component.scss'], + standalone: false }) export class ShortcutComponent { readonly Kind = Kind; diff --git a/src/modules/config/containers/config-nav-list/config-nav-list.component.html b/src/modules/config/containers/config-nav-list/config-nav-list.component.html index 8a240775a..8e7b254b5 100644 --- a/src/modules/config/containers/config-nav-list/config-nav-list.component.html +++ b/src/modules/config/containers/config-nav-list/config-nav-list.component.html @@ -1,62 +1,71 @@ - - + business Entity - link Seed - work Crawljobs - schedule Schedule - settings_system_daydream CrawlConfig - collections_bookmark Collection - web BrowserConfig - web_asset BrowserScript - sentiment_very_satisfied Politeness - group_work CrawlHostGroup - people Users - diff --git a/src/modules/config/containers/config-nav-list/config-nav-list.component.ts b/src/modules/config/containers/config-nav-list/config-nav-list.component.ts index 8b9a6a0cf..96fae8ec1 100644 --- a/src/modules/config/containers/config-nav-list/config-nav-list.component.ts +++ b/src/modules/config/containers/config-nav-list/config-nav-list.component.ts @@ -5,16 +5,20 @@ import {AuthService} from '../../../core/services/auth'; import {NavigationListComponent} from '../../../commons/components'; import {ShortcutEventOutput, ShortcutInput} from 'ng-keyboard-shortcuts'; import {Router} from '@angular/router'; +import {Observable} from 'rxjs'; +import {AbilityService} from '@casl/angular'; @Component({ selector: 'app-config-navigation-list', templateUrl: './config-nav-list.component.html', styleUrls: ['../../../commons/components/navigation-list/navigation-list.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class ConfigNavListComponent extends NavigationListComponent { readonly ConfigPath = ConfigPath; readonly Kind = Kind; + readonly ability$: Observable shortcuts: ShortcutInput[] = []; @@ -24,7 +28,8 @@ export class ConfigNavListComponent extends NavigationListComponent { @Input() options: ConfigOptions; - constructor(protected authService: AuthService, private router: Router) { + constructor(protected authService: AuthService, private router: Router, private abilityService: AbilityService) { super(authService); + this.ability$ = this.abilityService.ability$; } } diff --git a/src/modules/config/containers/config/config.component.ts b/src/modules/config/containers/config/config.component.ts index 98de6593d..ec9b8365e 100644 --- a/src/modules/config/containers/config/config.component.ts +++ b/src/modules/config/containers/config/config.component.ts @@ -33,10 +33,11 @@ export interface ConfigOptions { } @Component({ - selector: 'app-configs', - templateUrl: './config.component.html', - styleUrls: ['./config.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-configs', + templateUrl: './config.component.html', + styleUrls: ['./config.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class ConfigComponent implements OnInit { readonly Kind = Kind; diff --git a/src/modules/config/containers/configuration/configuration.component.ts b/src/modules/config/containers/configuration/configuration.component.ts index fc8d1b1ae..e8fe274f1 100644 --- a/src/modules/config/containers/configuration/configuration.component.ts +++ b/src/modules/config/containers/configuration/configuration.component.ts @@ -44,10 +44,11 @@ export interface ConfigOptions { } @Component({ - selector: 'app-configuration', - templateUrl: './configuration.component.html', - styleUrls: ['./configuration.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'app-configuration', + templateUrl: './configuration.component.html', + styleUrls: ['./configuration.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false }) export class ConfigurationComponent implements OnDestroy { readonly Kind = Kind; diff --git a/src/modules/config/containers/configurations/configurations.component.html b/src/modules/config/containers/configurations/configurations.component.html index 32a164245..0464a8fca 100644 --- a/src/modules/config/containers/configurations/configurations.component.html +++ b/src/modules/config/containers/configurations/configurations.component.html @@ -1,4 +1,4 @@ -
+
@@ -6,7 +6,7 @@ -