DEV: Use RouteTemplate for admin API keys template (#30835)

This is a small clean-up PR that does the following:

- Convert api-keys.hbs to a RouteTemplate backed api-keys.gjs.
- Move the sub-page templates (index, show, new) into /api-keys sub-directory.
- Removes some styles that aren't used after the admin UI conversion.
This commit is contained in:
Ted Johansson 2025-01-17 11:22:47 +08:00 committed by GitHub
parent d964fbc550
commit 0718f940fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 10 additions and 52 deletions

View File

@ -1,5 +1,11 @@
import RouteTemplate from "ember-route-template";
import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
import DPageHeader from "discourse/components/d-page-header";
import PluginOutlet from "discourse/components/plugin-outlet";
import { i18n } from "discourse-i18n";
export default RouteTemplate(<template>
<PluginOutlet @name="admin-api-keys">
<div class="admin-api-keys admin-config-page">
<DPageHeader
@titleLabel={{i18n "admin.api_keys.title"}}
@descriptionLabel={{i18n "admin.api_keys.description"}}
@ -23,5 +29,5 @@
<div class="admin-container admin-config-page__main-area">
{{outlet}}
</div>
</div>
</PluginOutlet>
</template>);

View File

@ -25,55 +25,7 @@
// Api keys
.d-admin-table.api-keys {
margin-bottom: 0.25em;
tr.revoked {
color: var(--primary-high);
}
.d-admin-row__overview.key {
width: 20%;
}
}
.admin-api-keys {
h2 {
margin-bottom: 10px;
}
.api-key-new {
.form-element,
.form-element-desc {
&.input-area {
width: 100%;
.value-list,
.select-kit,
input[type="text"],
input[type="text"].filter-input {
width: 100%;
margin: 0;
}
@include breakpoint(mobile-extra-large, min-width) {
width: 75%;
.value-list,
.select-kit,
input[type="text"] {
width: 50%;
}
}
}
&.label-area {
label {
margin: 0.5em 1em 0 0;
}
@include breakpoint(mobile-extra-large, min-width) {
width: 25%;
}
}
}
}
.api-key-show {
.form-element,
.form-element-desc {