From a6ae8e533e42c23f24daaf8fc8f91482d490bcfa Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Sun, 29 Sep 2024 13:11:15 +0200 Subject: [PATCH] convert new dashboard component to standalone component --- pdb-js/src/app/app.module.ts | 2 -- .../new-dashboard/new-dashboard.component.ts | 21 ++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/pdb-js/src/app/app.module.ts b/pdb-js/src/app/app.module.ts index 026e139..bcb498c 100644 --- a/pdb-js/src/app/app.module.ts +++ b/pdb-js/src/app/app.module.ts @@ -37,7 +37,6 @@ import { } from "./gallery-view/gallery-view.component"; import { ImageToggleComponent } from "./image-toggle/image-toggle.component"; import { DashboardPageComponent } from "./dashboard-page/dashboard-page.component"; -import { NewDashboardComponent } from "./dashboard-page/new-dashboard/new-dashboard.component"; import { MAT_DIALOG_DEFAULT_OPTIONS, MatDialogModule, @@ -75,7 +74,6 @@ import { MarkdownModule } from "ngx-markdown"; GalleryFilterView, ImageToggleComponent, DashboardPageComponent, - NewDashboardComponent, DashboardComponent, TextWidgetComponent, AddPlotDialogComponent, diff --git a/pdb-js/src/app/dashboard-page/new-dashboard/new-dashboard.component.ts b/pdb-js/src/app/dashboard-page/new-dashboard/new-dashboard.component.ts index 99661ab..c493f08 100644 --- a/pdb-js/src/app/dashboard-page/new-dashboard/new-dashboard.component.ts +++ b/pdb-js/src/app/dashboard-page/new-dashboard/new-dashboard.component.ts @@ -1,11 +1,26 @@ import { Component, ElementRef, Inject, OnInit, ViewChild } from '@angular/core'; -import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog'; +import {MAT_DIALOG_DATA, MatDialogModule, MatDialogRef} from '@angular/material/dialog'; import { DashboardCreationData } from 'src/app/dashboard.service'; -import { AbstractControl, FormControl, FormGroup, ValidationErrors, ValidatorFn, Validators } from '@angular/forms'; +import { FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; +import { BrowserModule } from '@angular/platform-browser'; +import { MatButtonModule } from '@angular/material/button'; +import { OverlayModule } from '@angular/cdk/overlay'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; @Component({ selector: 'app-new-dashboard', - templateUrl: './new-dashboard.component.html' + templateUrl: './new-dashboard.component.html', + standalone: true, + imports: [ + BrowserModule, + FormsModule, + MatButtonModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + ReactiveFormsModule + ] }) export class NewDashboardComponent implements OnInit {