update dependencies and migrate
This commit is contained in:
+2
-2
@@ -14,13 +14,13 @@
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<querydsl.version>5.1.0</querydsl.version>
|
||||
<revision>0.6.0</revision>
|
||||
<revision>0.8.0</revision>
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.3.5</version>
|
||||
<version>3.4.5</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ public class UserManager implements UserDetailsService, SmartInitializingSinglet
|
||||
public void afterSingletonsInstantiated() {
|
||||
if (!userRepository.exists(qUser.roles.contains("ROLE_ADMIN"))) {
|
||||
if (!StringUtils.hasText(adminPassword)) {
|
||||
adminPassword = RandomStringUtils.random(24, true, true);
|
||||
adminPassword = RandomStringUtils.secure().next(24, true, true);
|
||||
logger.error("password for 'admin': " + adminPassword);
|
||||
}
|
||||
User admin = new User();
|
||||
|
||||
+5
-5
@@ -55,7 +55,7 @@ public class DebugController {
|
||||
for (long i = userCount + 1; i <= userCount + usersParameter.orElse(5); i++) {
|
||||
User user = new User();
|
||||
String username = (splittableRandom.nextBoolean() ? "Tätowiererin " : "Tätowierer ") + i;
|
||||
String name = "Random " + RandomStringUtils.randomAlphanumeric(splittableRandom.nextInt(4, 8));
|
||||
String name = "Random " + RandomStringUtils.secure().nextAlphabetic(splittableRandom.nextInt(4, 8));
|
||||
user.setUsername(username);
|
||||
user.setName(name);
|
||||
user.setPasswordHash(passwordEncoder.encode(username));
|
||||
@@ -79,9 +79,9 @@ public class DebugController {
|
||||
: randomDate(turnover.getCreated(), endExclusive));
|
||||
turnover.setDueDate(splittableRandom.nextBoolean() ? turnover.getCreated()
|
||||
: randomDate(startInclusive, turnover.getCreated()));
|
||||
turnover.setCustomer(RandomStringUtils.randomAlphabetic(splittableRandom.nextInt(3, 10)));
|
||||
turnover.setCustomer(RandomStringUtils.secure().nextAlphabetic(splittableRandom.nextInt(3, 10)));
|
||||
|
||||
turnover.setMotif(RandomStringUtils.randomAlphabetic(splittableRandom.nextInt(5, 30)));
|
||||
turnover.setMotif(RandomStringUtils.secure().nextAlphabetic(splittableRandom.nextInt(5, 30)));
|
||||
|
||||
turnover.setPrice(Float.valueOf(String.format("%.2f", splittableRandom.nextFloat(0.01f, 2000f))));
|
||||
|
||||
@@ -91,12 +91,12 @@ public class DebugController {
|
||||
}
|
||||
|
||||
if (splittableRandom.nextBoolean()) {
|
||||
turnover.setRemark(RandomStringUtils.randomAlphabetic(splittableRandom.nextInt(10, 50)));
|
||||
turnover.setRemark(RandomStringUtils.secure().nextAlphabetic(splittableRandom.nextInt(10, 50)));
|
||||
}
|
||||
|
||||
if (splittableRandom.nextInt(5) < 3) {
|
||||
turnover.setMaterialConsumption(
|
||||
RandomStringUtils.randomAlphabetic(splittableRandom.nextInt(10, 250)));
|
||||
RandomStringUtils.secure().nextAlphabetic(splittableRandom.nextInt(10, 250)));
|
||||
}
|
||||
|
||||
turnover = turnoverRepository.save(turnover);
|
||||
|
||||
Generated
+3775
-2984
File diff suppressed because it is too large
Load Diff
+22
-22
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "buntspecht-web",
|
||||
"version": "0.6.2",
|
||||
"version": "0.8.0",
|
||||
"license": "AGPL3",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
@@ -12,35 +12,35 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^18.2.12",
|
||||
"@angular/cdk": "^18.2.13",
|
||||
"@angular/common": "^18.2.12",
|
||||
"@angular/compiler": "^18.2.12",
|
||||
"@angular/core": "^18.2.12",
|
||||
"@angular/forms": "^18.2.12",
|
||||
"@angular/material": "^18.2.13",
|
||||
"@angular/material-moment-adapter": "^18.2.13",
|
||||
"@angular/platform-browser": "^18.2.12",
|
||||
"@angular/platform-browser-dynamic": "^18.2.12",
|
||||
"@angular/router": "^18.2.12",
|
||||
"@angular/service-worker": "^18.2.12",
|
||||
"@angular/animations": "^19.2.10",
|
||||
"@angular/cdk": "^19.2.15",
|
||||
"@angular/common": "^19.2.10",
|
||||
"@angular/compiler": "^19.2.10",
|
||||
"@angular/core": "^19.2.10",
|
||||
"@angular/forms": "^19.2.10",
|
||||
"@angular/material": "^19.2.15",
|
||||
"@angular/material-moment-adapter": "^19.2.15",
|
||||
"@angular/platform-browser": "^19.2.10",
|
||||
"@angular/platform-browser-dynamic": "^19.2.10",
|
||||
"@angular/router": "^19.2.10",
|
||||
"@angular/service-worker": "^19.2.10",
|
||||
"moment": "^2.30.1",
|
||||
"rxjs": "~7.8.1",
|
||||
"rxjs": "~7.8.2",
|
||||
"tslib": "^2.8.1",
|
||||
"zone.js": "~0.14.10"
|
||||
"zone.js": "~0.15.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "^18.2.12",
|
||||
"@angular/cli": "^18.2.12",
|
||||
"@angular/compiler-cli": "^18.2.12",
|
||||
"@angular/localize": "^18.2.12",
|
||||
"@types/jasmine": "^5.1.4",
|
||||
"jasmine-core": "~5.4.0",
|
||||
"@angular-devkit/build-angular": "^19.2.11",
|
||||
"@angular/cli": "^19.2.11",
|
||||
"@angular/compiler-cli": "^19.2.10",
|
||||
"@angular/localize": "^19.2.10",
|
||||
"@types/jasmine": "^5.1.8",
|
||||
"jasmine-core": "~5.7.1",
|
||||
"karma": "^6.4.4",
|
||||
"karma-chrome-launcher": "~3.2.0",
|
||||
"karma-coverage": "~2.2.1",
|
||||
"karma-jasmine": "~5.1.0",
|
||||
"karma-jasmine-html-reporter": "^2.1.0",
|
||||
"typescript": "~5.5.4"
|
||||
"typescript": "~5.8.3"
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import { Component } from '@angular/core';
|
||||
import { I18nService } from './services/i18n.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
||||
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';
|
||||
import { AuthService } from '../services/auth.service';
|
||||
import { I18nService } from '../services/i18n.service';
|
||||
import { RequestError } from '../services/requesterror';
|
||||
import { UserService } from '../services/user.service';
|
||||
import { I18nService } from '../services/i18n.service';
|
||||
|
||||
|
||||
@Injectable({
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Directive, ElementRef, OnInit } from '@angular/core';
|
||||
|
||||
@Directive({
|
||||
standalone: false,
|
||||
selector: '[matAutofocus]',
|
||||
})
|
||||
export class AutofocusDirective implements OnInit {
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
|
||||
// Material Form Controls
|
||||
import {MatAutocompleteModule} from '@angular/material/autocomplete';
|
||||
import {MatCheckboxModule} from '@angular/material/checkbox';
|
||||
import {MatDatepickerModule} from '@angular/material/datepicker';
|
||||
import {MatFormFieldModule} from '@angular/material/form-field';
|
||||
import {MatInputModule} from '@angular/material/input';
|
||||
import {MatRadioModule} from '@angular/material/radio';
|
||||
import {MatSelectModule} from '@angular/material/select';
|
||||
import {MatSliderModule} from '@angular/material/slider';
|
||||
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
|
||||
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatRadioModule } from '@angular/material/radio';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
||||
import { MatSliderModule } from '@angular/material/slider';
|
||||
// Material Navigation
|
||||
import {MatMenuModule} from '@angular/material/menu';
|
||||
import {MatSidenavModule} from '@angular/material/sidenav';
|
||||
import {MatToolbarModule} from '@angular/material/toolbar';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatSidenavModule } from '@angular/material/sidenav';
|
||||
import { MatToolbarModule } from '@angular/material/toolbar';
|
||||
// Material Layout
|
||||
import {MatCardModule} from '@angular/material/card';
|
||||
import {MatDividerModule} from '@angular/material/divider';
|
||||
import {MatExpansionModule} from '@angular/material/expansion';
|
||||
import {MatGridListModule} from '@angular/material/grid-list';
|
||||
import {MatListModule} from '@angular/material/list';
|
||||
import {MatStepperModule} from '@angular/material/stepper';
|
||||
import {MatTabsModule} from '@angular/material/tabs';
|
||||
import {MatTreeModule} from '@angular/material/tree';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
import { MatExpansionModule } from '@angular/material/expansion';
|
||||
import { MatGridListModule } from '@angular/material/grid-list';
|
||||
import { MatListModule } from '@angular/material/list';
|
||||
import { MatStepperModule } from '@angular/material/stepper';
|
||||
import { MatTabsModule } from '@angular/material/tabs';
|
||||
import { MatTreeModule } from '@angular/material/tree';
|
||||
// Material Buttons & Indicators
|
||||
import {MatButtonModule} from '@angular/material/button';
|
||||
import {MatButtonToggleModule} from '@angular/material/button-toggle';
|
||||
import {MatBadgeModule} from '@angular/material/badge';
|
||||
import {MatChipsModule} from '@angular/material/chips';
|
||||
import {MatIconModule} from '@angular/material/icon';
|
||||
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
|
||||
import {MatProgressBarModule} from '@angular/material/progress-bar';
|
||||
import {MatRippleModule} from '@angular/material/core';
|
||||
import { MatBadgeModule } from '@angular/material/badge';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
||||
import { MatChipsModule } from '@angular/material/chips';
|
||||
import { MatRippleModule } from '@angular/material/core';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
// Material Popups & Modals
|
||||
import {MatBottomSheetModule} from '@angular/material/bottom-sheet';
|
||||
import {MatDialogModule} from '@angular/material/dialog';
|
||||
import {MatSnackBarModule} from '@angular/material/snack-bar';
|
||||
import {MatTooltipModule} from '@angular/material/tooltip';
|
||||
import { MatBottomSheetModule } from '@angular/material/bottom-sheet';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
// Material Data tables
|
||||
import {MatPaginatorModule} from '@angular/material/paginator';
|
||||
import {MatSortModule} from '@angular/material/sort';
|
||||
import {MatTableModule} from '@angular/material/table';
|
||||
import {MatMomentDateModule} from '@angular/material-moment-adapter';
|
||||
import { MatMomentDateModule } from '@angular/material-moment-adapter';
|
||||
import { MatPaginatorModule } from '@angular/material/paginator';
|
||||
import { MatSortModule } from '@angular/material/sort';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
|
||||
@NgModule({
|
||||
declarations: [],
|
||||
@@ -123,4 +123,4 @@ import {MatMomentDateModule} from '@angular/material-moment-adapter';
|
||||
MatTableModule
|
||||
]
|
||||
})
|
||||
export class MaterialModule {}
|
||||
export class MaterialModule { }
|
||||
|
||||
@@ -6,6 +6,7 @@ import { environment } from '../../../environments/environment';
|
||||
import { AuthService } from '../../services/auth.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'page-login',
|
||||
templateUrl: './login.page.html',
|
||||
styleUrls: ['./login.page.scss']
|
||||
|
||||
@@ -10,6 +10,7 @@ import { UserManagementService } from 'src/app/services/user.management.service'
|
||||
import { UiTurnovers } from 'src/app/ui/turnovers/turnovers.ui';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'ui-management',
|
||||
templateUrl: './management.page.html',
|
||||
styleUrls: ['./management.page.scss']
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'page-notfound',
|
||||
templateUrl: './notfound.page.html',
|
||||
styleUrls: [ './notfound.page.scss' ]
|
||||
styleUrls: ['./notfound.page.scss']
|
||||
})
|
||||
export class PageNotFound {
|
||||
export class PageNotFound {
|
||||
|
||||
constructor() { }
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { AbstractControlOptions, FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
|
||||
import { UserService } from '../../services/user.service';
|
||||
import { MatchingValidator } from 'src/app/utils/matching.validator';
|
||||
import { UserService } from '../../services/user.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'page-password',
|
||||
templateUrl: './password.page.html',
|
||||
styleUrls: ['./password.page.scss']
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { AbstractControlOptions, FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
|
||||
import { UserService } from '../../services/user.service';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { UserManagementService } from 'src/app/services/user.management.service';
|
||||
import { MatchingValidator } from 'src/app/utils/matching.validator';
|
||||
import { ConfirmDialog } from 'src/app/ui/confirm/confirm.component';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatchingValidator } from 'src/app/utils/matching.validator';
|
||||
import { UserService } from '../../services/user.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'page-profile',
|
||||
templateUrl: './profile.page.html',
|
||||
styleUrls: ['./profile.page.scss']
|
||||
@@ -111,7 +112,7 @@ export class PageProfile implements OnInit, OnDestroy {
|
||||
for (let errorObject of error.error) {
|
||||
errors[errorObject.field] = errors[errorObject.field] || {};
|
||||
errors[errorObject.field][errorObject.code] = errorObject.arguments || true;
|
||||
}
|
||||
}
|
||||
|
||||
for (let code in errors) {
|
||||
this.profileForm.get(code).setErrors(errors[code]);
|
||||
@@ -141,7 +142,7 @@ export class PageProfile implements OnInit, OnDestroy {
|
||||
for (let errorObject of error.error) {
|
||||
errors[errorObject.field] = errors[errorObject.field] || {};
|
||||
errors[errorObject.field][errorObject.code] = errorObject.arguments || true;
|
||||
}
|
||||
}
|
||||
|
||||
for (let code in errors) {
|
||||
this.passwordForm.get(code).setErrors(errors[code]);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { MatDatepickerInputEvent } from '@angular/material/datepicker';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
@@ -11,6 +10,7 @@ import { TurnoverService } from 'src/app/services/turnover.service';
|
||||
import { ConfirmDialog } from 'src/app/ui/confirm/confirm.component';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'page-turnover',
|
||||
templateUrl: './turnover.page.html',
|
||||
styleUrls: ['./turnover.page.scss']
|
||||
|
||||
@@ -9,6 +9,7 @@ import { UserManagementService } from 'src/app/services/user.management.service'
|
||||
import { UiTurnovers } from 'src/app/ui/turnovers/turnovers.ui';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'page-turnovers-manage',
|
||||
templateUrl: './manage.page.html',
|
||||
styleUrls: ['./manage.page.scss']
|
||||
|
||||
@@ -6,6 +6,7 @@ import { TurnoverService } from 'src/app/services/turnover.service';
|
||||
import { UiTurnovers } from 'src/app/ui/turnovers/turnovers.ui';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'page-turnovers',
|
||||
templateUrl: './turnovers.page.html',
|
||||
styleUrls: ['./turnovers.page.scss']
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { Location } from '@angular/common';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Location } from '@angular/common'
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'page-unavailable',
|
||||
templateUrl: './unavailable.page.html',
|
||||
styleUrls: ['./unavailable.page.scss']
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Router } from '@angular/router';
|
||||
import { UserManagementService } from 'src/app/services/user.management.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'page-user-create',
|
||||
templateUrl: './users.create.page.html',
|
||||
styleUrls: ['./users.create.page.scss']
|
||||
|
||||
@@ -6,6 +6,7 @@ import { AuthService } from 'src/app/services/auth.service';
|
||||
import { UserManagementService } from 'src/app/services/user.management.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'ui-users',
|
||||
templateUrl: './users.page.html',
|
||||
styleUrls: ['./users.page.scss']
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ReplaySubject, of } from 'rxjs';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ReplaySubject } from 'rxjs';
|
||||
|
||||
import { RequestError } from './requesterror';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { environment } from '../../environments/environment';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MatPaginatorIntl } from '@angular/material/paginator';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { environment } from '../../environments/environment';
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import {Component, Inject} from '@angular/core';
|
||||
import {MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
|
||||
import {I18nService} from '../../services/i18n.service';
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { I18nService } from '../../services/i18n.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
templateUrl: 'confirm.component.html',
|
||||
styleUrls: ['./confirm.component.scss']
|
||||
})
|
||||
export class ConfirmDialog {
|
||||
|
||||
|
||||
text;
|
||||
|
||||
constructor(private i18nService: I18nService,
|
||||
|
||||
@@ -7,12 +7,13 @@ import { AuthService } from '../../services/auth.service';
|
||||
import { I18nService } from '../../services/i18n.service';
|
||||
import { UserService } from '../../services/user.service';
|
||||
|
||||
import { SwUpdate } from '@angular/service-worker';
|
||||
import packageJson from '../../../../package.json';
|
||||
import { MatSidenav } from '@angular/material/sidenav';
|
||||
import { SwUpdate } from '@angular/service-worker';
|
||||
import { DebugService } from 'src/app/services/debug.service';
|
||||
import packageJson from '../../../../package.json';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'ui-main',
|
||||
templateUrl: './main.ui.html',
|
||||
styleUrls: ['./main.ui.scss']
|
||||
|
||||
@@ -6,6 +6,7 @@ import moment from 'moment';
|
||||
import { I18nService } from 'src/app/services/i18n.service';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'ui-turnovers',
|
||||
templateUrl: './turnovers.ui.html',
|
||||
styleUrls: ['./turnovers.ui.scss']
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { I18nService } from './../services/i18n.service';
|
||||
|
||||
@Pipe({
|
||||
standalone: false,
|
||||
name: 'i18n'
|
||||
})
|
||||
export class I18nPipe implements PipeTransform {
|
||||
@@ -21,6 +22,7 @@ export class I18nPipe implements PipeTransform {
|
||||
}
|
||||
|
||||
@Pipe({
|
||||
standalone: false,
|
||||
name: 'i18nEmpty'
|
||||
})
|
||||
export class I18nEmptyPipe implements PipeTransform {
|
||||
@@ -34,6 +36,7 @@ export class I18nEmptyPipe implements PipeTransform {
|
||||
}
|
||||
|
||||
@Pipe({
|
||||
standalone: false,
|
||||
name: 'errorCode'
|
||||
})
|
||||
export class ErrorCodePipe implements PipeTransform {
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import * as moment from 'moment';
|
||||
|
||||
@Pipe({ name: 'datef' })
|
||||
@Pipe({
|
||||
standalone: false,
|
||||
name: 'datef'
|
||||
})
|
||||
export class MomentPipe implements PipeTransform {
|
||||
transform(value: Date | moment.Moment, dateFormat: string | undefined = undefined): any {
|
||||
if (!dateFormat) {
|
||||
return moment(value).fromNow();
|
||||
}
|
||||
|
||||
|
||||
return moment(value).format(dateFormat);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user