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

[ACS-8956] Add new ESLint rule for self-closing tags #4211

Merged
merged 1 commit into from
Oct 31, 2024
Merged
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
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@
"@angular-eslint/template/no-negated-async": "off",
"@angular-eslint/template/no-positive-tabindex": "error",
"@angular-eslint/template/eqeqeq": "error",
"@angular-eslint/template/no-call-expression": "off"
"@angular-eslint/template/no-call-expression": "off",
"@angular-eslint/template/prefer-self-closing-tags": "error"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion app/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<router-outlet></router-outlet>
<router-outlet />
4 changes: 1 addition & 3 deletions app/src/app/components/login/app-login.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@
logoImageUrl="./assets/images/alfresco-logo.svg"
backgroundImageUrl="./assets/images/Wallpaper-BG-generic.svg"
[showRememberMe]="false"
[showLoginActions]="false"
>
</adf-login>
[showLoginActions]="false" />
8 changes: 4 additions & 4 deletions projects/aca-content/about/src/about.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ <h1>{{ 'APP.BROWSE.ABOUT.TITLE' | translate }}</h1>
<adf-about>
<adf-about-panel *ngIf="dev" [label]="'ABOUT.SERVER_SETTINGS.TITLE' | translate">
<ng-template>
<adf-about-server-settings></adf-about-server-settings>
<adf-about-server-settings />
</ng-template>
</adf-about-panel>

<adf-about-panel [label]="'ABOUT.REPOSITORY' | translate" *ngIf="repository">
<ng-template>
<adf-about-repository-info [data]="repository"></adf-about-repository-info>
<adf-about-repository-info [data]="repository" />
</ng-template>
</adf-about-panel>

<adf-about-panel *ngIf="dev" [label]="'ABOUT.PACKAGES.TITLE' | translate">
<ng-template>
<adf-about-package-list [dependencies]="packageJson?.dependencies"></adf-about-package-list>
<adf-about-package-list [dependencies]="packageJson?.dependencies" />
</ng-template>
</adf-about-panel>

