diff --git a/front/app/package-lock.json b/front/app/package-lock.json index 8fb12ecb..a6648287 100644 --- a/front/app/package-lock.json +++ b/front/app/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.0", "dependencies": { "@angular/animations": "^15.0.0", + "@angular/cdk": "^15.2.1", "@angular/common": "^15.0.0", "@angular/compiler": "^15.0.0", "@angular/core": "^15.0.0", @@ -408,6 +409,46 @@ "@angular/core": "15.1.3" } }, + "node_modules/@angular/cdk": { + "version": "15.2.1", + "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-15.2.1.tgz", + "integrity": "sha512-kRwG0ujimOPhqDwQYcQ+pk7hpTr0yvaPkxAx5r1ytA6aQIvHJ1XaPzhtthsr5/PhpwzlH8k723xpejrLKcuR+w==", + "dependencies": { + "tslib": "^2.3.0" + }, + "optionalDependencies": { + "parse5": "^7.1.2" + }, + "peerDependencies": { + "@angular/common": "^15.0.0 || ^16.0.0", + "@angular/core": "^15.0.0 || ^16.0.0", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, + "node_modules/@angular/cdk/node_modules/entities": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", + "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", + "optional": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/@angular/cdk/node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "optional": true, + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, "node_modules/@angular/cli": { "version": "15.0.5", "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-15.0.5.tgz", diff --git a/front/app/package.json b/front/app/package.json index 36ffa595..584b30d3 100644 --- a/front/app/package.json +++ b/front/app/package.json @@ -11,6 +11,7 @@ "private": true, "dependencies": { "@angular/animations": "^15.0.0", + "@angular/cdk": "^15.2.1", "@angular/common": "^15.0.0", "@angular/compiler": "^15.0.0", "@angular/core": "^15.0.0", @@ -23,8 +24,8 @@ "@ngx-formly/core": "^6.0.0", "@popperjs/core": "^2.11.6", "@tinymce/tinymce-angular": "^7.0.0", - "fabric": "^5.3.0", "@types/fabric": "^5.3.0", + "fabric": "^5.3.0", "ngx-bootstrap-icons": "^1.9.1", "ngx-wig": "^15.1.4", "rxjs": "~7.5.0", diff --git a/front/app/src/common/crud/crud-formly-jsonschema.service.ts b/front/app/src/common/crud/crud-formly-jsonschema.service.ts index 6b575dae..275bb4da 100644 --- a/front/app/src/common/crud/crud-formly-jsonschema.service.ts +++ b/front/app/src/common/crud/crud-formly-jsonschema.service.ts @@ -53,6 +53,8 @@ export class CrudFormlyJsonschemaOptions implements FormlyJsonschemaOptions { } else if (schema.type == "string" && schema.hasOwnProperty('props') && schema.props.hasOwnProperty("richtext") && schema.props.richtext) { field.type = "richtext"; + } else if (schema.type == "string" && schema.format == "signature-link") { + field.type = "signature-link"; } if (schema.hasOwnProperty('props')) { diff --git a/front/app/src/common/crud/crud.module.ts b/front/app/src/common/crud/crud.module.ts index 2f38ce73..3021798e 100644 --- a/front/app/src/common/crud/crud.module.ts +++ b/front/app/src/common/crud/crud.module.ts @@ -26,6 +26,8 @@ import { HiddenTypeComponent } from "./types/hidden.type"; import { DictionaryTypeComponent } from "./types/dictionary.type"; import { DictionaryService } from "./types/dictionary.service"; import { RichtextTypeComponent } from "./types/richtext.type"; +import { SignatureLinkTypeComponent } from "@common/crud/types/signature-link.type"; +import { ClipboardModule } from '@angular/cdk/clipboard'; @NgModule({ @@ -40,7 +42,8 @@ import { RichtextTypeComponent } from "./types/richtext.type"; ForeignkeyTypeComponent, HiddenTypeComponent, DictionaryTypeComponent, - RichtextTypeComponent + RichtextTypeComponent, + SignatureLinkTypeComponent ], providers: [ JsonschemasService, @@ -68,10 +71,12 @@ import { RichtextTypeComponent } from "./types/richtext.type"; { name: 'hidden', component: HiddenTypeComponent }, { name: 'dictionary', component: DictionaryTypeComponent }, { name: 'richtext', component: RichtextTypeComponent }, + { name: 'signature-link', component: SignatureLinkTypeComponent }, ] }), FormlyBootstrapModule, - EditorModule + EditorModule, + ClipboardModule ], exports: [ CardComponent, diff --git a/front/app/src/common/crud/types/signature-link.type.ts b/front/app/src/common/crud/types/signature-link.type.ts new file mode 100644 index 00000000..be433e9a --- /dev/null +++ b/front/app/src/common/crud/types/signature-link.type.ts @@ -0,0 +1,20 @@ +import {Component, OnInit} from "@angular/core"; +import { FieldType, FieldTypeConfig } from "@ngx-formly/core"; + +@Component({ + selector: 'app-form-signature-link-type', + template: ` +
+ + +
+ `, +}) +export class SignatureLinkTypeComponent extends FieldType implements OnInit{ + base_path = "/contracts/signature/" + signature_url = "" + + ngOnInit() { + this.signature_url = location.origin + this.base_path + this.formControl.value + } +}