-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(backend): strip tags from labels
- Loading branch information
Showing
27 changed files
with
151 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/backend/src/usagers/dto/check-duplicate-usager-ref.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
import { IsNotEmpty, IsString, MaxLength } from "class-validator"; | ||
import { StripTagsTransform } from "../../_common/decorators"; | ||
|
||
export class CheckDuplicateUsagerRefDto { | ||
@ApiProperty({ | ||
required: true, | ||
}) | ||
@IsNotEmpty() | ||
@IsString() | ||
@StripTagsTransform() | ||
@MaxLength(100) | ||
public customRef!: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
packages/frontend/src/_common/model/structure-doc/constants/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
//@index('./*', f => `export * from '${f.path}'`) | ||
export * from "./DOCUMENT_EXTENSION_LABELS.const"; | ||
export * from "../../../../app/modules/structures/constants/DOMIFA_CUSTOM_DOCS.const"; | ||
export * from "../../../../app/modules/shared/components/display-table-image/STRUCTURE_DOC_ICONS.const"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
...ontend/src/app/modules/shared/components/display-table-image/STRUCTURE_DOC_ICONS.const.ts
This file was deleted.
Oops, something went wrong.
4 changes: 1 addition & 3 deletions
4
.../src/app/modules/shared/components/display-table-image/display-table-image.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
<span | ||
class="doc-icon" | ||
aria-hidden="true" | ||
[ngClass]="STRUCTURE_DOC_ICONS[document.filetype]" | ||
[ngClass]="'doc-icon icon-' + STRUCTURE_DOC_ICONS[document.filetype].iconName" | ||
> | ||
<fa-icon | ||
aria-hidden="true" | ||
[icon]="STRUCTURE_DOC_ICONS[document.filetype]" | ||
></fa-icon> | ||
</span> | ||
|
||
<span class="visually-hidden"> | ||
{{ STRUCTURE_DOC_EXTENSIONS_LABELS[document.filetype] }} | ||
</span> |
21 changes: 21 additions & 0 deletions
21
.../src/app/modules/shared/components/display-table-image/display-table-image.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.doc-icon { | ||
padding: 0.4rem 1.2rem; | ||
font-size: 2rem; | ||
text-align: center; | ||
border-radius: 6px; | ||
display: inline-block; | ||
background-color: #ecefff; | ||
} | ||
|
||
.icon-image { | ||
color: #553828; | ||
} | ||
.icon-file-pdf { | ||
color: #fe3b31; | ||
} | ||
.icon-file-word { | ||
color: #017aff; | ||
} | ||
.icon-file-excel { | ||
color: #33c75a; | ||
} |
2 changes: 1 addition & 1 deletion
2
...c/app/modules/shared/components/display-table-image/display-table-image.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 19 additions & 18 deletions
37
packages/frontend/src/app/modules/shared/directives/clean-str.directive.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
import { Directive, ElementRef, HostListener } from "@angular/core"; | ||
import { Directive, ElementRef, HostListener, Renderer2 } from "@angular/core"; | ||
|
||
import { stringCleaner } from "../../../shared/string-cleaner.service"; | ||
import { NgControl } from "@angular/forms"; | ||
|
||
@Directive({ | ||
selector: "[appCleanStr]", | ||
}) | ||
export class CleanStrDirective { | ||
constructor(private readonly el: ElementRef) {} | ||
|
||
@HostListener("keypress", ["$event"]) | ||
public onKeyPress(event: KeyboardEvent) { | ||
return this.validateFields(event); | ||
} | ||
constructor( | ||
private readonly el: ElementRef, | ||
private renderer: Renderer2, | ||
private control: NgControl | ||
) {} | ||
|
||
@HostListener("paste", ["$event"]) | ||
public blockPaste(event: KeyboardEvent) { | ||
this.validateFields(event); | ||
} | ||
|
||
public validateFields(event: KeyboardEvent) { | ||
setTimeout(() => { | ||
this.el.nativeElement.value = stringCleaner.cleanString( | ||
this.el.nativeElement.value | ||
); | ||
event.preventDefault(); | ||
}, 10); | ||
@HostListener("input", ["$event"]) | ||
@HostListener("keypress", ["$event"]) | ||
onInputChange(event: Event) { | ||
const inputElement = event.target as HTMLInputElement; | ||
const cleanedValue = stringCleaner.cleanString(inputElement.value); | ||
this.renderer.setProperty(inputElement, "value", cleanedValue); | ||
this.renderer.setProperty(this.el.nativeElement, "value", cleanedValue); | ||
this.control.control.setValue(cleanedValue, { emitEvent: false }); | ||
this.control.control.updateValueAndValidity({ | ||
onlySelf: true, | ||
emitEvent: false, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.