discourse/app/assets/javascripts/admin/addon/components/admin-config-header.gjs
Krzysztof Kotlarek fc2259d1c8
FIX: limit the number of custom flags to 50 (#28221)
Admin can create up to 50 custom flags. It is limited for performance reasons.

When the limit is reached "Add button" is disabled and backend is protected by guardian.
2024-08-06 10:50:12 +10:00

36 lines
977 B
Plaintext

import Component from "@glimmer/component";
import { LinkTo } from "@ember/routing";
import concatClass from "discourse/helpers/concat-class";
import dIcon from "discourse-common/helpers/d-icon";
import i18n from "discourse-common/helpers/i18n";
export default class AdminFlagItem extends Component {
get headerCssClass() {
return `admin-${this.args.name}__header`;
}
<template>
<div class={{this.headerCssClass}}>
<h2>{{i18n @heading}}</h2>
{{#if @primaryActionRoute}}
<LinkTo
@route={{@primaryActionRoute}}
class={{concatClass
"btn-primary"
"btn"
"btn-icon-text"
@primaryActionCssClass
}}
@disabled={{@primaryActionDisabled}}
>
{{dIcon @primaryActionIcon}}
{{i18n @primaryActionLabel}}
</LinkTo>
{{/if}}
{{#if @subheading}}
<h3>{{i18n @subheading}}</h3>
{{/if}}
</div>
</template>
}