Skip to content

Commit

Permalink
um modifications.
Browse files Browse the repository at this point in the history
  • Loading branch information
blancoj committed Aug 16, 2023
1 parent 404ccd9 commit 5aa23fa
Show file tree
Hide file tree
Showing 191 changed files with 5,441 additions and 56 deletions.
1 change: 1 addition & 0 deletions docker/docker-compose-rest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ services:
environment:
PGDATA: /pgdata
image: dspace/dspace-postgres-pgcrypto
platform: linux/amd64
networks:
dspacenet:
ports:
Expand Down
6 changes: 6 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import { EndUserAgreementCurrentUserGuard } from './core/end-user-agreement/end-
import { SiteRegisterGuard } from './core/data/feature-authorization/feature-authorization-guard/site-register.guard';
import { ThemedPageNotFoundComponent } from './pagenotfound/themed-pagenotfound.component';
import { ThemedForbiddenComponent } from './forbidden/themed-forbidden.component';
//import { StaticPageComponent } from './static-page/static-page.component';

import {
GroupAdministratorGuard
} from './core/data/feature-authorization/feature-authorization-guard/group-administrator.guard';
Expand Down Expand Up @@ -72,6 +74,10 @@ import { ThemedPageErrorComponent } from './page-error/themed-page-error.compone
.then((m) => m.CommunityListPageModule),
canActivate: [EndUserAgreementCurrentUserGuard]
},


//{path:"static", component: StaticPageComponent},

{
path: 'id',
loadChildren: () => import('./lookup-by-id/lookup-by-id.module')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ <h2>{{'collection.edit.item-mapper.head' | translate}}</h2>
</div>

<div *ngIf="performedSearch">
{{'collection.edit.item-mapper.checkall-desc' | translate}}
<div class="checkbox">
<input name="checkall" type="checkbox" value="onclick=checkUncheckAll(this);" (click)="checkUncheckAll(this)">
</div>

<ds-item-select class="mt-2"
[key]="'map'"
[dsoRD$]="mappedItemsRD$"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,31 @@ export class CollectionItemMapperComponent implements OnInit {
});
}

