-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds check format support. Signed-off-by: Johnny Mariéthoz <[email protected]>
- Loading branch information
Showing
13 changed files
with
505 additions
and
0 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
29 changes: 29 additions & 0 deletions
29
projects/admin/src/app/migration/brief-view/migration-data/migration-data.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!-- | ||
RERO ILS UI | ||
Copyright (C) 2024 RERO | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, version 3 of the License. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
|
||
@if (record) { | ||
<h5> | ||
<a | ||
[routerLink]="[detailUrl.link]" | ||
[queryParams]="{ migration: record.metadata.migration_id }" | ||
>{{ record.id }} <p-badge [value]="record.metadata.conversion_status" | ||
/></a> | ||
</h5> | ||
@if (record?.metadata?.json?.title[0].mainTitle[0].value) { | ||
{{ record?.metadata?.json?.title[0].mainTitle[0].value }} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
projects/admin/src/app/migration/brief-view/migration-data/migration-data.component.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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* RERO ILS UI | ||
* Copyright (C) 2024 RERO | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, version 3 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { Component, Input } from '@angular/core'; | ||
import { ResultItem } from '@rero/ng-core'; | ||
|
||
@Component({ | ||
selector: 'admin-migration-data', | ||
templateUrl: './migration-data.component.html' | ||
}) | ||
export class MigrationDataComponent implements ResultItem { | ||
|
||
@Input() record: any; | ||
|
||
/** Type of record */ | ||
@Input() type: string; | ||
|
||
/** Detail Url */ | ||
@Input() detailUrl: { link: string, external: boolean }; | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
projects/admin/src/app/migration/brief-view/migration/migration.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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!-- | ||
RERO ILS UI | ||
Copyright (C) 2024 RERO | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, version 3 of the License. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
|
||
@if (record) { | ||
<a | ||
[routerLink]="['..', 'migration_data']" | ||
[queryParams]="{ migration: record.id }" | ||
class="p-button float-right" | ||
translate | ||
>Check Conversion</a | ||
> | ||
<h5> | ||
{{ record.metadata.name }} <p-badge [value]="record.metadata.status" /> | ||
</h5> | ||
@if(record.metadata?.description) { | ||
<p> | ||
{{ record.metadata.description }} | ||
</p> | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
projects/admin/src/app/migration/brief-view/migration/migration.component.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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* RERO ILS UI | ||
* Copyright (C) 2024 RERO | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, version 3 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { Component, Input } from '@angular/core'; | ||
import { ResultItem } from '@rero/ng-core'; | ||
|
||
@Component({ | ||
selector: 'admin-migration', | ||
templateUrl: './migration.component.html' | ||
}) | ||
export class MigrationComponent implements ResultItem { | ||
|
||
@Input() record: any; | ||
|
||
/** Type of record */ | ||
@Input() type: string; | ||
|
||
/** Detail Url */ | ||
@Input() detailUrl: { link: string, external: boolean }; | ||
} |
31 changes: 31 additions & 0 deletions
31
projects/admin/src/app/migration/detailed-view/migration-data/migration-data.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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!-- | ||
RERO ILS UI | ||
Copyright (C) 2020-2024 RERO | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, version 3 of the License. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
@if (record) { | ||
<h5 class="mb-5"> | ||
{{record.id}} <p-badge [value]="record.conversion_status" /> | ||
</h5> | ||
@if (messages) { | ||
<p-messages | ||
[(value)]="messages" | ||
[enableService]="false" | ||
[closable]="false" /> | ||
} | ||
<div class="text-sm grid data"> | ||
<div class="markdown col" [innerHTML]="record.raw | markdown"></div> | ||
<div class="json col" [innerHTML]="record.json| json | highlightJson"></div> | ||
</div> | ||
} |
32 changes: 32 additions & 0 deletions
32
projects/admin/src/app/migration/detailed-view/migration-data/migration-data.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,32 @@ | ||
/* | ||
* RERO ILS UI | ||
* Copyright (C) 2024 RERO | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, version 3 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
::ng-deep { | ||
.markdown td, | ||
.markdown th { | ||
padding: 0 10px; | ||
} | ||
} | ||
.data { | ||
.col { | ||
max-height: 600px; | ||
overflow: auto; | ||
} | ||
.json { | ||
border-left: 1px solid gray; | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
projects/admin/src/app/migration/detailed-view/migration-data/migration-data.component.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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* RERO ILS UI | ||
* Copyright (C) 2024 RERO | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, version 3 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { HttpClient } from '@angular/common/http'; | ||
import { Component, inject, OnDestroy, OnInit } from '@angular/core'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { of, Subscription, switchMap, tap } from 'rxjs'; | ||
|
||
@Component({ | ||
selector: 'admin-migration-data', | ||
templateUrl: './migration-data.component.html', | ||
styleUrl: './migration-data.component.scss', | ||
}) | ||
export class MigrationDataComponent implements OnInit, OnDestroy { | ||
/** Observable resolving record data */ | ||
record: any; | ||
protected route = inject(ActivatedRoute); | ||
protected http = inject(HttpClient); | ||
private subscriptions = new Subscription(); | ||
messages = []; | ||
ngOnInit(): void { | ||
this.subscriptions.add( | ||
this.route.paramMap | ||
.pipe( | ||
switchMap(() => { | ||
const docType = this.route.snapshot.params.type; | ||
const id = this.route.snapshot.params.pid; | ||
const migrationId = this.route.snapshot.queryParams.migration; | ||
if (docType == null || id == null || migrationId == null) { | ||
return of(null); | ||
} | ||
return this.http.get(`/api/${docType}/${id}?migration=${migrationId}`); | ||
}), | ||
tap((record: any) => { | ||
if (record?.conversion_logs) { | ||
['info', 'warning', 'error'].map((field) => { | ||
const log = record.conversion_logs[field]; | ||
if (log) { | ||
this.messages.push({ | ||
severity: field == 'warning' ? 'warn' : field, | ||
detail: log, | ||
}); | ||
} | ||
}); | ||
} | ||
}) | ||
) | ||
.subscribe((res) => (this.record = res)) | ||
); | ||
} | ||
/** OnDestroy hook */ | ||
ngOnDestroy(): void { | ||
this.subscriptions.unsubscribe(); | ||
} | ||
} |
Oops, something went wrong.