Skip to content

Commit d55067f

Browse files
committed
feat: Add additional form fields to inetorgperson.ui.yml
1 parent 8c6cd4b commit d55067f

File tree

6 files changed

+401
-6
lines changed

6 files changed

+401
-6
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
type: Group
2+
label: Identité
3+
elements:
4+
- type: HorizontalLayout
5+
elements:
6+
- type: Control
7+
label: CN
8+
scope: "#/properties/cn"
9+
options:
10+
required: true
11+
- type: Control
12+
label: Nom
13+
scope: "#/properties/sn"
14+
options:
15+
required: true
16+
readonly: true
17+
- type: Control
18+
label: UID
19+
scope: "#/properties/uid"
20+
options:
21+
required: true
22+
- type: HorizontalLayout
23+
elements:
24+
- type: Control
25+
label: Nom d'affichage
26+
scope: "#/properties/displayName"
27+
- type: Control
28+
label: Prénom
29+
scope: "#/properties/givenName"
30+
- type: HorizontalLayout
31+
elements:
32+
- type: Control
33+
label: Employee Number
34+
scope: "#/properties/employeeNumber"
35+
- type: Control
36+
label: Employee Type
37+
scope: "#/properties/employeeType"
38+
options:
39+
suggestion:
40+
- TAIGA
41+
- LOCAL
42+
- type: HorizontalLayout
43+
elements:
44+
- type: Control
45+
label: Email
46+
scope: "#/properties/mail"
47+
options:
48+
format: email
49+
- type: Control
50+
label: Mobile
51+
scope: "#/properties/mobile"
52+
- type: Control
53+
label: Adresse postale
54+
scope: "#/properties/postalAddress"
55+
- type: HorizontalLayout
56+
elements:
57+
- type: Control
58+
label: language préféré
59+
scope: "#/properties/preferredLanguage"
60+
options:
61+
required: false
62+
# suggestion:
63+
# - FR
64+
# - EN
65+
# - DE
66+
# - IT
67+
- type: Control
68+
label: Téléphone
69+
scope: "#/properties/telephoneNumber"
70+
- type: Control
71+
label: Titre
72+
scope: "#/properties/title"
73+
74+
- type: HorizontalLayout
75+
elements:
76+
- type: Control
77+
label: Photo
78+
scope: "#/properties/jpegPhoto"
79+
options:
80+
format: file
81+
storage: picture
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
type: Group
2+
label: supannPerson
3+
elements:
4+
- type: HorizontalLayout
5+
elements:
6+
- type: Control
7+
label: Civilité
8+
scope: "#/properties/supanncivilite"
9+
options:
10+
required: true
11+
suggestion:
12+
- M.
13+
- Mme
14+
- Mlle
15+
- type: Control
16+
label: supannNomdeNaissance
17+
scope: "#/properties/supannNomdeNaissance"
18+
options:
19+
required: false
20+
- type: Control
21+
label: supannOIDCDatedeNaissance
22+
scope: "#/properties/supannOIDCDatedeNaissance"
23+
options:
24+
format: date
25+
required: true
26+
dateFormat: "dd/MM/yyyy"
27+
- type: HorizontalLayout
28+
elements:
29+
- type: Control
30+
label: supannOIDCGenre
31+
scope: "#/properties/supannOIDCGenre"
32+
options:
33+
required: true
34+
- type: Control
35+
label: supannPrenomsEtatCivil
36+
scope: "#/properties/supannPrenomsEtatCivil"
37+
options:
38+
required: true
39+
- type: Control
40+
label: supannCodeINSEEPaysDeNaissance
41+
scope: "#/properties/supannCodeINSEEPaysDeNaissance"
42+
options:
43+
required: true
44+
- type: HorizontalLayout
45+
elements:
46+
- type: Control
47+
label: supannCodeINSEEVilleDeNaissance
48+
scope: "#/properties/supannCodeINSEEVilleDeNaissance"
49+
options:
50+
required: false
51+
- type: Control
52+
label: supannAutreMail
53+
scope: "#/properties/supannAutreMail"
54+
options:
55+
required: true
56+
- type: Control
57+
label: supannListeRouge
58+
scope: "#/properties/supannListeRouge"
59+
options:
60+
required: false
61+
- type: HorizontalLayout
62+
elements:
63+
- type: Control
64+
label: mailForwardingAddress
65+
scope: "#/properties/mailForwardingAddress"
66+
options:
67+
required: false
68+
- type: Control
69+
label: supannMailPerso
70+
scope: "#/properties/supannMailPerso"
71+
options:
72+
required: false
73+
- type: Control
74+
label: supannRoleGenerique
75+
scope: "#/properties/supannRoleGenerique"
76+
options:
77+
required: false
78+
- type: HorizontalLayout
79+
elements:
80+
- type: Control
81+
label: supannEmpId
82+
scope: "#/properties/supannEmpId"
83+
options:
84+
format: number
85+
required: false
86+
- type: Control
87+
label: supannParrainDN
88+
scope: "#/properties/supannParrainDN"
89+
options:
90+
required: false
91+
- type: Control
92+
label: supannTypeEntiteAffectation
93+
scope: "#/properties/supannTypeEntiteAffectation"
94+
options:
95+
required: false
96+
readOnly: true
97+
suggestion:
98+
- "adm"
99+
- "etd"
100+
- "esn"
101+
- type: HorizontalLayout
102+
elements:
103+
- type: Control
104+
label: supannActivite
105+
scope: "#/properties/supannActivite"
106+
options:
107+
required: false
108+
- type: Control
109+
label: supannEmpDateFin
110+
scope: "#/properties/supannEmpDateFin"
111+
options:
112+
required: false

