Skip to content

V9 Upgrade proxy license step #196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class SubmissionSectionContainerComponent implements OnInit {
@ViewChild('sectionRef') sectionRef: SectionsDirective;

// TAMU Customization - theme service to get active theme
private themeService: ThemeService;
private readonly themeService: ThemeService;
// END TAMU Customization - theme service to get active theme

/**
Expand Down
2 changes: 1 addition & 1 deletion src/app/submission/sections/sections-decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function renderSectionFor(sectionType: SectionsType, theme: string = 'dsp
export function rendersSectionType(sectionType: SectionsType, theme: string = 'dspace') {
let themedMap = submissionSectionsMap.get(theme);
if (themedMap === undefined || !themedMap.has(sectionType)) {
themedMap = submissionSectionsMap.get('dspace');
return submissionSectionsMap.get(sectionType);
}
return themedMap.get(sectionType);
}
Original file line number Diff line number Diff line change
@@ -1,83 +1,91 @@
<div class="ml-3 mb-1">
<div class="h4">{{"submission.sections.proxy-license.header" | translate}}</div>
<p>
<span class="font-weight-bolder">{{"submission.sections.proxy-license.last-step-label" | translate}} </span>
<span>{{"submission.sections.proxy-license.last-step" | translate}}</span>
</p>
<p>{{"submission.sections.proxy-license.instructions" | translate}}</p>
<div class="h4">{{"submission.sections.proxy-license.header" | translate}}</div>
<p>
<span class="font-weight-bolder">{{"submission.sections.proxy-license.last-step-label" | translate}} </span>
<span>{{"submission.sections.proxy-license.last-step" | translate}}</span>
</p>
<p>{{"submission.sections.proxy-license.instructions" | translate}}</p>
</div>

<div #labelWrapper [hidden]="(license | async) === undefined" class="tamu-control-license tamu-control-label">
<label class="font-weight-bolder">{{"submission.sections.proxy-license.label" | translate}}</label>
<label class="font-weight-bolder">{{"submission.sections.proxy-license.label" | translate}}</label>
</div>

<div #licenseWrapper [hidden]="(license | async) === undefined" class="tamu-control-license">
<p [innerHTML]="license | async"></p>
<p [innerHTML]="license | async"></p>
</div>

<div #uploaderWrapper class="mb-1" [hidden]="(selected | async) !== 'proxy'" class="tamu-control-license">
<label class="font-weight-bolder">{{"submission.sections.proxy-license.upload-label" | translate}}</label>
<ds-uploader *ngIf="uploadFilesOptions.url"
[dropMsg]="dropMsg"
[dropOverDocumentMsg]="dropOverDocumentMsg"
[enableDragOverDocument]="enableDragOverDocument"
[onBeforeUpload]="onBeforeUpload"
[uploadFilesOptions]="uploadFilesOptions"
(onCompleteItem)="onCompleteItem($event)"
(onUploadError)="onUploadError()"></ds-uploader>
<ng-container *ngIf="proxyLicense | async; let proxy">
<div class="row">
<div class="col-md-12">
<div class="float-left w-75" *ngIf="proxy.metadata['dc.source'] && proxy.metadata['dc.source'].length > 0">
<span class="h3">{{proxy.metadata['dc.source'][0].value}} <span class="text-muted">({{proxy.sizeBytes | dsFileSize}})</span></span>
</div>
<div class="float-right w-15">
<ng-container>
<ds-themed-file-download-link [cssClasses]="'btn btn-link-focus'" [isBlank]="true"
[bitstream]="proxy" [enableRequestACopy]="false">
<i class="fa fa-download fa-2x text-normal" aria-hidden="true"></i>
</ds-themed-file-download-link>
<button class="btn btn-link-focus"
[attr.aria-label]="'submission.sections.upload.delete.confirm.title' | translate"
title="{{ 'submission.sections.upload.delete.confirm.title' | translate }}"
[disabled]="(removingProxy | async)"
(click)="$event.preventDefault();confirmRemoveProxy(content, proxy);">
<i *ngIf="(removingProxy | async)" class="fas fa-circle-notch fa-spin fa-2x text-danger"></i>
<i *ngIf="!(removingProxy | async)" class="fa fa-trash fa-2x text-danger"></i>
</button>
</ng-container>
</div>
<label class="font-weight-bolder">{{"submission.sections.proxy-license.upload-label" | translate}}</label>
@if (uploadFilesOptions.url) {
<ds-uploader [dropMsg]="dropMsg"
[dropOverDocumentMsg]="dropOverDocumentMsg"
[enableDragOverDocument]="enableDragOverDocument"
[onBeforeUpload]="onBeforeUpload"
[uploadFilesOptions]="uploadFilesOptions"
(onCompleteItem)="onCompleteItem($event)"
(onUploadError)="onUploadError()"></ds-uploader>
}
@if (proxyLicense | async; as proxy) {
<ng-container>
<div class="row">
<div class="col-md-12">
@if ((proxy.metadata['dc.source'] && proxy.metadata['dc.source'].length > 0)) {
<div class="float-left w-75">
<span class="h3">{{proxy.metadata['dc.source'][0].value}} <span class="text-muted">({{proxy.sizeBytes | dsFileSize}})</span></span>
</div>
}
<div class="float-right w-15">
<ng-container>
<ds-file-download-link [cssClasses]="'btn btn-link-focus'" [isBlank]="true" [bitstream]="proxy" [enableRequestACopy]="false">
<i class="fa fa-download fa-2x text-normal" aria-hidden="true"></i>
</ds-file-download-link>
<button class="btn btn-link-focus"
[attr.aria-label]="'submission.sections.upload.delete.confirm.title' | translate"
title="{{ 'submission.sections.upload.delete.confirm.title' | translate }}"
[disabled]="(removingProxy | async)"
(click)="$event.preventDefault();confirmRemoveProxy(content, proxy);">
@if ((removingProxy | async)) {
<i class="fas fa-circle-notch fa-spin fa-2x text-danger"></i>
}
@if (!(removingProxy | async)) {
<i class="fa fa-trash fa-2x text-danger"></i>
}
</button>
</ng-container>
</div>
</div>
</div>
</ng-container>
<small class="form-text text-muted">{{"submission.sections.proxy-license.upload-instructions" | translate}}</small>
}
<small class="form-text text-muted">{{"submission.sections.proxy-license.upload-instructions" | translate}}</small>
</div>

<div #formWrapper>
<ds-form *ngIf="formModel" #formRef="formComponent"
[formId]="formId"
[formModel]="formModel"
[formLayout]="formLayout"
[displaySubmit]="displaySubmit"
[displayCancel]="false"
(dfChange)="onChange($event)">
@if (formModel) {
<ds-form #formRef="formComponent"
[formId]="formId"
[formModel]="formModel"
[formLayout]="formLayout"
[displaySubmit]="displaySubmit"
[displayCancel]="false"
(dfChange)="onChange($event)">
</ds-form>
}
</div>

<ng-template #content let-c="close" let-d="dismiss">
<div class="modal-header">
<h4 class="modal-title text-danger">{{ 'submission.sections.upload.delete.confirm.title' | translate }}</h4>
<button type="button" class="close" aria-label="Close" (click)="d('cancel')">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p>{{ 'submission.sections.upload.delete.confirm.info' | translate }}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary"
(click)="c('cancel')">{{ 'submission.sections.upload.delete.confirm.cancel' | translate }}</button>
<button type="button" class="btn btn-danger"
(click)="c('ok')">{{ 'submission.sections.upload.delete.confirm.submit' | translate }}</button>
</div>
<div class="modal-header">
<h4 class="modal-title text-danger">{{ 'submission.sections.upload.delete.confirm.title' | translate }}</h4>
<button type="button" class="close" aria-label="Close" (click)="d('cancel')">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p>{{ 'submission.sections.upload.delete.confirm.info' | translate }}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" (click)="c('cancel')">{{ 'submission.sections.upload.delete.confirm.cancel' | translate }}</button>
<button type="button" class="btn btn-danger" (click)="c('ok')">{{ 'submission.sections.upload.delete.confirm.submit' | translate }}</button>
</div>
</ng-template>
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { AsyncPipe } from '@angular/common';
import { ChangeDetectorRef, Component, ElementRef, Inject, ViewChild } from '@angular/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { DynamicCheckboxModel, DynamicFormLayout, DynamicRadioGroupModel, MATCH_DISABLED } from '@ng-dynamic-forms/core';
import { TranslateService } from '@ngx-translate/core';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { BehaviorSubject, Observable, of } from 'rxjs';
import { distinctUntilChanged, filter, map, switchMap, take, tap } from 'rxjs/operators';

Expand All @@ -18,10 +19,14 @@ import { WorkspaceitemSectionLicenseObject } from '../../../../../../app/core/su
import { WorkspaceItem } from '../../../../../../app/core/submission/models/workspaceitem.model';
import { normalizeSectionData } from '../../../../../../app/core/submission/submission-response-parsing.service';
import { isNotEmpty, isNotUndefined } from '../../../../../../app/shared/empty.util';
import { ThemedFileDownloadLinkComponent } from '../../../../../../app/shared/file-download-link/themed-file-download-link.component';
import { FormBuilderService } from '../../../../../../app/shared/form/builder/form-builder.service';
import { FormComponent } from '../../../../../../app/shared/form/form.component';
import { FormService } from '../../../../../../app/shared/form/form.service';
import { NotificationsService } from '../../../../../../app/shared/notifications/notifications.service';
import { UploaderOptions } from '../../../../../../app/shared/upload/uploader/uploader-options.model';
import { UploaderComponent } from '../../../../../../app/shared/upload/uploader/uploader.component';
import { FileSizePipe } from '../../../../../../app/shared/utils/file-size-pipe';
import { followLink } from '../../../../../../app/shared/utils/follow-link-config.model';
import { SectionFormOperationsService } from '../../../../../../app/submission/sections/form/section-form-operations.service';
import { SubmissionSectionLicenseComponent as BaseComponent } from '../../../../../../app/submission/sections/license/section-license.component';
Expand All @@ -39,9 +44,19 @@ import { SECTION_LICENSE_FORM_LAYOUT } from './section-license.model';
*/
@Component({
selector: 'ds-submission-section-license',
// styleUrls: ['./section-license.component.scss'],
styleUrls: ['./section-license.component.scss'],
// styleUrls: ['../../../../../../app/submission/sections/license/section-license.component.scss'],
templateUrl: './section-license.component.html',
// templateUrl: '../../../../../../app/submission/sections/license/section-license.component.html',
imports: [
AsyncPipe,
FileSizePipe,
FormComponent,
UploaderComponent,
ThemedFileDownloadLinkComponent,
TranslateModule,
],
standalone: true,
})
@renderSectionFor(SectionsType.License, 'tamu')
export class SubmissionSectionLicenseComponent extends BaseComponent {
Expand Down