Commit 16e434ce authored by Baptiste Toulemonde's avatar Baptiste Toulemonde
Browse files

fix parcour pusa => change methode to assign profil type if standalone

parent f252ec8d
......@@ -96,8 +96,6 @@ public class Notice extends IdDto {
private String path;
@JsonProperty("format")
private ProfileFormat format;
@JsonProperty("type")
private ProfileType type;
public Notice(Resource r) throws IOException {
String fileName = r.getFilename();
......@@ -116,7 +114,6 @@ public class Notice extends IdDto {
this.creationDate = new Timestamp(updateDate).toString();
this.tenant = 1;
this.version = 1;
this.type = getFileType(fileName);
this.name = getFileBaseName(fileName);
if (getFileType(fileName).equals(ProfileType.PUA)) {
InputStream inputStream = getClass().getClassLoader().getResourceAsStream("rng/" +
......
......@@ -11,7 +11,6 @@
"controlSchema": "{\"$schema\":\"http://json-schema.org/draft-04/schema\",\"type\":\"object\",\"definitions\":{\"pattern-simple-date\":{\"type\":\"string\",\"pattern\":\"[0-9]{4}-[0-9]{2}-[0-9]{2}\"},\"pattern-date\":{\"type\":\"string\",\"pattern\":\"^([0-8][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))$\"}},\"properties\":{}}",
"tenant": 8,
"version": 1,
"type": "PUA",
"fields": [
]
}
......@@ -89,12 +89,7 @@ export class ProfileService implements OnDestroy {
getAllProfiles(): void {
if (environment.standalone) {
this.getStandaloneProfiles().subscribe((profiles: ProfileDescription[]) => {
if (profiles) {
this.retrievedProfiles.next(profiles);
console.log('Profiles: ', this.retrievedProfiles);
}
});
this.getAllProfilesStandalone();
} else {
this.getAllProfilesVitam();
// return this.getAllProfilesPaginated(pageRequest);
......@@ -126,6 +121,21 @@ export class ProfileService implements OnDestroy {
return allProfilesPUA;
}
getAllProfilesStandalone(): void {
this.getStandaloneProfiles().subscribe((profiles: ProfileDescription[]) => {
if (profiles) {
for (const profile of profiles) {
if (profile.controlSchema) {
profile.type = 'PUA';
} else {
profile.type = 'PA';
}
}
this.retrievedProfiles.next(profiles);
}
});
}
getAllProfilesVitam(): void {
const profiles: ProfileDescription[] = [];
this.subscription3$ = this.getAllProfilesPUA().subscribe((profileListPUA: ProfileDescription[] ) => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment