Moved to Angular 20
Moved to Tailwind 4 Moved to Python 3.13 Enabled arm64/v8 Builds
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core';
|
||||
import { FormArray, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
@@ -29,6 +29,12 @@ import { RoleService } from '../role.service';
|
||||
],
|
||||
})
|
||||
export class RoleDetailComponent implements OnInit, AfterViewInit {
|
||||
private route = inject(ActivatedRoute);
|
||||
private router = inject(Router);
|
||||
private toaster = inject(ToasterService);
|
||||
private dialog = inject(MatDialog);
|
||||
private ser = inject(RoleService);
|
||||
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup<{
|
||||
name: FormControl<string>;
|
||||
@@ -41,13 +47,7 @@ export class RoleDetailComponent implements OnInit, AfterViewInit {
|
||||
|
||||
item: Role = new Role();
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private toaster: ToasterService,
|
||||
private dialog: MatDialog,
|
||||
private ser: RoleService,
|
||||
) {
|
||||
constructor() {
|
||||
// Create form
|
||||
this.form = new FormGroup({
|
||||
name: new FormControl<string>('', { nonNullable: true }),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, inject } from '@angular/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
@@ -6,7 +6,6 @@ import { MatTableModule } from '@angular/material/table';
|
||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||
|
||||
import { Role } from '../role';
|
||||
|
||||
import { RoleListDataSource } from './role-list-datasource';
|
||||
|
||||
@Component({
|
||||
@@ -16,13 +15,13 @@ import { RoleListDataSource } from './role-list-datasource';
|
||||
imports: [MatButtonModule, MatCardModule, MatIconModule, MatTableModule, RouterLink],
|
||||
})
|
||||
export class RoleListComponent implements OnInit {
|
||||
private route = inject(ActivatedRoute);
|
||||
|
||||
list: Role[] = [];
|
||||
dataSource: RoleListDataSource = new RoleListDataSource(this.list);
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['name', 'permissions'];
|
||||
|
||||
constructor(private route: ActivatedRoute) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { list: Role[] };
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
|
||||
import { Role } from './role';
|
||||
|
||||
const httpOptions = {
|
||||
@@ -17,10 +16,8 @@ const serviceName = 'RoleService';
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class RoleService {
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private log: ErrorLoggerService,
|
||||
) {}
|
||||
private http = inject(HttpClient);
|
||||
private log = inject(ErrorLoggerService);
|
||||
|
||||
get(id: string | null): Observable<Role> {
|
||||
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { Routes } from '@angular/router';
|
||||
|
||||
import { authGuard } from '../auth/auth-guard.service';
|
||||
|
||||
import { RoleDetailComponent } from './role-detail/role-detail.component';
|
||||
import { RoleListComponent } from './role-list/role-list.component';
|
||||
import { roleListResolver } from './role-list.resolver';
|
||||
import { RoleListComponent } from './role-list/role-list.component';
|
||||
import { roleResolver } from './role.resolver';
|
||||
|
||||
export const routes: Routes = [
|
||||
|
||||
Reference in New Issue
Block a user