Skip to content

Commit

Permalink
Merge pull request primefaces#22 from Nanitor/SystemManagementSetting…
Browse files Browse the repository at this point in the history
…s-UpdateMessage-Bugfix

ND-592: SystemManagementSettings - fix update message
  • Loading branch information
Alfred Hall authored Jul 30, 2018
2 parents eb70941 + e01283a commit 9ff587a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/assets/less/custom.less
Original file line number Diff line number Diff line change
Expand Up @@ -1438,8 +1438,8 @@ div input.input-type-slug {
.flash-message {
display: inline-block;
opacity: 0;
-webkit-animation: fadeinout 2s linear forwards;
animation: fadeinout 2s linear forwards;
-webkit-animation: fadeinout 4s linear forwards;
animation: fadeinout 4s linear forwards;

&.error {
color: red;
Expand Down
10 changes: 2 additions & 8 deletions src/organization/admin/settings/settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export class SettingsComponent implements OnInit {

clickUpdateOrganization(event){
this.spinnerService.setState(true);
this.showUpdateMessage = false;
this.updateOrganizationModel.slug = this.updateOrganizationModel.slug.toLowerCase();
let r = this.service.updateOrganization(this.response.id, this.updateOrganizationModel);
let self = this;
Expand All @@ -101,7 +102,7 @@ export class SettingsComponent implements OnInit {
this.spinnerService.setState(false);
this.refresh();
}
this.waitForUpdateMessage();
this.showUpdateMessage = true;
},
err => {
this.service.accountService.handleError(err);
Expand All @@ -110,13 +111,6 @@ export class SettingsComponent implements OnInit {
);
}

waitForUpdateMessage() {
this.showUpdateMessage = true;
setTimeout(() => {
this.showUpdateMessage = false;
}, 2000);
}

logServerInputEmpty() {
if(this.updateOrganizationModel.logserver_host == "" &&
this.updateOrganizationModel.logserver_port == "" &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h1 class="panel-title">Settings</h1>

<div class="form-group">
<button (click)="clickUpdateSystemSetting($event)" [disabled]="!updateSystemSettingModel.validate()||!settingChanged" class="btn btn-primary btn-blue btn-add-save btn-lg">Save</button>
<div class="settings-update-msg" [class.settings-update-msg-fade-in]="showUpdateMessage">Settings have been updated!</div>
<div class="flash-message" *ngIf="showUpdateMessage">Settings have been updated!</div>
</div>
</form>
</div>
Expand Down

0 comments on commit 9ff587a

Please sign in to comment.