Skip to content

Commit

Permalink
Merge 0252675 into b384a94
Browse files Browse the repository at this point in the history
  • Loading branch information
Atmire-Kristof committed Mar 25, 2020
2 parents b384a94 + 0252675 commit 8770c77
Show file tree
Hide file tree
Showing 79 changed files with 4,837 additions and 175 deletions.
137 changes: 133 additions & 4 deletions resources/i18n/en.json5
Expand Up @@ -268,6 +268,42 @@



"bitstream.edit.bitstream": "Bitstream: ",

"bitstream.edit.form.description.hint": "Optionally, provide a brief description of the file, for example \"<i>Main article</i>\" or \"<i>Experiment data readings</i>\".",

"bitstream.edit.form.description.label": "Description",

"bitstream.edit.form.embargo.hint": "The first day from which access is allowed. <b>This date cannot be modified on this form.</b> To set an embargo date for a bitstream, go to the <i>Item Status</i> tab, click <i>Authorizations...</i>, create or edit the bitstream's <i>READ</i> policy, and set the <i>Start Date</i> as desired.",

"bitstream.edit.form.embargo.label": "Embargo until specific date",

"bitstream.edit.form.fileName.hint": "Change the filename for the bitstream. Note that this will change the display bitstream URL, but old links will still resolve as long as the sequence ID does not change.",

"bitstream.edit.form.fileName.label": "Filename",

"bitstream.edit.form.newFormat.label": "Describe new format",

"bitstream.edit.form.newFormat.hint": "The application you used to create the file, and the version number (for example, \"<i>ACMESoft SuperApp version 1.5</i>\").",

"bitstream.edit.form.primaryBitstream.label": "Primary bitstream",

"bitstream.edit.form.selectedFormat.hint": "If the format is not in the above list, <b>select \"format not in list\" above</b> and describe it under \"Describe new format\".",

"bitstream.edit.form.selectedFormat.label": "Selected Format",

"bitstream.edit.form.selectedFormat.unknown": "Format not in list",

"bitstream.edit.notifications.error.format.title": "An error occurred saving the bitstream's format",

"bitstream.edit.notifications.saved.content": "Your changes to this bitstream were saved.",

"bitstream.edit.notifications.saved.title": "Bitstream saved",

"bitstream.edit.title": "Edit bitstream",



"browse.comcol.by.author": "By Author",

"browse.comcol.by.dateissued": "By Issue Date",
Expand Down Expand Up @@ -638,6 +674,8 @@



"error.bitstream": "Error fetching bitstream",

"error.browse-by": "Error fetching items",

"error.collection": "Error fetching collection",
Expand Down Expand Up @@ -745,6 +783,93 @@




"item.bitstreams.upload.bundle": "Bundle",

"item.bitstreams.upload.bundle.placeholder": "Select a bundle",

"item.bitstreams.upload.bundle.new": "Create bundle",

"item.bitstreams.upload.bundles.empty": "This item doesn\'t contain any bundles to upload a bitstream to.",

"item.bitstreams.upload.cancel": "Cancel",

"item.bitstreams.upload.drop-message": "Drop a file to upload",

"item.bitstreams.upload.item": "Item: ",

"item.bitstreams.upload.notifications.bundle.created.content": "Successfully created new bundle.",

"item.bitstreams.upload.notifications.bundle.created.title": "Created bundle",

"item.bitstreams.upload.notifications.upload.failed": "Upload failed. Please verify the content before retrying.",

"item.bitstreams.upload.title": "Upload bitstream",



"item.edit.bitstreams.bundle.edit.buttons.upload": "Upload",

"item.edit.bitstreams.bundle.displaying": "Currently displaying {{ amount }} bitstreams of {{ total }}.",

"item.edit.bitstreams.bundle.load.all": "Load all ({{ total }})",

"item.edit.bitstreams.bundle.load.more": "Load more",

"item.edit.bitstreams.bundle.name": "BUNDLE: {{ name }}",

"item.edit.bitstreams.discard-button": "Discard",

"item.edit.bitstreams.edit.buttons.download": "Download",

"item.edit.bitstreams.edit.buttons.drag": "Drag",

"item.edit.bitstreams.edit.buttons.edit": "Edit",

"item.edit.bitstreams.edit.buttons.remove": "Remove",

"item.edit.bitstreams.edit.buttons.undo": "Undo changes",

"item.edit.bitstreams.empty": "This item doesn't contain any bitstreams. Click the upload button to create one.",

"item.edit.bitstreams.headers.actions": "Actions",

"item.edit.bitstreams.headers.bundle": "Bundle",

"item.edit.bitstreams.headers.description": "Description",

"item.edit.bitstreams.headers.format": "Format",

"item.edit.bitstreams.headers.name": "Name",

"item.edit.bitstreams.notifications.discarded.content": "Your changes were discarded. To reinstate your changes click the 'Undo' button",

"item.edit.bitstreams.notifications.discarded.title": "Changes discarded",

"item.edit.bitstreams.notifications.move.failed.title": "Error moving bitstreams",

"item.edit.bitstreams.notifications.move.saved.content": "Your move changes to this item's bitstreams and bundles have been saved.",

"item.edit.bitstreams.notifications.move.saved.title": "Move changes saved",

"item.edit.bitstreams.notifications.outdated.content": "The item you're currently working on has been changed by another user. Your current changes are discarded to prevent conflicts",

"item.edit.bitstreams.notifications.outdated.title": "Changes outdated",

"item.edit.bitstreams.notifications.remove.failed.title": "Error deleting bitstream",

"item.edit.bitstreams.notifications.remove.saved.content": "Your removal changes to this item's bitstreams have been saved.",

"item.edit.bitstreams.notifications.remove.saved.title": "Removal changes saved",

"item.edit.bitstreams.reinstate-button": "Undo",

"item.edit.bitstreams.save-button": "Save",

"item.edit.bitstreams.upload-button": "Upload",



"item.edit.delete.cancel": "Cancel",

"item.edit.delete.confirm": "Delete",
Expand Down Expand Up @@ -943,19 +1068,19 @@



"item.edit.tabs.bitstreams.head": "Item Bitstreams",
"item.edit.tabs.bitstreams.head": "Bitstreams",

"item.edit.tabs.bitstreams.title": "Item Edit - Bitstreams",

"item.edit.tabs.curate.head": "Curate",

"item.edit.tabs.curate.title": "Item Edit - Curate",

"item.edit.tabs.metadata.head": "Item Metadata",
"item.edit.tabs.metadata.head": "Metadata",

"item.edit.tabs.metadata.title": "Item Edit - Metadata",

"item.edit.tabs.relationships.head": "Item Relationships",
"item.edit.tabs.relationships.head": "Relationships",

"item.edit.tabs.relationships.title": "Item Edit - Relationships",

Expand Down Expand Up @@ -993,7 +1118,7 @@

"item.edit.tabs.status.description": "Welcome to the item management page. From here you can withdraw, reinstate, move or delete the item. You may also update or add new metadata / bitstreams on the other tabs.",

"item.edit.tabs.status.head": "Item Status",
"item.edit.tabs.status.head": "Status",

"item.edit.tabs.status.labels.handle": "Handle",

Expand Down Expand Up @@ -1162,6 +1287,10 @@



"loading.bitstream": "Loading bitstream...",

"loading.bitstreams": "Loading bitstreams...",

"loading.browse-by": "Loading items...",

"loading.browse-by-page": "Loading page...",
Expand Down
30 changes: 30 additions & 0 deletions src/app/+bitstream-page/bitstream-page-routing.module.ts
@@ -0,0 +1,30 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { EditBitstreamPageComponent } from './edit-bitstream-page/edit-bitstream-page.component';
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { BitstreamPageResolver } from './bitstream-page.resolver';

const EDIT_BITSTREAM_PATH = ':id/edit';

