Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/notifications in preferences #638

Merged
merged 2 commits into from
Jun 28, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
{{ password?.errors?.['maxlength']?.requiredLength }} {{'validators.maxChars' | translate }}
</mat-error>
<mat-error *ngIf="password?.errors?.['missingCharacters'] && !password?.errors?.['maxlength'] && !password?.errors?.['minlength'] && !password?.errors?.['required']">
{{'validators.pattern' | translate }} [aA-Zz], [0-9] and "~!@#$%^&*()_"]
{{'validators.pattern' | translate }} [aA-zZ] and [0-9]
</mat-error>
<mat-icon matSuffix
style="cursor: pointer"
Expand Down Expand Up @@ -117,7 +117,7 @@
{{ password2?.errors?.['maxlength']?.requiredLength }} {{'validators.maxChars' | translate }}
</mat-error>
<mat-error *ngIf="password2?.errors?.['missingCharacters'] && !password2?.errors?.['maxlength'] && !password2?.errors?.['minlength'] && !password?.errors?.['required']">
{{'validators.pattern' | translate }} [aA-Zz], [0-9] and "~!@#$%^&*()_"]
{{'validators.pattern' | translate }} [aA-zZ] and [0-9]
</mat-error>
</mat-form-field>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,12 @@ export class PageAdvancedSettingsComponent implements OnInit, AfterViewInit, OnD
result.isCopy = isCopy;
this.service[result.isnew ? 'add' : (isCopy ? 'copy' : 'update')](result.data)
.toPromise()
.then(() => this.updateData());
this.alertService.success(`${this.page} Successfully ${(result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);
.then(() => {
this.updateData();
this.alertService.success(`${this.page} Successfully ${(result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);
}, () => {
this.alertService.error(`Failed to ${(result.isnew ? 'Add' : (isCopy ? 'Copy' : 'Update'))} ${this.page}`)
})
};
if (item) {
item.type = type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ export class PageAgentSubscriptionsComponent implements OnInit, AfterViewInit, O
result.isCopy = isCopy;
this.service[result.isnew ? 'add' : (isCopy ? 'copy' : 'update')](result.data)
.toPromise()
.then(() => this.updateData());
this.alertService.success(`${this.page} Successfully ${(result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);
.then(() => {
this.updateData();
this.alertService.success(`${this.page} Successfully ${(result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);
}, () => {
this.alertService.error(`Failed to ${(result.isnew ? 'Add' : (isCopy ? 'Copy' : 'Update'))} ${this.page}`)
});
};

this.openDialog(DialogAgentsubComponent, item, onOpenDialog, isCopy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,12 @@ export class PageAliasComponent implements OnInit, OnDestroy, AfterViewInit {
result.isCopy = isCopy;
this.service[result.isnew ? 'add' : (isCopy ? 'copy' : 'update')](result.data)
.toPromise()
.then(() => this.updateData());
this.alertService.success(`${this.page} Successfully ${(result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);
.then(() => {
this.updateData();
this.alertService.success(`${this.page} Successfully ${(result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);
}, () => {
this.alertService.error(`Failed to ${(result.isnew ? 'Add' : (isCopy ? 'Copy' : 'Update'))} ${this.page}`)
});
};
if (item) {
item.actionType = type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export class PageApiAuthComponent implements OnInit, AfterViewInit, OnDestroy {
);
}
this.updateData();
this.alertService.success(`${this.page} Successfully ${(_result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);
};

const onOpenDialog = (result) => {
Expand All @@ -145,8 +146,9 @@ export class PageApiAuthComponent implements OnInit, AfterViewInit, OnDestroy {
result.isCopy = isCopy;
this.service[result.isnew ? 'add' : (isCopy ? 'copy' : 'update')](result.data)
.toPromise()
.then(onServiceRes);
this.alertService.success(`${this.page} Successfully ${(result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);
.then(onServiceRes, () => {
this.alertService.error(`Failed to ${(result.isnew ? 'Add' : (isCopy ? 'Copy' : 'Update'))} ${this.page}`)
});
};

this.openDialog(DialogAuthKeyComponent, item, onOpenDialog, isCopy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ export class PageMappingComponent implements OnInit, AfterViewInit, OnDestroy {
result.isCopy = isCopy;
this.service[result.isnew ? 'add' : (isCopy ? 'copy' : 'update')](result.data)
.toPromise()
.then(() => this.updateData());
.then(() => {
this.updateData();
this.alertService.success(`${this.page} Successfully ${(result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);
}, () => {
this.alertService.error(`Failed to ${(result.isnew ? 'Add' : (isCopy ? 'Copy' : 'Update'))} ${this.page}`)
});
this.alertService.success(`${this.page} Successfully ${(result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ export class PageProfileComponent implements OnInit {
}
this.alertService.success(`${this.page} Successfully Updated`);

});
}, () => {
this.alertService.error(`Failed to Update ${this.page}`)
});
} else {
this.username.markAsTouched();
this.usergroup.markAsTouched();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ export class PageScriptsComponent implements OnInit, AfterViewInit, OnDestroy {
result.isCopy = isCopy;
this.service[result.isnew ? 'add' : (isCopy ? 'copy' : 'update')](result.data)
.toPromise()
.then(() => this.updateData());
this.alertService.success(`${this.page} Successfully ${(result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);
.then(() => this.updateData(), () => {
this.alertService.error(`Failed to ${(result.isnew ? 'Add' : (isCopy ? 'Copy' : 'Update'))} ${this.page}`)
});
};

this.openDialog(DialogScriptsComponent, Functions.cloneObject(item), onOpenDialog, isCopy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,12 @@ export class PageSystemOverviewComponent implements OnInit, AfterViewInit, OnDes
result.isCopy = isCopy;
this.service[result.isnew ? 'add' : (isCopy ? 'copy' : 'update')](result.data)
.toPromise()
.then(() => this.updateData());
this.alertService.success(`${this.page} Successfully ${(result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);
.then(() => {
this.updateData();
this.alertService.success(`${this.page} Successfully ${(result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);
}, () => {
this.alertService.error(`Failed to ${(result.isnew ? 'Add' : (isCopy ? 'Copy' : 'Update'))} ${this.page}`)
});
};

this.openDialog(DialogUsersComponent, item, onOpenDialog, isCopy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ export class PageUserSettingsComponent implements OnInit, OnDestroy, AfterViewIn
result.isCopy = isCopy;
this.service[result.isnew ? 'add' : (isCopy ? 'copy' : 'update')](result.data)
.toPromise()
.then(() => this.updateData());
this.alertService.success(`${this.page} Successfully ${(result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);
.then(() => {
this.updateData();
this.alertService.success(`${this.page} Successfully ${(result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);
}, () => {
this.alertService.error(`Failed to ${(result.isnew ? 'Add' : (isCopy ? 'Copy' : 'Update'))} ${this.page}`)
});
};

if (item) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,11 @@ export class PageUsersComponent implements OnInit, OnDestroy, AfterViewInit {
this.authenticationService.logout();
this.router.navigate([{ outlets: { primary: null, system: 'login' } }]);
}
});
this.alertService.success(`${this.page} Successfully ${(result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);
this.alertService.success(`${this.page} Successfully ${(result.isnew ? 'Added' : (isCopy ? 'Copied' : 'Updated'))}`);

}, () => {
this.alertService.error(`Failed to ${(result.isnew ? 'Add' : (isCopy ? 'Copy' : 'Update'))} ${this.page}`)
});
};

this.openDialog(DialogUsersComponent, Functions.cloneObject(item), onOpenDialog, isCopy);
Expand Down
Loading