/**
* This was a javascript function I brought over from 6.3
*/
checkUncheckAll (form) {

var defaultedElements = document.getElementsByTagName("input");

Check failure on line 291 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

Unexpected var, use let or const instead

Check failure on line 291 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

Strings must use singlequote

Check failure on line 291 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Unexpected var, use let or const instead

Check failure on line 291 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Strings must use singlequote
var mapButton = document.getElementsByClassName("item-confirm");

Check failure on line 292 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

Unexpected var, use let or const instead

Check failure on line 292 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

Strings must use singlequote

Check failure on line 292 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Unexpected var, use let or const instead

Check failure on line 292 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Strings must use singlequote
var theElement;

Check failure on line 293 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

Unexpected var, use let or const instead

Check failure on line 293 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

Trailing spaces not allowed

Check failure on line 293 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Unexpected var, use let or const instead

Check failure on line 293 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Trailing spaces not allowed
var event = new Event('change');

Check failure on line 294 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

Unexpected var, use let or const instead

Check failure on line 294 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Unexpected var, use let or const instead

for (var i=0; i != defaultedElements.length; i++){

Check failure on line 296 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

Unexpected var, use let or const instead

Check failure on line 296 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

Operator '=' must be spaced

Check failure on line 296 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

Expected '!==' and instead saw '!='

Check failure on line 296 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Unexpected var, use let or const instead

Check failure on line 296 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Operator '=' must be spaced

Check failure on line 296 in src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Expected '!==' and instead saw '!='
if ( defaultedElements[i].name == 'checkall'){
theElement = defaultedElements[i];
}
}

for (var i=0; i != defaultedElements.length; i++){
if (defaultedElements[i].type == 'checkbox'){
defaultedElements[i].checked=theElement.checked;
defaultedElements[i].setAttribute("ng-reflect-model", theElement.checked);
(mapButton[0] as HTMLButtonElement).disabled= !theElement.checked;

defaultedElements[i].dispatchEvent(event);
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { EditComColPageComponent } from '../../shared/comcol/comcol-forms/edit-c
import { Collection } from '../../core/shared/collection.model';
import { getCollectionPageRoute } from '../collection-page-routing-paths';

import { HttpClient} from '@angular/common/http';

/**
* Component that represents the page where a user can edit an existing Collection
*/
Expand All @@ -15,10 +17,11 @@ export class EditCollectionPageComponent extends EditComColPageComponent<Collect
type = 'collection';

public constructor(
protected http: HttpClient,
protected router: Router,
protected route: ActivatedRoute
) {
super(router, route);
super(http, router, route);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { ActivatedRoute, Router } from '@angular/router';
import { EditComColPageComponent } from '../../shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component';
import { getCommunityPageRoute } from '../community-page-routing-paths';

import { HttpClient} from '@angular/common/http';

/**
* Component that represents the page where a user can edit an existing Community
*/
Expand All @@ -15,10 +17,11 @@ export class EditCommunityPageComponent extends EditComColPageComponent<Communit
type = 'community';

public constructor(
protected http: HttpClient,
protected router: Router,
protected route: ActivatedRoute
) {
super(router, route);
super(http, router, route);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/app/core/core.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ import { ItemType } from './shared/item-relationships/item-type.model';
import { RelationshipType } from './shared/item-relationships/relationship-type.model';
import { Relationship } from './shared/item-relationships/relationship.model';
import { Item } from './shared/item.model';

import { License } from './shared/license.model';
import { ResourcePolicy } from './resource-policy/models/resource-policy.model';
import { SearchConfigurationService } from './shared/search/search-configuration.service';
Expand Down Expand Up @@ -318,6 +319,7 @@ export const models =
Bitstream,
BitstreamFormat,
Item,
ItemRequest,
Site,
Collection,
Community,
Expand Down
6 changes: 4 additions & 2 deletions src/app/core/data/item-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,12 @@ export abstract class BaseItemDataService extends IdentifiableDataService<Item>
* @param item
* @param withdrawn
*/
public setWithDrawn(item: Item, withdrawn: boolean): Observable<RemoteData<Item>> {

//////
public setWithDrawn(item: Item, withdrawn: boolean, reason: string): Observable<RemoteData<Item>> {

const patchOperation = {
op: 'replace', path: '/withdrawn', value: withdrawn
op: 'replace', path: '/withdrawn', value: withdrawn, reason: reason
} as Operation;
this.requestService.removeByHrefSubstring('/discover');

Expand Down
24 changes: 24 additions & 0 deletions src/app/core/metadata/metadata.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ export class MetadataService {
this.setCitationDissertationNameTag();
}

this.setRightsTag();

// this.setCitationJournalTitleTag();
// this.setCitationVolumeTag();
// this.setCitationIssueTag();
Expand Down Expand Up @@ -210,6 +212,28 @@ export class MetadataService {
this.addMetaTag('citation_title', value);
}

private setRightsTag(): void {
const value = this.getMetaTagValue('dc.rights.robot');

let rights: string
if ( value === undefined )
{
rights = "index,nofollow";
}
else
{
if ( value === "IndexNoFollow" )
{
rights = "index,nofollow";
}
if ( value === "NoIndexNoFollow" )
{
rights = "noindex,nofollow";
}
}
this.addMetaTag('rights', rights);
}

/**
* Add <meta name="citation_author" ... > to the <head>
*/
Expand Down
54 changes: 54 additions & 0 deletions src/app/footer/footer.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,59 @@ <h5 class="text-uppercase">Footer Content</h5>
</ul>
</div>
</div>




<div class="text-white">
<div class="text-white">
<section>
<h2>University of Michigan Library</h2>
<ul>
<li>
<a href="https://www.lib.umich.edu/">U-M Library</a>
</li>
<li>
<a href="https://publishing.umich.edu/">Michigan Publishing</a>
</li>
<li>
<a href="https://www.lib.umich.edu/about-us/about-library/diversity-equity-inclusion-and-accessibility/accessibility">Accessibility</a>
</li>
</ul>
</section>

<section>
<h2>About Deep Blue Documents</h2>
<ul>
<li>
<a href="https://www.lib.umich.edu/collections/deep-blue-repositories">Deep Blue Repositories</a>
</li>
<li>
<a href="info/feedback">Contact Us</a>
</li>
<li>
<a href="assets/static/about/deepbluefaq.html">Frequently Asked Questions</a>
</li>
</ul>
</section>

<section>
<h2>Privacy and copyright</h2>

<p><a href="https://lib.umich.edu/about-us/policies/library-privacy-statement">Library Privacy Statement</a></p>

<p>Works found in Deep Blue Documents are protected by copyright unless otherwise indicated.</p>
</section>
</div>
</div>
<div class="text-white">
<div class="text-white">
<p>©XXXXX Regents of the University of Michigan. Built with <a href="http://www.dspace.org/">DSpace</a></p>
</div>
</div>




<!-- Copyright -->
</footer>
13 changes: 13 additions & 0 deletions src/app/info/feedback/feedback-form/feedback-form.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ <h2>{{ 'info.feedback.head' | translate }}</h2>
<ds-error *ngIf="feedbackForm.controls.email.errors?.required" message="{{'info.feedback.error.email.required' | translate}}"></ds-error>
<ds-error *ngIf="feedbackForm.controls.email.errors?.pattern" message="{{'info.feedback.error.email.required' | translate}}"></ds-error>
</ng-container>

<div class="row">
<div class="control-group col-sm-12">
<label class="control-label" for="subject">{{ 'info.feedback.subject' | translate }}:&nbsp;</label>
<textarea id="subject" formControlName="subject" class="form-control" name="subject" cols="20" rows="1"> </textarea>
</div>
</div>
<ng-container *ngIf="feedbackForm.controls.subject.invalid && (feedbackForm.controls.subject.dirty || feedbackForm.controls.subject.touched)"
class="alert">
<ds-error *ngIf="feedbackForm.controls.subject.errors?.required" message="{{'info.feedback.error.subject.required' | translate}}"></ds-error>
</ng-container>


<div class="row">
<div class="control-group col-sm-12">
<label class="control-label" for="comments">{{ 'info.feedback.comments' | translate }}:&nbsp;</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class FeedbackFormComponent implements OnInit {
feedbackForm = this.fb.group({
email: ['', [Validators.required, Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}$')]],
message: ['', Validators.required],
subject: ['', Validators.required],
page: [''],
});

Expand Down
9 changes: 7 additions & 2 deletions src/app/item-page/alerts/item-alerts.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
<div *ngIf="item && item.isWithdrawn" class="withdrawn-warning">
<ds-alert [type]="AlertTypeEnum.Warning">
<div class="d-flex justify-content-between flex-wrap">
<span class="align-self-center">{{'item.alerts.withdrawn' | translate}}</span>
<a routerLink="/home" class="btn btn-primary btn-sm">{{"404.link.home-page" | translate}}</a>
<span *ngIf="!item.hasMetadata(['dc.description.withdrawalreason'])" class="align-self-center">{{'item.alerts.withdrawn' | translate}}</span>
<span
*ngFor="let reason of item.allMetadataValues(['dc.description.withdrawalreason']); let last=last;">
<span [innerHTML]="reason"><span [innerHTML]="reason"></span></span>
<span *ngIf="!last">; </span>
</span>
<a routerLink="/home" class="btn btn-primary btn-sm">{{"404.link.home-page" | translate}}</a>
</div>
</ds-alert>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,16 @@ <h3 class="mb-4">{{'bitstream-request-a-copy.header' | translate}}</h3>
<div class="col-12">
<label
for="message">{{'bitstream-request-a-copy.message.label' | translate}}</label>
<textarea rows="5"
[className]="'form-control'"
id="message" formControlName="message"></textarea>

<textarea rows="5" [className]="(message.invalid) && (message.dirty || message.touched) ? 'form-control is-invalid' :'form-control'"
id="message" formControlName="message"></textarea>
<div *ngIf="message.invalid && (message.dirty || message.touched)"
class="invalid-feedback show-feedback">
<span *ngIf="message.errors && message.errors.required">
{{ 'bitstream-request-a-copy.name.error' | translate }}
</span>
</div>

</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ export class BitstreamRequestACopyPageComponent implements OnInit, OnDestroy {
Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$')]
}),
allfiles: new UntypedFormControl(''),
message: new UntypedFormControl(''),
message: new UntypedFormControl('', {
validators: [Validators.required],
}),
});


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class ItemReinstateComponent extends AbstractSimpleItemActionComponent {
* Perform the reinstate action to the item
*/
performAction() {
this.itemDataService.setWithDrawn(this.item, false).pipe(getFirstCompletedRemoteData()).subscribe(
this.itemDataService.setWithDrawn(this.item, false, "").pipe(getFirstCompletedRemoteData()).subscribe(
(response: RemoteData<Item>) => {
this.processRestResponse(response);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
*/
export class ItemWithdrawComponent extends AbstractSimpleItemActionComponent {

protected withdrawReason = "nothing"

protected messageKey = 'withdraw';
protected predicate = (rd: RemoteData<Item>) => rd.payload.isWithdrawn;

Expand All @@ -34,7 +36,9 @@ export class ItemWithdrawComponent extends AbstractSimpleItemActionComponent {
* Perform the withdraw action to the item
*/
performAction() {
this.itemDataService.setWithDrawn(this.item, true).pipe(getFirstCompletedRemoteData()).subscribe(
var reason:string = (document.getElementById("withdrawReason") as HTMLInputElement).value
console.log("The reason = " + reason)
this.itemDataService.setWithDrawn(this.item, true, reason).pipe(getFirstCompletedRemoteData()).subscribe(
(response: RemoteData<Item>) => {
this.processRestResponse(response);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ <h2>{{headerMessage | translate: {id: item.handle} }}</h2>
<p>{{descriptionMessage | translate}}</p>
<ds-modify-item-overview [item]="item"></ds-modify-item-overview>
<div class="space-children-mr">

<div *ngIf="!item.isWithdrawn ">
<div>
<label>Withdrawal Reason:&nbsp;</label>
<select id="withdrawReason">
<option value="Removed from view by legal order.">Removed from view by legal order.</option>
<option value="Removed from view by the University.">Removed from view by the University.</option>
<option value="Removed from view at request of the author.">Removed from view at request of the author.</option>
</select>
</div>
<p></p>
</div>

<button (click)="performAction()" class="btn btn-outline-secondary perform-action">{{confirmMessage | translate}}
</button>
<button [routerLink]="[itemPageRoute, 'edit']" class="btn btn-outline-secondary cancel">
Expand Down
Loading

0 comments on commit 5aa23fa

Please sign in to comment.