Skip to content

Commit c60f590

Browse files
committed
Add Google Analytics
Improve Messages
1 parent 8e26c26 commit c60f590

File tree

7 files changed

+36
-8
lines changed

7 files changed

+36
-8
lines changed

src/app/app.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import { Component } from '@angular/core';
22
import { Performance } from '@angular/fire/performance';
3+
import { Analytics } from '@angular/fire/analytics';
34

45
@Component({
56
selector: 'll-root',
67
templateUrl: './app.component.html',
78
styleUrls: ['./app.component.scss'],
89
})
910
export class AppComponent {
10-
constructor(private readonly performance: Performance) {}
11+
constructor(
12+
private readonly performance: Performance,
13+
private readonly analytics: Analytics,
14+
) {}
1115
}

src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { IMAGE_LOADER, ImageLoaderConfig } from '@angular/common';
2727
import { MarkdownModule } from 'ngx-markdown';
2828
import { provideHttpClient, withFetch, withInterceptorsFromDi } from '@angular/common/http';
2929
import { MatIconRegistry } from '@angular/material/icon';
30+
import { getAnalytics, provideAnalytics } from '@angular/fire/analytics';
3031

3132
@NgModule({
3233
declarations: [AppComponent],
@@ -83,6 +84,7 @@ import { MatIconRegistry } from '@angular/material/icon';
8384
}
8485
return functions;
8586
}),
87+
provideAnalytics(() => getAnalytics()),
8688
providePerformance(() => {
8789
return getPerformance();
8890
}),

src/app/features/admin/spaces/spaces.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class SpacesComponent implements OnInit {
106106
.open<ConfirmationDialogComponent, ConfirmationDialogModel, boolean>(ConfirmationDialogComponent, {
107107
data: {
108108
title: 'Delete Space',
109-
content: `Are you sure about deleting Space with name '${element.name}'.`,
109+
content: `Are you sure about deleting Space with name '${element.name}'.\n This action can not be undone.`,
110110
},
111111
})
112112
.afterClosed()

src/app/features/spaces/assets/assets.component.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,20 @@ export class AssetsComponent implements OnInit {
214214
// Prevent Default
215215
event.preventDefault();
216216
event.stopImmediatePropagation();
217+
let title = '';
218+
let content = '';
219+
if (element.kind === AssetKind.FOLDER) {
220+
title = 'Delete Folder';
221+
content = `Are you sure about deleting Folder with name: ${element.name}.\n All sub folders and assets will be deleted.`;
222+
} else if (element.kind === AssetKind.FILE) {
223+
title = 'Delete Asset';
224+
content = `Are you sure about deleting Asset with name: ${element.name}.`;
225+
}
217226
this.dialog
218227
.open<ConfirmationDialogComponent, ConfirmationDialogModel, boolean>(ConfirmationDialogComponent, {
219228
data: {
220-
title: 'Delete Asset',
221-
content: `Are you sure about deleting Asset with name: ${element.name}.`,
229+
title: title,
230+
content: content,
222231
},
223232
})
224233
.afterClosed()

src/app/features/spaces/contents/contents.component.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,20 @@ export class ContentsComponent {
186186
// Prevent Default
187187
event.preventDefault();
188188
event.stopImmediatePropagation();
189+
let title = '';
190+
let content = '';
191+
if (element.kind === ContentKind.FOLDER) {
192+
title = 'Delete Folder';
193+
content = `Are you sure about deleting Folder with name: ${element.name}.\n All sub folders and documents will be deleted.`;
194+
} else if (element.kind === ContentKind.DOCUMENT) {
195+
title = 'Delete Document';
196+
content = `Are you sure about deleting Document with name: ${element.name}.`;
197+
}
189198
this.dialog
190199
.open<ConfirmationDialogComponent, ConfirmationDialogModel, boolean>(ConfirmationDialogComponent, {
191200
data: {
192-
title: 'Delete Content',
193-
content: `Are you sure about deleting Content with name: ${element.name}.`,
201+
title: title,
202+
content: content,
194203
},
195204
})
196205
.afterClosed()

src/app/features/spaces/schemas/schemas.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export class SchemasComponent implements OnInit {
200200
.open<ConfirmationDialogComponent, ConfirmationDialogModel, boolean>(ConfirmationDialogComponent, {
201201
data: {
202202
title: 'Delete Schema',
203-
content: `Are you sure about deleting Schema with name '${element.id}'.`,
203+
content: `Are you sure about deleting Schema with name '${element.id}'.\n Any Content document associated with the Schema will not work anymore.`,
204204
},
205205
})
206206
.afterClosed()

src/app/shared/components/confirmation-dialog/confirmation-dialog.component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<h2 mat-dialog-title>{{ data.title }}</h2>
2-
<mat-dialog-content> {{ data.content }} </mat-dialog-content>
2+
<mat-dialog-content>
3+
<p class="whitespace-pre-wrap">
4+
{{ data.content }}
5+
</p>
6+
</mat-dialog-content>
37
<mat-dialog-actions align="end">
48
<button mat-button color="primary" [mat-dialog-close]="false">Cancel</button>
59
<button mat-button cdkFocusInitial color="primary" [mat-dialog-close]="true">OK</button>

0 commit comments

Comments
 (0)