<adf-about-panel *ngIf="extensions$ | async as extensions" [label]="'ABOUT.PLUGINS.TITLE' | translate">
<ng-template>
<adf-about-extension-list [data]="extensions"></adf-about-extension-list>
<adf-about-extension-list [data]="extensions" />
</ng-template>
</adf-about-panel>
</adf-about>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1 class="aca-page-title">{{ 'ACA_FOLDER_RULES.ACTIONS.MANAGE_RULES' | translat
<div class="aca-main-content">

<ng-container *ngIf="((ruleSetsLoading$ | async) && (inheritedRuleSets$ | async).length === 0) || (actionsLoading$ | async); else onLoaded">
<mat-progress-bar color="primary" mode="indeterminate"></mat-progress-bar>
<mat-progress-bar color="primary" mode="indeterminate" />
</ng-container>

<ng-template #onLoaded>
Expand All @@ -35,7 +35,7 @@ <h2 class="aca-page-title">{{ (folderInfo$ | async).name }}:{{'ACA_FOLDER_RULES.
{{ 'ACA_FOLDER_RULES.MANAGE_RULES.TOOLBAR.ACTIONS.INHERIT_RULES' | translate }}
</mat-slide-toggle>

<mat-divider vertical class="aca-manage-rules__actions-bar__vertical-divider"></mat-divider>
<mat-divider vertical class="aca-manage-rules__actions-bar__vertical-divider" />

<div class="aca-manage-rules__actions-bar__buttons">
<button
Expand All @@ -56,7 +56,7 @@ <h2 class="aca-page-title">{{ (folderInfo$ | async).name }}:{{'ACA_FOLDER_RULES.
</div>

</adf-toolbar>
<mat-divider></mat-divider>
<mat-divider />

<div class="aca-manage-rules__container" *ngIf="isMainRuleSetNotEmpty || isInheritedRuleSetsNotEmpty; else emptyContent">
<aca-rule-list
Expand All @@ -71,8 +71,7 @@ <h2 class="aca-page-title">{{ (folderInfo$ | async).name }}:{{'ACA_FOLDER_RULES.
(selectRule)="onSelectRule($event)"
(ruleEnabledChanged)="onRuleEnabledToggle($event[0], $event[1])"
(ruleSetEditLinkClicked)="openLinkRulesDialog($event)"
(ruleSetUnlinkClicked)="onRuleSetUnlinkClicked($event)">
</aca-rule-list>
(ruleSetUnlinkClicked)="onRuleSetUnlinkClicked($event)" />

<div class="aca-manage-rules__container__rule-details">

Expand Down Expand Up @@ -111,8 +110,7 @@ <h2 class="aca-page-title">{{ (folderInfo$ | async).name }}:{{'ACA_FOLDER_RULES.
[readOnly]="true"
[preview]="true"
[value]="selectedRule"
[nodeId]="nodeId">
</aca-rule-details>
[nodeId]="nodeId" />
</div>
</div>
</div>
Expand All @@ -122,14 +120,13 @@ <h2 class="aca-page-title">{{ (folderInfo$ | async).name }}:{{'ACA_FOLDER_RULES.
icon="library_books"
[title]="'ACA_FOLDER_RULES.MANAGE_RULES.EMPTY_RULES_LIST.TITLE' | translate"
[subtitle]="'ACA_FOLDER_RULES.MANAGE_RULES.EMPTY_RULES_LIST.SUBTITLE' | translate"
>
</adf-empty-content>
/>
</ng-template>
</ng-container>

<ng-template #genericError>
<div class="aca-page-layout-error">
<aca-generic-error></aca-generic-error>
<aca-generic-error />
</div>
</ng-template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
[parameterConstraints]="parameterConstraints"
[readOnly]="readOnly"
[formControl]="control"
[nodeId]="nodeId">
</aca-rule-action>
[nodeId]="nodeId" />

<button
mat-icon-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
data-automation-id="rule-action-card-view"
[properties]="cardViewItems"
class="aca-rule-action-full-width"
[editable]="!readOnly">
</adf-card-view>
[editable]="!readOnly" />

</form>
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@
[secondaryBackground]="!secondaryBackground"
[childCondition]="true"
[formControl]="control"
[readOnly]="readOnly">
</aca-rule-composite-condition>
[readOnly]="readOnly" />

<aca-rule-simple-condition
*ngIf="isFormControlSimpleCondition(control)"
[formControl]="control"
[readOnly]="readOnly">
</aca-rule-simple-condition>
[readOnly]="readOnly" />

<button mat-icon-button [matMenuTriggerFor]="menu" *ngIf="!readOnly" data-automation-id="condition-actions-button">
<mat-icon>more_vert</mat-icon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
color="primary"
mode="indeterminate"
data-automation-id="auto-complete-loading-spinner"
[diameter]="25"
></mat-progress-spinner>
[diameter]="25" />
</span>
</mat-option>
<ng-template #optionList>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
[value]="model"
[nodeId]="nodeId"
(formValueChanged)="formValue = $event"
(formValidationChanged)="onFormValidChange($event)">
</aca-rule-details>
(formValidationChanged)="onFormValidChange($event)" />
</mat-dialog-content>

<mat-dialog-actions align="end" class="aca-edit-rule-dialog__footer">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
<div class="aca-rule-details__form__row aca-rule-details__form__triggers">
<div class="aca-label">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LABEL.WHEN' | translate }}</div>
<div>
<aca-rule-triggers formControlName="triggers" data-automation-id="rule-details-triggers-component"></aca-rule-triggers>
<aca-rule-triggers formControlName="triggers" data-automation-id="rule-details-triggers-component" />
<mat-error class="aca-rule-details-error" *ngIf="triggers.hasError('required')">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.ERROR.INSUFFICIENT_TRIGGERS_SELECTED' | translate }}</mat-error>
</div>
</div>

<div class="aca-rule-details__form__conditions">
<aca-rule-composite-condition [readOnly]="readOnly" formControlName="conditions"></aca-rule-composite-condition>
<aca-rule-composite-condition [readOnly]="readOnly" formControlName="conditions" />
<mat-error class="aca-rule-details-error" *ngIf="conditions.hasError('ruleCompositeConditionInvalid')">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.ERROR.RULE_COMPOSITE_CONDITION_INVALID' | translate }}</mat-error>
</div>

Expand All @@ -49,17 +49,15 @@
[actionDefinitions]="actionDefinitions"
[parameterConstraints]="parameterConstraints"
[readOnly]="readOnly"
[nodeId]="nodeId">
</aca-rule-action-list>
[nodeId]="nodeId" />
</div>

<div class="aca-rule-details__form__row aca-rule-details__form__others" *ngIf="showOptionsSection">
<div class="aca-label">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LABEL.OPTIONS' | translate }}</div>
<aca-rule-options
formControlName="options"
data-automation-id="rule-details-options-component"
[errorScriptConstraint]="errorScriptConstraint">
</aca-rule-options>
[errorScriptConstraint]="errorScriptConstraint" />
</div>

</form>
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
[isSelected]="item.rule.id === this.selectedRule?.id"
[showEnabledToggle]="showEnabledToggles"
(click)="onRuleClicked(item.rule)"
(enabledChanged)="onEnabledChanged(item.rule, $event)">
</aca-rule-list-item>
(enabledChanged)="onEnabledChanged(item.rule, $event)" />

<ng-template #loadMoreRules>
<div
Expand Down Expand Up @@ -40,7 +39,7 @@
tabindex="0"
class="aca-rule-list-grouping__non-rule-item"
matRipple matRippleColor="hsla(0,0%,0%,0.05)">
<mat-spinner mode="indeterminate" [diameter]="16" class="aca-spinner"></mat-spinner>
<mat-spinner mode="indeterminate" [diameter]="16" class="aca-spinner" />
{{ 'ACA_FOLDER_RULES.RULE_LIST.LOADING_RULES' | translate }}
</div>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
<mat-slide-toggle
*ngIf="showEnabledToggle"
[checked]="rule.isEnabled"
(click)="onToggleClick(!rule.isEnabled, $event)">
</mat-slide-toggle>
(click)="onToggleClick(!rule.isEnabled, $event)" />

</div>
<div class="aca-rule-list-item__description">{{ rule.description }}</div>
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
(selectRule)="onSelectRule($event)"
(ruleEnabledChanged)="onRuleEnabledChanged($event)"
(loadMoreRules)="onLoadMoreRules($event)"
(loadMoreRuleSets)="onLoadMoreRuleSets()">
</aca-rule-list-grouping>

(loadMoreRuleSets)="onLoadMoreRuleSets()" />
</div>

<div
Expand Down Expand Up @@ -74,8 +72,7 @@
[showEnabledToggles]="isMainRuleSetOwned"
(selectRule)="onSelectRule($event)"
(ruleEnabledChanged)="onRuleEnabledChanged($event)"
(loadMoreRules)="onLoadMoreRules($event)">
</aca-rule-list-grouping>
(loadMoreRules)="onLoadMoreRules($event)" />

<ng-template #emptyLinkedRuleSet>
<div class="aca-rule-list__item__all-linked-rules-are-disabled">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
(select)="onNodeSelect($event)"
(folderLoaded)="setFolderLoading(false)"
(navigationChange)="setFolderLoading(true)"
(siteChange)="setFolderLoading(true)">
</adf-content-node-selector-panel>
(siteChange)="setFolderLoading(true)" />

<div class="aca-rule-set-picker__content__rule-list" [ngClass]="{ 'aca-justify': rulesLoading$ | async }">
<ng-container *ngIf="rulesLoading$ | async; else rulesLoaded">
<mat-progress-spinner color="primary" mode="indeterminate"></mat-progress-spinner>
<mat-progress-spinner color="primary" mode="indeterminate" />
</ng-container>

<ng-template #rulesLoaded>
Expand All @@ -30,16 +29,14 @@

<aca-rule-list-item
*ngFor="let rule of (mainRuleSet$ | async).rules"
[rule]="rule">
</aca-rule-list-item>
[rule]="rule" />
</ng-container>

<ng-template #noOwnedRules>
<adf-empty-content
icon="library_books"
[title]="'ACA_FOLDER_RULES.LINK_RULES_DIALOG.EMPTY_RULES_LIST.TITLE' | translate"
[subtitle]="'ACA_FOLDER_RULES.LINK_RULES_DIALOG.EMPTY_RULES_LIST.SUBTITLE' | translate">
</adf-empty-content>
[subtitle]="'ACA_FOLDER_RULES.LINK_RULES_DIALOG.EMPTY_RULES_LIST.SUBTITLE' | translate" />
</ng-template>
</ng-template>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
[value]="bulkSelectControl.value?.icon"
class="aca-bulk-actions-icon"
[attr.data-automation-id]="'aca-bulk-action-icon-' + bulkSelectControl.value?.id"
></adf-icon>
/>
{{ bulkSelectControl.value?.title | translate }}
</div>
</mat-select-trigger>
Expand All @@ -41,7 +41,7 @@
[value]="option.icon"
class="aca-bulk-actions-icon"
[attr.data-automation-id]="'aca-bulk-action-icon-' + option.id"
></adf-icon>
/>
{{ option.title | translate }}
</div>
</mat-option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { TranslateModule } from '@ngx-translate/core';
{{ 'APP.LANGUAGE' | translate }}
</button>
<mat-menu #langMenu="matMenu">
<adf-language-menu></adf-language-menu>
<adf-language-menu />
</mat-menu>
`,
encapsulation: ViewEncapsulation.None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
<ng-container [ngSwitch]="actionRef.type">
<ng-container *ngSwitchCase="'menu'">
<button mat-menu-item [id]="actionRef.id" [matMenuTriggerFor]="childMenu">
<adf-icon [value]="actionRef.icon" class="app-context-menu-item--icon"></adf-icon>
<adf-icon [value]="actionRef.icon" class="app-context-menu-item--icon" />
<span [attr.data-automation-id]="actionRef.id + '-label'">{{ actionRef.title | translate }}</span>
</button>

<mat-menu #childMenu="matMenu">
<ng-container *ngFor="let child of actionRef.children; trackBy: trackByActionId">
<app-context-menu-item [actionRef]="child"></app-context-menu-item>
<app-context-menu-item [actionRef]="child" />
</ng-container>
</mat-menu>
</ng-container>

<ng-container *ngSwitchCase="'separator'">
<mat-divider></mat-divider>
<mat-divider />
</ng-container>

<ng-container *ngSwitchCase="'custom'">
<adf-dynamic-component [data]="actionRef.data" [id]="actionRef.component"></adf-dynamic-component>
<adf-dynamic-component [data]="actionRef.data" [id]="actionRef.component" />
</ng-container>

<ng-container *ngSwitchDefault>
<button mat-menu-item [id]="actionRef.id" (click)="runAction()">
<adf-icon [value]="actionRef.icon" class="app-context-menu-item--icon"></adf-icon>
<adf-icon [value]="actionRef.icon" class="app-context-menu-item--icon" />
<span [attr.data-automation-id]="actionRef.id + '-label'">{{ actionRef.title | translate }}</span>
</button>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@
<ng-container *ngFor="let entry of actions; trackBy: trackByActionId" [ngSwitch]="entry.type">
<ng-container *ngSwitchDefault>
<button mat-menu-item [id]="entry.id" (click)="runAction(entry)">
<adf-icon [value]="entry.icon" class="app-context-menu-item--icon"></adf-icon>
<adf-icon [value]="entry.icon" class="app-context-menu-item--icon" />
<span [attr.data-automation-id]="entry.id + '-label'">{{ entry.title | translate }}</span>
</button>
</ng-container>

<ng-container *ngSwitchCase="'separator'">
<mat-divider></mat-divider>
<mat-divider />
</ng-container>

<ng-container *ngSwitchCase="'menu'">
<button mat-menu-item [id]="entry.id" [matMenuTriggerFor]="childMenu">
<adf-icon [value]="entry.icon" class="app-context-menu-item--icon"></adf-icon>
<adf-icon [value]="entry.icon" class="app-context-menu-item--icon" />
<span [attr.data-automation-id]="entry.id + '-label'">{{ entry.title | translate }}</span>
</button>

<mat-menu #childMenu="matMenu">
<ng-container *ngFor="let child of entry.children; trackBy: trackByActionId">
<app-context-menu-item [actionRef]="child"></app-context-menu-item>
<app-context-menu-item [actionRef]="child" />
</ng-container>
</mat-menu>
</ng-container>

<ng-container *ngSwitchCase="'custom'">
<adf-dynamic-component [data]="entry.data" [id]="entry.component"></adf-dynamic-component>
<adf-dynamic-component [data]="entry.data" [id]="entry.component" />
</ng-container>
</ng-container>
</mat-menu>
Expand Down
Loading
Loading