dashboard #1

Merged
andi merged 118 commits from dashboard into master 2024-09-29 06:47:35 +00:00
6 changed files with 20 additions and 8 deletions
Showing only changes of commit ea3ccabe56 - Show all commits

View File

@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ElementRef, ViewChild } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';
@Component({
@@ -8,7 +8,6 @@ import { MatDialogRef } from '@angular/material/dialog';
})
export class AddPlotDialogComponent {
constructor(public dialogRef: MatDialogRef<string>){
}

View File

@@ -2,7 +2,7 @@
<div mat-dialog-content>
<mat-form-field appearance="fill">
<mat-label>Text</mat-label>
<textarea matInput [(ngModel)]="text"></textarea>
<textarea matInput [(ngModel)]="text" #textElement></textarea>
</mat-form-field>
</div>
<div mat-dialog-actions align="end">

View File

@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';
@Component({
@@ -6,12 +6,18 @@ import { MatDialogRef } from '@angular/material/dialog';
templateUrl: './add-text-dialog.component.html',
styleUrls: ['./add-text-dialog.component.scss']
})
export class AddTextDialogComponent {
export class AddTextDialogComponent implements OnInit {
text = "";
@ViewChild('textElement') textElement!: ElementRef;
constructor(public dialogRef: MatDialogRef<string>){
}
ngOnInit(): void {
window.setTimeout(() => this.textElement.nativeElement.focus(), 0);
}
onSaveClick(): void {
this.dialogRef.close(this.text);
}

View File

@@ -2,7 +2,7 @@
<div mat-dialog-content>
<mat-form-field appearance="fill">
<mat-label>Name</mat-label>
<input matInput [(ngModel)]="data.name">
<input matInput [(ngModel)]="data.name" #name>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Description</mat-label>

View File

@@ -1,4 +1,4 @@
import { Component, Inject } from '@angular/core';
import { Component, ElementRef, Inject, OnInit, ViewChild } from '@angular/core';
import {MatDialog, MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
import { DashboardCreationData } from 'src/app/dashboard.service';
@@ -7,11 +7,18 @@ import { DashboardCreationData } from 'src/app/dashboard.service';
templateUrl: './new-dashboard.component.html',
styleUrls: ['./new-dashboard.component.scss']
})
export class NewDashboardComponent {
export class NewDashboardComponent implements OnInit {
@ViewChild('name') nameInput!: ElementRef;
constructor(public dialogRef: MatDialogRef<NewDashboardComponent>,
@Inject(MAT_DIALOG_DATA) public data: DashboardCreationData,){
}
ngOnInit(): void {
window.setTimeout(() => this.nameInput.nativeElement.focus(), 0);
}
onSaveClick(): void {
this.dialogRef.close(this.data);
}