Skip to content

Commit

Permalink
Add Google Analytics
Browse files Browse the repository at this point in the history
Improve Messages
  • Loading branch information
alexcibotari committed Oct 18, 2024
1 parent 8e26c26 commit c60f590
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 8 deletions.
6 changes: 5 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { Component } from '@angular/core';
import { Performance } from '@angular/fire/performance';
import { Analytics } from '@angular/fire/analytics';

@Component({
selector: 'll-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent {
constructor(private readonly performance: Performance) {}
constructor(
private readonly performance: Performance,
private readonly analytics: Analytics,
) {}
}
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { IMAGE_LOADER, ImageLoaderConfig } from '@angular/common';
import { MarkdownModule } from 'ngx-markdown';
import { provideHttpClient, withFetch, withInterceptorsFromDi } from '@angular/common/http';
import { MatIconRegistry } from '@angular/material/icon';
import { getAnalytics, provideAnalytics } from '@angular/fire/analytics';

@NgModule({
declarations: [AppComponent],
Expand Down Expand Up @@ -83,6 +84,7 @@ import { MatIconRegistry } from '@angular/material/icon';
}
return functions;
}),
provideAnalytics(() => getAnalytics()),
providePerformance(() => {
return getPerformance();
}),
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/admin/spaces/spaces.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class SpacesComponent implements OnInit {
.open<ConfirmationDialogComponent, ConfirmationDialogModel, boolean>(ConfirmationDialogComponent, {
data: {
title: 'Delete Space',
content: `Are you sure about deleting Space with name '${element.name}'.`,
content: `Are you sure about deleting Space with name '${element.name}'.\n This action can not be undone.`,
},
})
.afterClosed()
Expand Down
13 changes: 11 additions & 2 deletions src/app/features/spaces/assets/assets.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,20 @@ export class AssetsComponent implements OnInit {
// Prevent Default
event.preventDefault();
event.stopImmediatePropagation();
let title = '';
let content = '';
if (element.kind === AssetKind.FOLDER) {
title = 'Delete Folder';
content = `Are you sure about deleting Folder with name: ${element.name}.\n All sub folders and assets will be deleted.`;
} else if (element.kind === AssetKind.FILE) {
title = 'Delete Asset';
content = `Are you sure about deleting Asset with name: ${element.name}.`;
}
this.dialog
.open<ConfirmationDialogComponent, ConfirmationDialogModel, boolean>(ConfirmationDialogComponent, {
data: {
title: 'Delete Asset',
content: `Are you sure about deleting Asset with name: ${element.name}.`,
title: title,
content: content,
},
})
.afterClosed()
Expand Down
13 changes: 11 additions & 2 deletions src/app/features/spaces/contents/contents.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,20 @@ export class ContentsComponent {
// Prevent Default
event.preventDefault();
event.stopImmediatePropagation();
let title = '';
let content = '';
if (element.kind === ContentKind.FOLDER) {
title = 'Delete Folder';
content = `Are you sure about deleting Folder with name: ${element.name}.\n All sub folders and documents will be deleted.`;
} else if (element.kind === ContentKind.DOCUMENT) {
title = 'Delete Document';
content = `Are you sure about deleting Document with name: ${element.name}.`;
}
this.dialog
.open<ConfirmationDialogComponent, ConfirmationDialogModel, boolean>(ConfirmationDialogComponent, {
data: {
title: 'Delete Content',
content: `Are you sure about deleting Content with name: ${element.name}.`,
title: title,
content: content,
},
})
.afterClosed()
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/spaces/schemas/schemas.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class SchemasComponent implements OnInit {
.open<ConfirmationDialogComponent, ConfirmationDialogModel, boolean>(ConfirmationDialogComponent, {
data: {
title: 'Delete Schema',
content: `Are you sure about deleting Schema with name '${element.id}'.`,
content: `Are you sure about deleting Schema with name '${element.id}'.\n Any Content document associated with the Schema will not work anymore.`,
},
})
.afterClosed()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<h2 mat-dialog-title>{{ data.title }}</h2>
<mat-dialog-content> {{ data.content }} </mat-dialog-content>
<mat-dialog-content>
<p class="whitespace-pre-wrap">
{{ data.content }}
</p>
</mat-dialog-content>
<mat-dialog-actions align="end">
<button mat-button color="primary" [mat-dialog-close]="false">Cancel</button>
<button mat-button cdkFocusInitial color="primary" [mat-dialog-close]="true">OK</button>
Expand Down

0 comments on commit c60f590

Please sign in to comment.