discourse/app/assets/javascripts/admin/addon/components/admin-plugin-config-page.gjs
Martin Brennan 914f93b896
DEV: Add more structure for admin plugin config nav (#26707)
* Simplify config nav link generation to always inject the Settings
  tab
* Auto-redirect to the first non-settings config link (if there is one)
  when the user lands on /admin/plugins/:plugin_id
* Add `extras` to admin plugin serializer so plugins can add more
  data on first load
* Add PikadayCalendar page object for system specs, extracted from the
CalendarDateTimePicker to make it more generic.
2024-05-02 11:36:46 +10:00

41 lines
1.1 KiB
Plaintext

import Component from "@glimmer/component";
import { inject as service } from "@ember/service";
import AdminPluginConfigArea from "./admin-plugin-config-area";
import AdminPluginConfigMetadata from "./admin-plugin-config-metadata";
import AdminPluginConfigTopNav from "./admin-plugin-config-top-nav";
export default class AdminPluginConfigPage extends Component {
@service currentUser;
@service adminPluginNavManager;
get mainAreaClasses() {
let classes = ["admin-plugin-config-page__main-area"];
if (this.adminPluginNavManager.isSidebarMode) {
classes.push("-with-inner-sidebar");
} else {
classes.push("-without-inner-sidebar");
}
return classes.join(" ");
}
<template>
<div class="admin-plugin-config-page">
{{#if this.adminPluginNavManager.isTopMode}}
<AdminPluginConfigTopNav />
{{/if}}
<AdminPluginConfigMetadata @plugin={{@plugin}} />
<div class="admin-plugin-config-page__content">
<div class={{this.mainAreaClasses}}>
<AdminPluginConfigArea>
{{yield}}
</AdminPluginConfigArea>
</div>
</div>
</div>
</template>
}