Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
"style": "scss",
"changeDetection": "OnPush"
}
},
"root": "",
Expand Down
2 changes: 2 additions & 0 deletions src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { providePrimeNG } from 'primeng/config';
import Aura from '@primeng/themes/aura';
import { provideAnimations } from '@angular/platform-browser/animations';
import { provideHttpClient } from '@angular/common/http';
import { ConfirmationService } from 'primeng/api';

export const appConfig: ApplicationConfig = {
providers: [
Expand All @@ -27,5 +28,6 @@ export const appConfig: ApplicationConfig = {
}),
provideAnimations(),
provideHttpClient(),
ConfirmationService,
],
};
2 changes: 2 additions & 0 deletions src/app/core/components/root/root.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@
</div>
</div>
}

<p-confirm-dialog />
2 changes: 2 additions & 0 deletions src/app/core/components/root/root.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { FooterComponent } from '@core/components/footer/footer.component';
import { TopnavComponent } from '@core/components/topnav/topnav.component';
import { IS_PORTRAIT } from '@shared/utils/breakpoints.tokens';
import { toSignal } from '@angular/core/rxjs-interop';
import { ConfirmDialog } from 'primeng/confirmdialog';

@Component({
selector: 'osf-root',
Expand All @@ -18,6 +19,7 @@ import { toSignal } from '@angular/core/rxjs-interop';
MainContentComponent,
FooterComponent,
TopnavComponent,
ConfirmDialog,
],
templateUrl: './root.component.html',
styleUrls: ['./root.component.scss'],
Expand Down
16 changes: 16 additions & 0 deletions src/app/shared/helpers/default-confirmation-config.helper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Confirmation } from 'primeng/api';

export const defaultConfirmationConfig: Confirmation = {
message: 'Are you sure you want to proceed?',
header: 'Confirmation',
closable: true,
closeOnEscape: false,
rejectButtonProps: {
label: 'Cancel',
severity: 'info',
outlined: true,
},
acceptButtonProps: {
label: 'Confirm',
},
};
36 changes: 36 additions & 0 deletions src/assets/styles/overrides/confirmation-dialog.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.p-confirmdialog {
min-height: 212px;
width: 450px;

.p-dialog-header {
padding: 24px;

.p-dialog-title {
font-size: 18px;
font-weight: 700;
text-transform: capitalize;
}
}

.p-dialog-content {
padding: 0 24px 24px;
align-items: start;
}

.p-dialog-footer {
padding: 0 24px 24px;
justify-content: center;

p-button {
width: 50%;

.p-confirmdialog-reject-button {
width: 100%;
}

.p-confirmdialog-accept-button {
width: 100%;
}
}
}
}
1 change: 1 addition & 0 deletions src/assets/styles/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
@use "./overrides/drawer";
@use "./overrides/card";
@use "./overrides/carousel";
@use "./overrides/confirmation-dialog";

@layer base, primeng, reset;

Expand Down