src/management/identities/jsonforms/identities.jsonforms.service.ts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,37 @@
1-
import { Injectable } from '@nestjs/common';
1+
import { Injectable, OnApplicationBootstrap, OnModuleInit } from '@nestjs/common';
22
import { AbstractService } from '~/_common/abstracts/abstract.service';
33
import { parse, stringify } from 'yaml';
4-
import { existsSync, readFileSync, writeFileSync, readdirSync } from 'fs';
4+
import { existsSync, readFileSync, writeFileSync, readdirSync, readdir } from 'fs';
55
// import Ajv from 'ajv';
66
import { ValidationConfigException } from '~/_common/errors/ValidationException';
77

88
@Injectable()
9-
export class IdentitiesJsonformsService extends AbstractService {
9+
export class IdentitiesJsonformsService extends AbstractService implements OnApplicationBootstrap {
1010
// private ajv: Ajv = new Ajv({ allErrors: true });
1111
// private validateSchema;
1212

1313
public constructor() {
1414
super();
1515
}
1616

17+
public onApplicationBootstrap(): void {
18+
const files = readdirSync(`${process.cwd()}/configs/identities/jsonforms`);
19+
const defaultFiles = readdirSync(`${process.cwd()}/src/management/identities/jsonforms/_default`);
20+
21+
this.logger.log('Initializing identities jsonforms service');
22+
23+
for (const file of defaultFiles) {
24+
if (!files.includes(file)) {
25+
const defaultFile = readFileSync(`${process.cwd()}/src/management/identities/jsonforms/_default/${file}`, 'utf-8');
26+
writeFileSync(`${process.cwd()}/configs/identities/jsonforms/${file}`, defaultFile);
27+
28+
this.logger.warn(`Copied default jsonform file: ${file}`);
29+
}
30+
}
31+
32+
this.logger.log('Identities jsonforms service initialized');
33+
}
34+
1735
private resolveJsonFormPath(schema: string): string | null {
1836
if (!schema.endsWith('.yml')) schema += '.yml';
1937
const hardConfigPath = `./src/management/identities/jsonforms/_config/${schema}`;
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"properties": {
5+
"cn": {
6+
"type": "string",
7+
"description": "Common name of the inetOrgPerson."
8+
},
9+
"sn": {
10+
"type": "string",
11+
"description": "Surname of the inetOrgPerson."
12+
},
13+
"uid": {
14+
"type": "string",
15+
"description": "UID of the inetOrgPerson."
16+
},
17+
"departmentNumber":{
18+
"type": "array",
19+
"description": "type of identity",
20+
"items":{
21+
"type": "string"
22+
}
23+
},
24+
"employeeNumber": {
25+
"type": "string",
26+
"description": "EmployeeNumber of the inetOrgPerson."
27+
},
28+
"employeeType": {
29+
"type": "string",
30+
"description": "EmployeeType of the inetOrgPerson."
31+
},
32+
"displayName": {
33+
"type": "string",
34+
"description": "Display name of the inetOrgPerson."
35+
},
36+
"facsimileTelephoneNumber": {
37+
"type": "string",
38+
"description": "Facsimile telephone number of the inetOrgPerson."
39+
},
40+
"givenName": {
41+
"type": "string",
42+
"description": "Given name of the inetOrgPerson."
43+
},
44+
"labeledURI": {
45+
"type": "string",
46+
"description": "URI associated with the inetOrgPerson."
47+
},
48+
"mail": {
49+
"type": "string",
50+
"format": "email",
51+
"description": "Email address of the inetOrgPerson."
52+
},
53+
"mobile": {
54+
"type": "string",
55+
"description": "Mobile number of the inetOrgPerson."
56+
},
57+
"postalAddress": {
58+
"type": "string",
59+
"description": "Postal address of the inetOrgPerson."
60+
},
61+
"preferredLanguage": {
62+
"type": "string",
63+
"description": "Preferred language of the inetOrgPerson."
64+
},
65+
"telephoneNumber": {
66+
"type": "string",
67+
"description": "Telephone number of the inetOrgPerson."
68+
},
69+
"title": {
70+
"type": "string",
71+
"description": "Title of the inetOrgPerson."
72+
},
73+
"userCertificate": {
74+
"type": "string",
75+
"description": "User certificate of the inetOrgPerson."
76+
},
77+
"userPassword": {
78+
"type": "string",
79+
"description": "User password of the inetOrgPerson."
80+
},
81+
"jpegPhoto": {
82+
"type": "string",
83+
"description": "User jpeg photo of the inetOrgPerson."
84+
}
85+
},
86+
"required": ["uid", "employeeNumber", "employeeType"]
87+
}

0 commit comments

Comments
 (0)