Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-09 11:52:54 +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"}}
|
{{d-icon "pavilion-logo"}}
|
||||||
<span>{{this.label}}</span>
|
<span>{{this.label}}</span>
|
||||||
</DButton>
|
</DButton>
|
||||||
<span class="loading-container">
|
|
||||||
{{#if this.updating}}
|
|
||||||
{{loading-spinner size="small"}}
|
|
||||||
{{else if updateIcon}}
|
|
||||||
{{d-icon updateIcon}}
|
|
||||||
{{/if}}
|
|
||||||
</span>
|
|
||||||
<DButton
|
<DButton
|
||||||
@icon="sync"
|
@icon={{this.updateIcon}}
|
||||||
@action={{this.update}}
|
@action={{this.update}}
|
||||||
class="btn btn-primary update"
|
class="btn btn-primary update"
|
||||||
@disabled={{this.updating}}
|
@disabled={{this.updating}}
|
||||||
@title="admin.wizard.subscription.update.title"
|
@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 {
|
export default class WizardSubscriptionBadge extends Component {
|
||||||
@service subscription;
|
@service subscription;
|
||||||
@tracked updating = false;
|
@tracked updating = false;
|
||||||
@tracked updateIcon = null;
|
@tracked updateIcon = "sync";
|
||||||
basePath = "/admin/plugins/subscription-client";
|
basePath = "/admin/plugins/subscription-client";
|
||||||
|
|
||||||
@computed("subscription.subscriptionType")
|
@computed("subscription.subscriptionType")
|
||||||
|
@ -38,12 +38,10 @@ export default class WizardSubscriptionBadge extends Component {
|
||||||
@action
|
@action
|
||||||
update() {
|
update() {
|
||||||
this.updating = true;
|
this.updating = true;
|
||||||
this.updateIcon = "check";
|
this.updateIcon = null;
|
||||||
this.subscription.updateSubscriptionStatus().finally(() => {
|
this.subscription.updateSubscriptionStatus().finally(() => {
|
||||||
|
this.updateIcon = "sync";
|
||||||
this.updating = false;
|
this.updating = false;
|
||||||
setTimeout(() => {
|
|
||||||
this.updateIcon = null;
|
|
||||||
}, 5000);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Laden …
In neuem Issue referenzieren