Skip to content

Commit

Permalink
Merge pull request #84 from naturalsolutions/lint/apply-frontend-linting
Browse files Browse the repository at this point in the history
lint: apply frontend linting
  • Loading branch information
andriacap authored Aug 30, 2024
2 parents 0bc9052 + e74e7a7 commit c8dd966
Show file tree
Hide file tree
Showing 76 changed files with 1,616 additions and 688 deletions.
6 changes: 4 additions & 2 deletions frontend/_app.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
small.required::after {
content: "*";
content: '*';
margin-left: 4px;
color: red;
}
Expand All @@ -20,7 +20,9 @@ small.required::after {

.table {
background: #ffffff;
box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px rgba(0, 0, 0, 0.14),
box-shadow:
0px 3px 1px -2px rgba(0, 0, 0, 0.2),
0px 2px 2px rgba(0, 0, 0, 0.14),
0px 1px 5px rgba(0, 0, 0, 0.12);
border-bottom: 1px solid #6fcf97;
border-radius: 4px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<mat-expansion-panel [expanded]="expanded">
<mat-expansion-panel-header>
<mat-panel-title> {{ title }} </mat-panel-title>
<mat-panel-title>{{ title }}</mat-panel-title>
</mat-expansion-panel-header>
<ng-content></ng-content>
</mat-expansion-panel>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../../app.module";
@import '../../../app.module';

mat-expansion-panel {
margin: 28px 0 !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ <h5 class="modal-title"><i class="fa fa-trash"></i></h5>
<ng-content></ng-content>
</div>
<div class="modal-footer">
<button type="button" mat-raised-button class="mr-1 uppercase" (click)="onCancelClicked()">
<button
type="button"
mat-raised-button
class="mr-1 uppercase"
(click)="onCancelClicked()"
>
Annuler
</button>
<button
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../../app.module";
@import '../../../app.module';

.modal-body {
padding: 20px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
<th class="photo-principale">Photo principale</th>
<th class="image">Photo</th>
<!-- size can be provided in the columns object -->
<th *ngFor="let col of tableCols" [style.width]="col.size">{{ col.label }}</th>
<th
*ngFor="let col of tableCols"
[style.width]="col.size"
>
{{ col.label }}
</th>
<th *ngIf="editable || deletable || downloadable"></th>
</tr>
</thead>
Expand All @@ -28,12 +33,18 @@
</div>
</td>
<td>
<img *ngIf="item.image" [src]="item.image" />
<img
*ngIf="item.image"
[src]="item.image"
/>
</td>
<td *ngFor="let col of tableCols">
{{ item[col.name] !== "null" ? item[col.name] : "" }}
{{ item[col.name] !== 'null' ? item[col.name] : '' }}
</td>
<td class="tab-buttons" *ngIf="editable || deletable || downloadable">
<td
class="tab-buttons"
*ngIf="editable || deletable || downloadable"
>
<ng-container *ngIf="editable">
<button
mat-icon-button
Expand Down Expand Up @@ -75,8 +86,15 @@
</tr>
</tbody>
</table>
<ng-template #content let-c="close" let-d="dismiss">
<zh-delete-modal (onCancel)="d()" (onDelete)="c()">
<ng-template
#content
let-c="close"
let-d="dismiss"
>
<zh-delete-modal
(onCancel)="d()"
(onDelete)="c()"
>
<p>Etes-vous sûr de vouloir supprimer cette image ?</p>
</zh-delete-modal>
</ng-template>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../../app.module";
@import '../../../app.module';

.item {
list-style: none;
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/commonComponents/label/label.component.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../../app.module";
@import '../../../app.module';

.label {
font-weight: 600;
Expand Down
50 changes: 37 additions & 13 deletions frontend/app/commonComponents/table/table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
<thead class="thead-inverse table-header">
<tr>
<!-- size can be provided in the columns object -->
<th *ngFor="let col of tableCols" [style.width]="col.size">{{ col.label }}</th>
<th
*ngFor="let col of tableCols"
[style.width]="col.size"
>
{{ col.label }}
</th>
<th *ngIf="editable || deletable || downloadable"></th>
</tr>
</thead>
Expand All @@ -17,7 +22,10 @@
<td *ngFor="let col of tableCols">
<ng-container *ngIf="col.subcell; else elseBlockSub">
<ul *ngIf="isArray(item[col.name][col.subcell.key]); else elseBlockSubArr">
<li class="item" *ngFor="let item of item[col.name][col.subcell.key]">
<li
class="item"
*ngFor="let item of item[col.name][col.subcell.key]"
>
{{ item[col.subcell.name] }}
</li>
</ul>
Expand All @@ -28,32 +36,41 @@
<ng-template #elseBlockSub>
<ul *ngIf="isArray(item[col.name]); else elseBlockSub2">
<ng-container *ngIf="col.subarr; else elseNotSubname">
<li class="item" *ngFor="let subitem of item[col.name]">
<li
class="item"
*ngFor="let subitem of item[col.name]"
>
{{ subitem[col.subarr.name] }}
</li>
</ng-container>
<ng-template #elseNotSubname>
<li class="item" *ngFor="let subitem of item[col.name]">
<li
class="item"
*ngFor="let subitem of item[col.name]"
>
{{ subitem }}
</li>
</ng-template>
</ul>
<ng-template #elseBlockSub2>
<b *ngIf="bold_row_values.includes(item['name']); else italic">{{
item[col.name]
}}</b>
<b *ngIf="bold_row_values.includes(item['name']); else italic">
{{ item[col.name] }}
</b>
<ng-template #italic>
<i *ngIf="italic_row_values.includes(item['name']); else normal">{{
item[col.name]
}}</i>
<i *ngIf="italic_row_values.includes(item['name']); else normal">
{{ item[col.name] }}
</i>
</ng-template>
<ng-template #normal>
{{ item[col.name] }}
</ng-template>
</ng-template>
</ng-template>
</td>
<td class="tab-buttons" *ngIf="editable || deletable || downloadable">
<td
class="tab-buttons"
*ngIf="editable || deletable || downloadable"
>
<ng-container *ngIf="editable">
<button
mat-icon-button
Expand Down Expand Up @@ -95,8 +112,15 @@
</tr>
</tbody>
</table>
<ng-template #content let-c="close" let-d="dismiss">
<zh-delete-modal (onCancel)="d()" (onDelete)="c()">
<ng-template
#content
let-c="close"
let-d="dismiss"
>
<zh-delete-modal
(onCancel)="d()"
(onDelete)="c()"
>
<p>Etes-vous sûr de vouloir supprimer cette ligne ?</p>
</zh-delete-modal>
</ng-template>
2 changes: 1 addition & 1 deletion frontend/app/commonComponents/table/table.component.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../../app.module";
@import '../../../app.module';

.item {
list-style: none;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,65 +1,78 @@
<small>{{ label }}</small>
<ng-select class="Multiselect"
#zhMultiselect
[ngClass]="{'Multiselect--multiple': multiple, 'Multiselect--hightlightValue': hightlightValue}"
[items]="values"
[bindLabel]="keyLabel"
[bindValue]="keyValue"
[placeholder]="placeholder"
[multiple]="multiple"
[clearable]="true"
[virtualScroll]="true"
[formControl]="parentFormControl"
(add)="onChange.emit($event)"
(remove)="onDelete.emit($event)"
(open)="onOpen.emit($event)"
[closeOnSelect]="!multiple"
[groupBy]="groupBy"
[selectableGroup]="true"
[selectableGroupAsModel]="false"
>
<ng-template ng-header-tmp>
<div class="MultiselectHeader">
<input type="text"
class="MultiselectHeader__search"
id="inputValidation"
placeholder="Search"
(input)="zhMultiselect.filter($event.target.value)" />
<button *ngIf="zhMultiselect.multiple"
class="MultiselectHeader__selectAll"
mat-flat-button
color="#219653"
(click)="selectAllFiltered(zhMultiselect)">
Select all
</button>
</div>
</ng-template>
<ng-template ng-optgroup-tmp
let-item="item"
let-item$="item$"
let-index="index"
class="MultiselectOption">
<div class="MultiselectOptionItem">
<input class="MultiselectOptionItem__checkbox"
id="item-{{index}}"
type="checkbox"
[ngModel]="item$.selected"
[ngModelOptions]="{standalone: true}" />
<div class="MultiselectOptionItem__text">{{ item[groupBy] }}</div>
</div>
</ng-template>
<ng-template ng-option-tmp
let-item="item"
let-item$="item$"
let-index="index"
class="MultiselectOption">
<div class="MultiselectOptionItem">
<input class="MultiselectOptionItem__checkbox"
id="item-{{index}}"
type="checkbox"
[ngModel]="item$.selected"
[ngModelOptions]="{standalone: true}" />
<div class="MultiselectOptionItem__text">{{ item[keyLabel] }}</div>
</div>
</ng-template>
</ng-select>
<ng-select
class="Multiselect"
#zhMultiselect
[ngClass]="{ 'Multiselect--multiple': multiple, 'Multiselect--hightlightValue': hightlightValue }"
[items]="values"
[bindLabel]="keyLabel"
[bindValue]="keyValue"
[placeholder]="placeholder"
[multiple]="multiple"
[clearable]="true"
[virtualScroll]="true"
[formControl]="parentFormControl"
(add)="onChange.emit($event)"
(remove)="onDelete.emit($event)"
(open)="onOpen.emit($event)"
[closeOnSelect]="!multiple"
[groupBy]="groupBy"
[selectableGroup]="true"
[selectableGroupAsModel]="false"
>
<ng-template ng-header-tmp>
<div class="MultiselectHeader">
<input
type="text"
class="MultiselectHeader__search"
id="inputValidation"
placeholder="Search"
(input)="zhMultiselect.filter($event.target.value)"
/>
<button
*ngIf="zhMultiselect.multiple"
class="MultiselectHeader__selectAll"
mat-flat-button
color="#219653"
(click)="selectAllFiltered(zhMultiselect)"
>
Select all
</button>
</div>
</ng-template>
<ng-template
ng-optgroup-tmp
let-item="item"
let-item$="item$"
let-index="index"
class="MultiselectOption"
>
<div class="MultiselectOptionItem">
<input
class="MultiselectOptionItem__checkbox"
id="item-{{ index }}"
type="checkbox"
[ngModel]="item$.selected"
[ngModelOptions]="{ standalone: true }"
/>
<div class="MultiselectOptionItem__text">{{ item[groupBy] }}</div>
</div>
</ng-template>
<ng-template
ng-option-tmp
let-item="item"
let-item$="item$"
let-index="index"
class="MultiselectOption"
>
<div class="MultiselectOptionItem">
<input
class="MultiselectOptionItem__checkbox"
id="item-{{ index }}"
type="checkbox"
[ngModel]="item$.selected"
[ngModelOptions]="{ standalone: true }"
/>
<div class="MultiselectOptionItem__text">{{ item[keyLabel] }}</div>
</div>
</ng-template>
</ng-select>
Loading

0 comments on commit c8dd966

Please sign in to comment.