Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-21 17:00:29 +01:00
IMPROVE: utilise button icon to signify update
Dieser Commit ist enthalten in:
Ursprung
320ebe3049
Commit
591cb9b6ae
2 geänderte Dateien mit 9 neuen und 14 gelöschten Zeilen
|
@ -7,17 +7,14 @@
|
|||
{{d-icon "pavilion-logo"}}
|
||||
<span>{{this.label}}</span>
|
||||
</DButton>
|
||||
<span class="loading-container">
|
||||
{{#if this.updating}}
|
||||
{{loading-spinner size="small"}}
|
||||
{{else if updateIcon}}
|
||||
{{d-icon updateIcon}}
|
||||
{{/if}}
|
||||
</span>
|
||||
<DButton
|
||||
@icon="sync"
|
||||
@icon={{this.updateIcon}}
|
||||
@action={{this.update}}
|
||||
class="btn btn-primary update"
|
||||
@disabled={{this.updating}}
|
||||
@title="admin.wizard.subscription.update.title"
|
||||
/>
|
||||
>
|
||||
{{#if this.updating}}
|
||||
{{loading-spinner size="small"}}
|
||||
{{/if}}
|
||||
</DButton>
|
|
@ -8,7 +8,7 @@ import I18n from "I18n";
|
|||
export default class WizardSubscriptionBadge extends Component {
|
||||
@service subscription;
|
||||
@tracked updating = false;
|
||||
@tracked updateIcon = null;
|
||||
@tracked updateIcon = "sync";
|
||||
basePath = "/admin/plugins/subscription-client";
|
||||
|
||||
@computed("subscription.subscriptionType")
|
||||
|
@ -38,12 +38,10 @@ export default class WizardSubscriptionBadge extends Component {
|
|||
@action
|
||||
update() {
|
||||
this.updating = true;
|
||||
this.updateIcon = "check";
|
||||
this.updateIcon = null;
|
||||
this.subscription.updateSubscriptionStatus().finally(() => {
|
||||
this.updateIcon = "sync";
|
||||
this.updating = false;
|
||||
setTimeout(() => {
|
||||
this.updateIcon = null;
|
||||
}, 5000);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Laden …
In neuem Issue referenzieren