Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,31 @@ export class MaterDataCommonBodyComponent implements OnInit {
}
}

executeAPI(){

executeAPI() {
const typesNeedingConfirmation = ['center-type'];

let url = this.router.url.split('/')[3];
if (this.isCreateForm && typesNeedingConfirmation.includes(url)) {
const dialogRef = this.dialog.open(DialogComponent, {
width: '650px',
data: {
case: 'CONFIRM_CREATE',
title: 'Confirm Creation',
message: 'You are about to create a Center Type. Please ensure that all the information is correct.'
}
});
dialogRef.afterClosed().subscribe(result => {
if (result === true) {
this.performExecuteAPI();
}
});
} else {
this.performExecuteAPI();
}
}

performExecuteAPI(){
let url = this.router.url.split('/')[3];
this.dataStorageService
.getSpecFileForMasterDataEntity(this.mapping.specFileName)
Expand Down
17 changes: 17 additions & 0 deletions admin-ui/src/app/shared/dialog/dialog.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,21 @@ <h2 class="filter-heading">{{ "filters.titleTxt" | translate }}</h2>
</div>
</div>


<div *ngIf="showConfirmCancelButtons" class="confirmation-container">
<h2 mat-dialog-title>{{ title }}</h2>
<mat-dialog-content>
<p>{{ message }}</p>
</mat-dialog-content>

<mat-dialog-actions align="end">
<button mat-flat-button color="primary" (click)="closeDialog(true)">
Confirm
</button>
<button mat-stroked-button color="warn" (click)="closeDialog(false)">
Cancel
</button>
</mat-dialog-actions>
</div>

</div>
101 changes: 90 additions & 11 deletions admin-ui/src/app/shared/dialog/dialog.component.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.table-spacer > tr > td {
.table-spacer>tr>td {
padding: 5px;
}

Expand All @@ -11,14 +11,17 @@
font-family: "Roboto", sans-serif;
font-size: 12px;
}
.flex-container > .mat-form-field {

.flex-container>.mat-form-field {
width: 50%;
padding: 4px 20px !important;
}
.flex-container > .mat-option-text {

.flex-container>.mat-option-text {
font-family: "Roboto", sans-serif;
font-size: 12px !important;
}

.filter-heading {
line-height: 14px;
font-family: "Roboto", sans-serif;
Expand All @@ -30,9 +33,11 @@
.date-header {
margin-left: 15px;
}

h5 {
margin: 5px;
}

.footer {
display: flex;
justify-content: flex-end;
Expand All @@ -41,6 +46,7 @@ h5 {
background-color: rgb(233, 233, 233);
padding: 4px 15px;
}

.footer-button {
border: 0.8px solid #FF4081;
border-radius: 2px;
Expand All @@ -57,43 +63,49 @@ h5 {
display: flex;
margin: 120px;
}

.mat-dialog-container {
border-radius: 0;
padding: 0;
}

.mat-dialog-actions {
justify-content: flex-end;
height:61px;
height: 61px;
}

// Confirmation popup
.mat-dialog-title {
font-weight: 600;
font-family:"Roboto", sans-serif;
font-family: "Roboto", sans-serif;
font-size: 16px;
}

.pop-up {
.pop-up-header {
padding: 16px !important;
}

.mat-dialog-content {
margin: 0 !important;
padding: 0 !important;
font-family:"Roboto", sans-serif;
font-family: "Roboto", sans-serif;
font-size: small;
}
.pop-up-footer {

.pop-up-footer {
background: #e6e7e7;
margin-bottom: 0px;
padding: 0 16px;

.mat-button {
outline: 1px solid #FF4081 !important;
outline: 1px solid #ff4081 !important;
margin: 0 10px;
border-radius: 0;
color: #FF4081;
}
}

.pop-up-footer {
.mat-button:focus {
background: #FF4081 !important;
Expand All @@ -102,6 +114,7 @@ h5 {
}
}
}

.table-container {
overflow: auto;
width: 100%;
Expand Down Expand Up @@ -133,6 +146,7 @@ th.mat-header-cell {
text-align: center;
white-space: nowrap;
}

tr:nth-child(odd) {
background-color: #e8e9e9;
}
Expand All @@ -143,9 +157,11 @@ td.mat-footer-cell {
border-bottom-width: 1px;
border-bottom-style: solid;
}

th.mat-header-cell {
padding: 2px;
}

td.mat-cell {
text-align: center;
font-family: "Roboto", sans-serif;
Expand All @@ -155,6 +171,7 @@ td.mat-cell {
font-weight: 200;
color: #0f2126;
}

th.mat-header-cell:first-child,
td.mat-cell:first-child,
td.mat-footer-cell:first-child {
Expand All @@ -166,6 +183,7 @@ td.mat-cell:last-child,
td.mat-footer-cell:last-child {
padding-right: 16px;
}

.table-header {
background-color: #e6e7e7;
color: #54595a;
Expand All @@ -177,6 +195,7 @@ td.mat-footer-cell:last-child {
height: 28px;
font-weight: 600;
}

.container {
overflow: auto;
width: 100%;
Expand All @@ -194,39 +213,47 @@ td.mat-footer-cell:last-child {
top: 0;
z-index: 10;
}

.mat-menu {
border-radius: 0 !important;
}

:host::ng-deep .mat-menu-content {
padding-top: 0 !important;
padding-bottom: 0 !important;
}

.mat-menu-item{
line-height:20px;
height:30px;
.mat-menu-item {
line-height: 20px;
height: 30px;
font-size: x-small;
font-family: "Roboto", sans-serif;
}

.sort-icon {
padding-top: 3px;
margin-left: 3px;
cursor: pointer !important;
}

.ellipsis-button {
transform: scale(0.8);
}

.flex-display {
display: inline-flex;
align-items: center;
}

.text-alignment {
text-align: left !important;
}

.columnName-sort-span {
display: inline-flex;
align-items: center;
}

.image-fade {
opacity: 0.2;
}
Expand All @@ -235,3 +262,55 @@ caption {
font-size: 1.2em;
font-weight: bold;
}

.confirmation-container {
padding: 0;
font-family: "Roboto", sans-serif;
}

.confirmation-container .mat-dialog-title {
font-weight: 600;
font-size: 16px;
color: #0f2126;
padding: 20px 24px 0 24px;
margin-bottom: 12px;
}

.confirmation-container .mat-dialog-content {
margin: 0;
padding: 0 24px;
padding-bottom: 20px;
font-size: 14px;
line-height: 1.6;
color: #54595a;
}

.confirmation-container .mat-dialog-actions {
background-color: #e6e7e7;
justify-content: flex-end;
height: auto;
gap: 12px;
margin: 0;
padding: 16px 24px;
}

.confirmation-container .mat-dialog-actions button {
border-radius: 2px;
font-weight: 500;
min-width: 90px;
}

.confirmation-container .mat-dialog-actions .mat-flat-button {
background-color: #FF4081;
color: #ffffff;
}

.confirmation-container .mat-dialog-actions .mat-stroked-button {
border: 1px solid #FF4081;
color: #FF4081;
}

.confirmation-container .mat-dialog-actions .mat-stroked-button:hover,
.confirmation-container .mat-dialog-actions .mat-stroked-button.cdk-focused {
background-color: rgba(255, 64, 129, 0.08);
}
16 changes: 16 additions & 0 deletions admin-ui/src/app/shared/dialog/dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export class DialogComponent implements OnInit {
rangeError = false;
fieldName = '';

showConfirmCancelButtons = false;
title = '';
message = '';

cancelApplied = false;

filterOptions: any = {};
Expand Down Expand Up @@ -95,6 +99,14 @@ export class DialogComponent implements OnInit {
if (this.input.case === 'STEPS-MESSAGE') {
await this.getStepsForCreateUpate();
}
if (this.input.case === 'CONFIRM_CREATE') {
this.title = this.input.title || 'Confirm Creation';
this.message =
this.input.message ||
'You are about to create a Center Type. Please ensure that all the information is correct.';
this.showConfirmCancelButtons = true;
}

}

get f() {
Expand Down Expand Up @@ -508,4 +520,8 @@ export class DialogComponent implements OnInit {
});
});
}
closeDialog(result?: boolean): void {
this.dialogRef.close(result);
}

}
25 changes: 18 additions & 7 deletions admin-ui/src/assets/config.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
{
"baseUrl": "https://api-internal.niraqa.idencode.link/v1/",
"proxyUrl" : "https://cors-anywhere.herokuapp.com/",
"adminUrl": "/",
"primaryLangCode": "eng",
"secondaryLangCode": "ara",
"baseUrl": "https://dev.mosip.net/v1/",
"adminUrl":"/admin-ui/",
"templateRepoUrl":"/admin-ui/templates/",
"validateToken": "admin/authorize/admin/validateToken",
"secondaryLangCode": "fra",
"validateToken": "authmanager/authorize/admin/validateToken",
"login": "admin/login/",
"logout": "admin/logout/user"
}
"logout": "admin/logout/user",
"templateRepoUrl": "/templates/",
"supportedLanguages": " eng,",
"leftToRightOrientation": "eng",
"filterValueMaxCount": "{\"default\":20,\"registrationcenters\":500,\"locations\":300}",
"countryCode": "UGA",
"locationHierarchyLevel": "5",
"rightToLeftOrientation": "ara",
"version": "LTS",
"optionalLanguages": "",
"filterValueMaxRecords": "20",
"mandatoryLanguages": "eng"
}
Loading