Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web: autumn clean #12660

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions web/src/admin/AdminInterface/AdminSidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export class AkAdminSidebar extends WithCapabilitiesConfig(AKElement) {
renderNewVersionMessage() {
return this.version && this.version !== VERSION
? html`
<ak-sidebar-item ?highlight=${true}>
<ak-sidebar-item highlight>
<span slot="label"
>${msg("A newer version of the frontend is available.")}</span
>
Expand All @@ -192,7 +192,7 @@ export class AkAdminSidebar extends WithCapabilitiesConfig(AKElement) {
});

return this.impersonation
? html`<ak-sidebar-item ?highlight=${true} @click=${reload}>
? html`<ak-sidebar-item highlight @click=${reload}>
<span slot="label"
>${msg(
str`You're currently impersonating ${this.impersonation}. Click to stop.`,
Expand Down
6 changes: 1 addition & 5 deletions web/src/admin/applications/ApplicationCheckAccessForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ export class ApplicationCheckAccessForm extends Form<{ forUser: number }> {
}

renderForm(): TemplateResult {
return html`<ak-form-element-horizontal
label=${msg("User")}
?required=${true}
name="forUser"
>
return html`<ak-form-element-horizontal label=${msg("User")} required name="forUser">
<ak-search-select
.fetchObjects=${async (query?: string): Promise<User[]> => {
const args: CoreUsersListRequest = {
Expand Down
2 changes: 1 addition & 1 deletion web/src/admin/applications/ApplicationViewPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class ApplicationViewPage extends AKElement {
return html`<ak-page-header
header=${this.application?.name || msg("Loading")}
description=${ifDefined(this.application?.metaPublisher)}
.iconImage=${true}
iconImage
>
<ak-app-icon
size=${PFSize.Medium}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class AkBackchannelProvidersInput extends AKElement {
render() {
const renderOneChip = (provider: Provider) =>
html`<ak-chip
.removable=${true}
removable
value=${ifDefined(provider.pk)}
@remove=${this.remover(provider)}
>${provider.name}</ak-chip
Expand All @@ -66,7 +66,7 @@ export class AkBackchannelProvidersInput extends AKElement {
return html`
<ak-form-element-horizontal label=${this.label} name=${this.name}>
<div class="pf-c-input-group">
<ak-provider-select-table ?backchannel=${true} .confirm=${this.confirm}>
<ak-provider-select-table backchannel .confirm=${this.confirm}>
<button slot="trigger" class="pf-c-button pf-m-control" type="button">
${this.tooltip ? this.tooltip : nothing}
<i class="fas fa-plus" aria-hidden="true"></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class ApplicationWizardApplicationDetails extends WithBrandConfig(BasePro

<ak-form-element-horizontal
label=${msg("Bind flow")}
?required=${true}
required
name="authorizationFlow"
.errorMessages=${errors?.authorizationFlow ?? []}
>
Expand Down Expand Up @@ -91,7 +91,7 @@ export class ApplicationWizardApplicationDetails extends WithBrandConfig(BasePro
>
</ak-switch-input>

<ak-form-group .expanded=${true}>
<ak-form-group expanded>
<span slot="header"> ${msg("Protocol settings")} </span>
<div slot="body" class="pf-c-form">
<ak-text-input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class ApplicationWizardAuthenticationByOauth extends BaseProviderPanel {
name="authorizationFlow"
label=${msg("Authorization flow")}
.errorMessages=${errors?.authorizationFlow ?? []}
?required=${true}
required
>
<ak-flow-search
flowType=${FlowsInstancesListDesignationEnum.Authorization}
Expand All @@ -102,7 +102,7 @@ export class ApplicationWizardAuthenticationByOauth extends BaseProviderPanel {
</p>
</ak-form-element-horizontal>

<ak-form-group .expanded=${true}>
<ak-form-group expanded>
<span slot="header"> ${msg("Protocol settings")} </span>
<div slot="body" class="pf-c-form">
<ak-radio-input
Expand Down Expand Up @@ -197,7 +197,7 @@ export class ApplicationWizardAuthenticationByOauth extends BaseProviderPanel {
label=${msg("Refresh Token validity")}
value="${first(provider?.refreshTokenValidity, "days=30")}"
.errorMessages=${errors?.refreshTokenValidity ?? []}
?required=${true}
required
.bighelp=${html` <p class="pf-c-form__helper-text">
${msg("Configure how long refresh tokens are valid for.")}
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class AkTypeProxyApplicationWizardPage extends BaseProviderPanel {

<ak-form-element-horizontal
label=${msg("Authorization flow")}
?required=${true}
required
name="authorizationFlow"
.errorMessages=${errors?.authorizationFlow ?? []}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class ApplicationWizardAuthenticationByRAC extends BaseProviderPanel {
<ak-form-element-horizontal
name="authorizationFlow"
label=${msg("Authorization flow")}
?required=${true}
required
>
<ak-flow-search
flowType=${FlowsInstancesListDesignationEnum.Authorization}
Expand All @@ -62,7 +62,7 @@ export class ApplicationWizardAuthenticationByRAC extends BaseProviderPanel {
)}
></ak-text-input>

<ak-form-group .expanded=${true}>
<ak-form-group expanded>
<span slot="header"> ${msg("Protocol settings")} </span>
<div slot="body" class="pf-c-form">
<ak-form-element-horizontal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class ApplicationWizardAuthenticationByRadius extends WithBrandConfig(Bas

<ak-form-element-horizontal
label=${msg("Authentication flow")}
?required=${true}
required
name="authorizationFlow"
.errorMessages=${errors?.authorizationFlow ?? []}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class ApplicationWizardProviderSamlConfiguration extends BaseProviderPane

<ak-form-element-horizontal
label=${msg("Authorization flow")}
?required=${true}
required
name="authorizationFlow"
.errorMessages=${errors?.authorizationFlow ?? []}
>
Expand All @@ -122,7 +122,7 @@ export class ApplicationWizardProviderSamlConfiguration extends BaseProviderPane
</p>
</ak-form-element-horizontal>

<ak-form-group .expanded=${true}>
<ak-form-group expanded>
<span slot="header"> ${msg("Protocol settings")} </span>
<div slot="body" class="pf-c-form">
<ak-text-input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class ApplicationWizardAuthenticationBySCIM extends BaseProviderPanel {
</ak-form-element-horizontal>
</div>
</ak-form-group>
<ak-form-group ?expanded=${true}>
<ak-form-group expanded>
<span slot="header"> ${msg("Attribute mapping")} </span>
<div slot="body" class="pf-c-form">
<ak-multi-select
Expand Down
4 changes: 2 additions & 2 deletions web/src/admin/blueprints/BlueprintForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class BlueprintForm extends ModelForm<BlueprintInstance, string> {
}

renderForm(): TemplateResult {
return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name">
return html` <ak-form-element-horizontal label=${msg("Name")} required name="name">
<input
type="text"
value="${ifDefined(this.instance?.name)}"
Expand Down Expand Up @@ -135,7 +135,7 @@ export class BlueprintForm extends ModelForm<BlueprintInstance, string> {
.selected=${(item: BlueprintFile): boolean => {
return this.instance?.path === item.path;
}}
?blankable=${true}
blankable
>
</ak-search-select>
</ak-form-element-horizontal>`
Expand Down
22 changes: 5 additions & 17 deletions web/src/admin/brands/BrandForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ export class BrandForm extends ModelForm<Brand, string> {
}

renderForm(): TemplateResult {
return html` <ak-form-element-horizontal
label=${msg("Domain")}
?required=${true}
name="domain"
>
return html` <ak-form-element-horizontal label=${msg("Domain")} required name="domain">
<input
type="text"
value="${first(this.instance?.domain, window.location.host)}"
Expand Down Expand Up @@ -87,14 +83,10 @@ export class BrandForm extends ModelForm<Brand, string> {
</p>
</ak-form-element-horizontal>

<ak-form-group .expanded=${true}>
<ak-form-group expanded>
<span slot="header"> ${msg("Branding settings")} </span>
<div slot="body" class="pf-c-form">
<ak-form-element-horizontal
label=${msg("Title")}
?required=${true}
name="brandingTitle"
>
<ak-form-element-horizontal label=${msg("Title")} required name="brandingTitle">
<input
type="text"
value="${first(
Expand All @@ -108,11 +100,7 @@ export class BrandForm extends ModelForm<Brand, string> {
${msg("Branding shown in page title and several other places.")}
</p>
</ak-form-element-horizontal>
<ak-form-element-horizontal
label=${msg("Logo")}
?required=${true}
name="brandingLogo"
>
<ak-form-element-horizontal label=${msg("Logo")} required name="brandingLogo">
<input
type="text"
value="${first(this.instance?.brandingLogo, DefaultBrand.brandingLogo)}"
Expand All @@ -125,7 +113,7 @@ export class BrandForm extends ModelForm<Brand, string> {
</ak-form-element-horizontal>
<ak-form-element-horizontal
label=${msg("Favicon")}
?required=${true}
required
name="brandingFavicon"
>
<input
Expand Down
2 changes: 1 addition & 1 deletion web/src/admin/common/ak-core-group-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class CoreGroupSearch extends CustomListenerElement(AKElement) {
.value=${renderValue}
.selected=${this.selected}
@ak-change=${this.handleSearchUpdate}
?blankable=${true}
blankable
>
</ak-search-select>
`;
Expand Down
2 changes: 1 addition & 1 deletion web/src/admin/common/ak-crypto-certificate-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class AkCryptoCertificateSearch extends CustomListenerElement(AKElement)
.value=${renderValue}
.selected=${this.selected}
@ak-change=${this.handleSearchUpdate}
?blankable=${true}
blankable
>
</ak-search-select>
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const Default = () =>
container(
html` <ak-form-element-horizontal
label=${msg("Authorization flow")}
?required=${true}
required
name="authorizationFlow"
>
<ak-flow-search
Expand All @@ -124,7 +124,7 @@ export const WithInitialValue = () =>
container(
html` <ak-form-element-horizontal
label=${msg("Authorization flow")}
?required=${true}
required
name="authorizationFlow"
>
<ak-flow-search
Expand Down
14 changes: 3 additions & 11 deletions web/src/admin/crypto/CertificateGenerateForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class CertificateKeyPairForm extends Form<CertificateGenerationRequest> {
return html`<ak-form-element-horizontal
label=${msg("Common Name")}
name="commonName"
?required=${true}
required
>
<input type="text" class="pf-c-form-control" required />
</ak-form-element-horizontal>
Expand All @@ -39,18 +39,10 @@ export class CertificateKeyPairForm extends Form<CertificateGenerationRequest> {
${msg("Optional, comma-separated SubjectAlt Names.")}
</p>
</ak-form-element-horizontal>
<ak-form-element-horizontal
label=${msg("Validity days")}
name="validityDays"
?required=${true}
>
<ak-form-element-horizontal label=${msg("Validity days")} name="validityDays" required>
<input class="pf-c-form-control" type="number" value="365" />
</ak-form-element-horizontal>
<ak-form-element-horizontal
label=${msg("Private key Algorithm")}
?required=${true}
name="alg"
>
<ak-form-element-horizontal label=${msg("Private key Algorithm")} required name="alg">
<ak-radio
.options=${[
{
Expand Down
4 changes: 2 additions & 2 deletions web/src/admin/crypto/CertificateKeyPairForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class CertificateKeyPairForm extends ModelForm<CertificateKeyPair, string
}

renderForm(): TemplateResult {
return html` <ak-form-element-horizontal label=${msg("Name")} name="name" ?required=${true}>
return html` <ak-form-element-horizontal label=${msg("Name")} name="name" required>
<input
type="text"
value="${ifDefined(this.instance?.name)}"
Expand All @@ -50,7 +50,7 @@ export class CertificateKeyPairForm extends ModelForm<CertificateKeyPair, string
label=${msg("Certificate")}
name="certificateData"
?writeOnly=${this.instance !== undefined}
?required=${true}
required
>
<textarea class="pf-c-form-control" required></textarea>
<p class="pf-c-form__helper-text">${msg("PEM-encoded Certificate data.")}</p>
Expand Down
12 changes: 4 additions & 8 deletions web/src/admin/events/RuleForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class RuleForm extends ModelForm<NotificationRule, string> {
}

renderForm(): TemplateResult {
return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name">
return html` <ak-form-element-horizontal label=${msg("Name")} required name="name">
<input
type="text"
value="${ifDefined(this.instance?.name)}"
Expand Down Expand Up @@ -110,7 +110,7 @@ export class RuleForm extends ModelForm<NotificationRule, string> {
.selected=${(group: Group): boolean => {
return group.pk === this.instance?.group;
}}
?blankable=${true}
blankable
>
</ak-search-select>
<p class="pf-c-form__helper-text">
Expand All @@ -119,11 +119,7 @@ export class RuleForm extends ModelForm<NotificationRule, string> {
)}
</p>
</ak-form-element-horizontal>
<ak-form-element-horizontal
label=${msg("Transports")}
?required=${true}
name="transports"
>
<ak-form-element-horizontal label=${msg("Transports")} required name="transports">
<ak-dual-select-dynamic-selected
.provider=${eventTransportsProvider}
.selector=${makeTransportSelector(this.instance?.transports)}
Expand All @@ -136,7 +132,7 @@ export class RuleForm extends ModelForm<NotificationRule, string> {
)}
</p>
</ak-form-element-horizontal>
<ak-form-element-horizontal label=${msg("Severity")} ?required=${true} name="severity">
<ak-form-element-horizontal label=${msg("Severity")} required name="severity">
<ak-radio
.options=${[
{
Expand Down
8 changes: 4 additions & 4 deletions web/src/admin/events/TransportForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ export class TransportForm extends ModelForm<NotificationTransport, string> {
}

renderForm(): TemplateResult {
return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name">
return html` <ak-form-element-horizontal label=${msg("Name")} required name="name">
<input
type="text"
value="${ifDefined(this.instance?.name)}"
class="pf-c-form-control"
required
/>
</ak-form-element-horizontal>
<ak-form-element-horizontal label=${msg("Mode")} ?required=${true} name="mode">
<ak-form-element-horizontal label=${msg("Mode")} required name="mode">
<ak-radio
@change=${(ev: CustomEvent<{ value: NotificationTransportModeEnum }>) => {
this.onModeChange(ev.detail.value);
Expand Down Expand Up @@ -106,7 +106,7 @@ export class TransportForm extends ModelForm<NotificationTransport, string> {
?hidden=${!this.showWebhook}
label=${msg("Webhook URL")}
name="webhookUrl"
?required=${true}
required
>
<input
type="text"
Expand Down Expand Up @@ -143,7 +143,7 @@ export class TransportForm extends ModelForm<NotificationTransport, string> {
.selected=${(item: NotificationWebhookMapping): boolean => {
return this.instance?.webhookMapping === item.pk;
}}
?blankable=${true}
blankable
>
</ak-search-select>
</ak-form-element-horizontal>
Expand Down
Loading