/**
* Routing module to help navigate Bitstream pages
*/
@NgModule({
imports: [
RouterModule.forChild([
{
path: EDIT_BITSTREAM_PATH,
component: EditBitstreamPageComponent,
resolve: {
bitstream: BitstreamPageResolver
},
canActivate: [AuthenticatedGuard]
}
])
],
providers: [
BitstreamPageResolver,
]
})
export class BitstreamPageRoutingModule {
}
21 changes: 21 additions & 0 deletions src/app/+bitstream-page/bitstream-page.module.ts
@@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SharedModule } from '../shared/shared.module';
import { EditBitstreamPageComponent } from './edit-bitstream-page/edit-bitstream-page.component';
import { BitstreamPageRoutingModule } from './bitstream-page-routing.module';

/**
* This module handles all components that are necessary for Bitstream related pages
*/
@NgModule({
imports: [
CommonModule,
SharedModule,
BitstreamPageRoutingModule
],
declarations: [
EditBitstreamPageComponent
]
})
export class BitstreamPageModule {
}
31 changes: 31 additions & 0 deletions src/app/+bitstream-page/bitstream-page.resolver.ts
@@ -0,0 +1,31 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { RemoteData } from '../core/data/remote-data';
import { Observable } from 'rxjs/internal/Observable';
import { find } from 'rxjs/operators';
import { hasValue } from '../shared/empty.util';
import { Bitstream } from '../core/shared/bitstream.model';
import { BitstreamDataService } from '../core/data/bitstream-data.service';

/**
* This class represents a resolver that requests a specific bitstream before the route is activated
*/
@Injectable()
export class BitstreamPageResolver implements Resolve<RemoteData<Bitstream>> {
constructor(private bitstreamService: BitstreamDataService) {
}

/**
* Method for resolving a bitstream based on the parameters in the current route
* @param {ActivatedRouteSnapshot} route The current ActivatedRouteSnapshot
* @param {RouterStateSnapshot} state The current RouterStateSnapshot
* @returns Observable<<RemoteData<Item>> Emits the found bitstream based on the parameters in the current route,
* or an error if something went wrong
*/
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<RemoteData<Bitstream>> {
return this.bitstreamService.findById(route.params.id)
.pipe(
find((RD) => hasValue(RD.error) || RD.hasSucceeded),
);
}
}
@@ -0,0 +1,29 @@
<ng-container *ngVar="(bitstreamRD$ | async) as bitstreamRD">
<div class="container" *ngVar="(bitstreamFormatsRD$ | async) as formatsRD">
<div class="row" *ngIf="bitstreamRD?.hasSucceeded && formatsRD?.hasSucceeded">
<div class="col-md-2">
<ds-thumbnail [thumbnail]="bitstreamRD?.payload"></ds-thumbnail>
</div>
<div class="col-md-10">
<div class="container">
<div class="row">
<div class="col-12">
<h3>{{bitstreamRD?.payload?.name}} <span class="text-muted">({{bitstreamRD?.payload?.sizeBytes | dsFileSize}})</span></h3>
</div>
</div>
</div>
<ds-form [formId]="'edit-bitstream-form-id'"
[formGroup]="formGroup"
[formModel]="formModel"
[formLayout]="formLayout"
[submitLabel]="'form.save'"
(submitForm)="onSubmit()"
(cancel)="onCancel()"
(dfChange)="onChange($event)"></ds-form>
</div>
</div>
<ds-error *ngIf="bitstreamRD?.hasFailed" message="{{'error.bitstream' | translate}}"></ds-error>
<ds-loading *ngIf="!bitstreamRD || !formatsRD || bitstreamRD?.isLoading || formatsRD?.isLoading"
message="{{'loading.bitstream' | translate}}"></ds-loading>
</div>
</ng-container>
@@ -0,0 +1,8 @@
:host {
::ng-deep {
.switch {
position: absolute;
top: $spacer*2.5;
}
}
}

0 comments on commit 8770c77

Please sign in to comment.