mirror of
https://github.com/discourse/discourse.git
synced 2025-01-11 04:25:47 +08:00
37f032752e
* UX: Apply admin table classes for consistent mobile styling on the web hooks page * DEV: Remove icon on the status component; update status classes * DEV: Update tests for webhook status component * DEV: add space var with a smaller value * DEV: Add styling for different status labels
30 lines
804 B
Plaintext
30 lines
804 B
Plaintext
import Component from "@glimmer/component";
|
|
import { i18n } from "discourse-i18n";
|
|
|
|
export default class WebhookStatus extends Component {
|
|
statusClasses = ["--inactive", "--critical", "--success", "--inactive"];
|
|
|
|
get status() {
|
|
const lastStatus = this.args.webhook.get("last_delivery_status");
|
|
return this.args.deliveryStatuses.find((s) => s.id === lastStatus);
|
|
}
|
|
|
|
get deliveryStatus() {
|
|
return i18n(`admin.web_hooks.delivery_status.${this.status.name}`);
|
|
}
|
|
|
|
get statusClass() {
|
|
return this.statusClasses[this.status.id - 1];
|
|
}
|
|
|
|
<template>
|
|
<div role="status" class="status-label {{this.statusClass}}">
|
|
<div class="status-label-indicator">
|
|
</div>
|
|
<div class="status-label-text">
|
|
{{this.deliveryStatus}}
|
|
</div>
|
|
</div>
|
|
</template>
|
|
}
|