RED-5213 RSS Dialog and export
This commit is contained in:
parent
f589ed9eb5
commit
51ed05ff0c
@ -0,0 +1,22 @@
|
||||
<section class="dialog">
|
||||
<div translate="rss-dialog.title" class="dialog-header heading-l"></div>
|
||||
|
||||
<hr />
|
||||
<div class="dialog-content">
|
||||
<div *ngIf="rssData$ | async as rssEntry">
|
||||
<div *ngFor="let entry of rssEntry.result | keyvalue" class="rss-row">
|
||||
<div class="rss-key">{{ entry.key }}:</div>
|
||||
<div class="rss-value">{{ entry.value }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dialog-actions">
|
||||
<button color="primary" mat-flat-button type="submit" (click)="export()">
|
||||
{{ 'rss-dialog.actions.export' | translate }}
|
||||
</button>
|
||||
<div class="all-caps-label cancel" mat-dialog-close translate="rss-dialog.actions.close"></div>
|
||||
</div>
|
||||
|
||||
<iqser-circle-button class="dialog-close" icon="iqser:close" (action)="close()"></iqser-circle-button>
|
||||
</section>
|
||||
@ -0,0 +1,21 @@
|
||||
.rss-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
border-bottom: 1px solid var(--iqser-separator);
|
||||
|
||||
.rss-key {
|
||||
font-weight: bold;
|
||||
flex: 30;
|
||||
text-align: right;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.rss-value {
|
||||
padding: 4px;
|
||||
flex: 70;
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-content {
|
||||
overflow: auto;
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { BaseDialogComponent, SaveOptions } from '@iqser/common-ui';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { RssService } from '@services/files/rss.service';
|
||||
import { IFile, IRssEntry } from '@red/domain';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { saveAs } from 'file-saver';
|
||||
import { tap } from 'rxjs/operators';
|
||||
|
||||
interface RssData {
|
||||
file: IFile;
|
||||
}
|
||||
|
||||
@Component({
|
||||
templateUrl: './rss-dialog.component.html',
|
||||
styleUrls: ['./rss-dialog.component.scss'],
|
||||
})
|
||||
export class RssDialogComponent extends BaseDialogComponent {
|
||||
rssData$: Observable<IRssEntry>;
|
||||
rssDataSubject$: BehaviorSubject<IRssEntry> = new BehaviorSubject<IRssEntry>(null);
|
||||
|
||||
constructor(
|
||||
protected readonly _dialogRef: MatDialogRef<RssDialogComponent>,
|
||||
private readonly _rssService: RssService,
|
||||
@Inject(MAT_DIALOG_DATA) readonly data: RssData,
|
||||
) {
|
||||
super(_dialogRef);
|
||||
this.rssData$ = this._rssService
|
||||
.getRSSData(this.data.file.dossierId, this.data.file.fileId)
|
||||
.pipe(tap(entry => this.rssDataSubject$.next(entry)));
|
||||
}
|
||||
|
||||
export() {
|
||||
const blob = new Blob([JSON.stringify(this.rssDataSubject$.value, null, 2)], { type: 'application/json' });
|
||||
saveAs(blob, this.data.file.filename + '.rss.json');
|
||||
}
|
||||
|
||||
save(options?: SaveOptions): void {
|
||||
this.export();
|
||||
}
|
||||
}
|
||||
@ -51,6 +51,16 @@
|
||||
icon="iqser:download"
|
||||
tooltipPosition="below"
|
||||
></iqser-circle-button>
|
||||
|
||||
<iqser-circle-button
|
||||
(action)="openRSSView(file)"
|
||||
*ngIf="userPreferenceService.areDevFeaturesEnabled"
|
||||
[tooltip]="'file-preview.open-rss-view' | translate"
|
||||
[type]="circleButtonTypes.primary"
|
||||
class="ml-8"
|
||||
icon="red:rss"
|
||||
tooltipPosition="below"
|
||||
></iqser-circle-button>
|
||||
<!-- End Dev Mode Features-->
|
||||
|
||||
<iqser-circle-button
|
||||
|
||||
@ -389,6 +389,10 @@ export class FilePreviewScreenComponent
|
||||
download(await firstValueFrom(originalFile), filename);
|
||||
}
|
||||
|
||||
openRSSView(file: File) {
|
||||
this._dialogService.openDialog('rss', null, { file });
|
||||
}
|
||||
|
||||
loadAnnotations() {
|
||||
const documentLoaded$ = this._documentViewer.loaded$.pipe(
|
||||
tap(loaded => {
|
||||
|
||||
@ -50,6 +50,7 @@ import { AnnotationReferenceComponent } from './components/annotation-reference/
|
||||
import { ImportRedactionsDialogComponent } from './dialogs/import-redactions-dialog/import-redactions-dialog';
|
||||
import { DocumentUnloadedGuard } from './services/document-unloaded.guard';
|
||||
import { FilePreviewRightContainerComponent } from './components/right-container/file-preview-right-container.component';
|
||||
import { RssDialogComponent } from './dialogs/rss-dialog/rss-dialog.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
@ -72,6 +73,7 @@ const dialogs = [
|
||||
AcceptRecommendationDialogComponent,
|
||||
DocumentInfoDialogComponent,
|
||||
ImportRedactionsDialogComponent,
|
||||
RssDialogComponent,
|
||||
];
|
||||
|
||||
const components = [
|
||||
|
||||
@ -9,10 +9,12 @@ import { RecategorizeImageDialogComponent } from '../dialogs/recategorize-image-
|
||||
import { ConfirmationDialogComponent, DialogConfig, DialogService } from '@iqser/common-ui';
|
||||
import { ResizeAnnotationDialogComponent } from '../dialogs/resize-annotation-dialog/resize-annotation-dialog.component';
|
||||
import { HighlightActionDialogComponent } from '../dialogs/highlight-action-dialog/highlight-action-dialog.component';
|
||||
import { RssDialogComponent } from '../dialogs/rss-dialog/rss-dialog.component';
|
||||
|
||||
type DialogType =
|
||||
| 'confirm'
|
||||
| 'documentInfo'
|
||||
| 'rss'
|
||||
| 'recategorizeImage'
|
||||
| 'changeLegalBasis'
|
||||
| 'removeAnnotations'
|
||||
@ -54,6 +56,10 @@ export class FilePreviewDialogService extends DialogService<DialogType> {
|
||||
highlightAction: {
|
||||
component: HighlightActionDialogComponent,
|
||||
},
|
||||
rss: {
|
||||
component: RssDialogComponent,
|
||||
dialogConfig: { width: '90vw' },
|
||||
},
|
||||
};
|
||||
|
||||
constructor(protected readonly _dialog: MatDialog) {
|
||||
|
||||
@ -62,6 +62,7 @@ export class IconsModule {
|
||||
'report',
|
||||
'resize',
|
||||
'rotation',
|
||||
'rss',
|
||||
'rule',
|
||||
'secret',
|
||||
'status',
|
||||
|
||||
22
apps/red-ui/src/app/services/files/rss.service.ts
Normal file
22
apps/red-ui/src/app/services/files/rss.service.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { GenericService, HeadersConfiguration, QueryParam, RequiredParam, Validate } from '@iqser/common-ui';
|
||||
import { IRedactionLog, IRssData, IRssEntry } from '@red/domain';
|
||||
import { catchError, map, tap } from 'rxjs/operators';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class RssService extends GenericService<void> {
|
||||
protected readonly _defaultModelPath = 'import-redactions';
|
||||
|
||||
@Validate()
|
||||
getRSSData(@RequiredParam() dossierId: string, @RequiredParam() fileId: string) {
|
||||
const queryParams: QueryParam[] = [];
|
||||
queryParams.push({ key: 'fileId', value: fileId });
|
||||
|
||||
const rssData$ = this._getOne<IRssData>([dossierId], 'rss', queryParams);
|
||||
return rssData$.pipe(
|
||||
map(data => data.files[0]),
|
||||
catchError(() => of({} as IRssEntry)),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"ADMIN_CONTACT_NAME": null,
|
||||
"ADMIN_CONTACT_URL": null,
|
||||
"API_URL": "https://dev-04.iqser.cloud/redaction-gateway-v1",
|
||||
"API_URL": "https://qa1.iqser.cloud/redaction-gateway-v1",
|
||||
"APP_NAME": "RedactManager",
|
||||
"AUTO_READ_TIME": 3,
|
||||
"BACKEND_APP_VERSION": "4.4.40",
|
||||
@ -11,7 +11,7 @@
|
||||
"MAX_RETRIES_ON_SERVER_ERROR": 3,
|
||||
"OAUTH_CLIENT_ID": "redaction",
|
||||
"OAUTH_IDP_HINT": null,
|
||||
"OAUTH_URL": "https://dev-04.iqser.cloud/auth/realms/redaction",
|
||||
"OAUTH_URL": "https://qa1.iqser.cloud/auth/realms/redaction",
|
||||
"RECENT_PERIOD_IN_HOURS": 24,
|
||||
"SELECTION_MODE": "structural",
|
||||
"MANUAL_BASE_URL": "https://docs.redactmanager.com/preview"
|
||||
|
||||
@ -1295,6 +1295,13 @@
|
||||
},
|
||||
"upload-csv": "Upload File Attributes Configuration"
|
||||
},
|
||||
"rss-dialog": {
|
||||
"title": "RSS",
|
||||
"actions": {
|
||||
"export": "Export",
|
||||
"close": "Close"
|
||||
}
|
||||
},
|
||||
"file-preview": {
|
||||
"assign-me": "Assign to me",
|
||||
"assign-reviewer": "Assign User",
|
||||
@ -1303,6 +1310,7 @@
|
||||
"delta-tooltip": "The Delta View shows the unseen changes since your last visit to the page. This view is only available if there is at least 1 change.",
|
||||
"document-info": "Document Info",
|
||||
"download-original-file": "Download Original File",
|
||||
"open-rss-view": "Open RSS View",
|
||||
"exclude-pages": "Exclude pages from redaction",
|
||||
"excluded-from-redaction": "excluded",
|
||||
"fullscreen": "Full Screen (F)",
|
||||
|
||||
14
apps/red-ui/src/assets/icons/general/rss.svg
Normal file
14
apps/red-ui/src/assets/icons/general/rss.svg
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 310 310" style="enable-background:new 0 0 310 310;" xml:space="preserve">
|
||||
<g fill="currentColor">
|
||||
<path id="XMLID_789_" d="M90.244,264.828C90.244,240.11,70.139,220,45.427,220c-24.715,0-44.822,20.11-44.822,44.828
|
||||
c0,24.714,20.107,44.82,44.822,44.82C70.139,309.648,90.244,289.542,90.244,264.828z"/>
|
||||
<path id="XMLID_790_" d="M5.648,169.43c35.961,0,69.782,14.066,95.231,39.605c25.45,25.583,39.467,59.648,39.467,95.92
|
||||
c0,2.762,2.238,5,5,5h57.486c2.762,0,5-2.238,5-5c0-111.952-90.699-203.031-202.185-203.031c-2.762,0-5,2.238-5,5v57.505
|
||||
C0.648,167.191,2.887,169.43,5.648,169.43z"/>
|
||||
<path id="XMLID_791_" d="M5.726,0c-2.762,0-5,2.238-5,5v57.495c0,2.762,2.238,5,5,5c130.24,0,236.199,106.544,236.199,237.505
|
||||
c0,2.762,2.238,5,5,5h57.471c2.762,0,5-2.238,5-5C309.396,136.822,173.17,0,5.726,0z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@ -28,3 +28,4 @@ export * from './lib/license';
|
||||
export * from './lib/digital-signature';
|
||||
export * from './lib/watermarks';
|
||||
export * from './lib/colors';
|
||||
export * from './lib/rss';
|
||||
|
||||
2
libs/red-domain/src/lib/rss/index.ts
Normal file
2
libs/red-domain/src/lib/rss/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './rss-data';
|
||||
export * from './rss-entry';
|
||||
5
libs/red-domain/src/lib/rss/rss-data.ts
Normal file
5
libs/red-domain/src/lib/rss/rss-data.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { IRssEntry } from './rss-entry';
|
||||
|
||||
export interface IRssData {
|
||||
files: Array<IRssEntry>;
|
||||
}
|
||||
4
libs/red-domain/src/lib/rss/rss-entry.ts
Normal file
4
libs/red-domain/src/lib/rss/rss-entry.ts
Normal file
@ -0,0 +1,4 @@
|
||||
export interface IRssEntry {
|
||||
filaName: string;
|
||||
result: { [key: string]: string };
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user