Skip to content

Commit

Permalink
Merge pull request #450 from UoA-eResearch/rc2.8.7
Browse files Browse the repository at this point in the history
Rc2.8.7
  • Loading branch information
cakr322 authored Mar 7, 2024
2 parents 4c0a48e + 96cd605 commit c651198
Show file tree
Hide file tree
Showing 31 changed files with 51 additions and 38 deletions.
2 changes: 1 addition & 1 deletion cer-graphql/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cer-graphql",
"version": "2.8.6",
"version": "2.8.7",
"description": "A GraphQL server used to proxy and authorise requests to external data sources.",
"main": "build/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion hub-search-proxy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hub-search-proxy",
"version": "2.8.6",
"version": "2.8.7",
"description": "Serverless Framework Lambda functions to interact with AWS ElasticSearch Service.",
"main": "handler.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion research-hub-web/cypress/integration/equipment.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('ResearchHubs Equipment Pages', () => {
}
});

cy.visit('equipment/operetta-high-content-imaging-system');
cy.visit('infrastructure/operetta-high-content-imaging-system');

cy.wait('@gqlGetEquipmentBySlug');
});
Expand Down
2 changes: 1 addition & 1 deletion research-hub-web/cypress/integration/routing.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe("ResearchHubs legacy routing", () => {
describe("ResearchHubs SSO protected content", () => {

it('visiting an SSO protected item redirects to SSO login page', () => {
cy.visit('/subhub/internal-funding');
cy.visit('/article/contracts-and-clauses');
cy.location('pathname').should('include', '/profile/SAML2/Redirect/SSO');
});
});
2 changes: 1 addition & 1 deletion research-hub-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "research-hub-web",
"version": "2.8.6",
"version": "2.8.7",
"license": "MIT",
"scripts": {
"ng": "ng",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ <h3 *ngIf="relatedOrgs.length > 0">
fxFlexOrder="3"
>
<h3>
Explore Related
Explore related
<hr />
</h3>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ <h3 *ngIf="relatedOrgs.length > 0">
fxFlexOrder="3"
>
<h3>
Explore Related
Explore related
<hr />
</h3>
<div
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<mat-card
[routerLink]="['/', contentItem.__typename!.toLowerCase(), contentItem.slug]"
[routerLink]="['/', (contentItem.__typename!.toLowerCase() === 'equipment' ? 'infrastructure' : contentItem.__typename!.toLowerCase()) , contentItem.slug]"
[ngClass]="{ 'subhub-child-card': isSubhubChild }"
>
<picture mat-card-image>
Expand All @@ -17,7 +17,7 @@
tabindex="-1"
[routerLink]="[
'/',
contentItem.__typename!.toLowerCase(),
(contentItem.__typename!.toLowerCase() === 'equipment' ? 'infrastructure' : contentItem.__typename!.toLowerCase()),
contentItem.slug
]"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ <h3 *ngIf="relatedOrgs.length > 0">
fxFlexOrder="3"
>
<h3>
Explore Related
Explore related
<hr />
</h3>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2>Selected Entry</h2>
<a
mat-icon-button
color="primary"
[routerLink]="['/', node.type.toLowerCase(), node.slug]"
[routerLink]="['/', (node.type.toLowerCase() === 'equipment' ? 'infrastructure' : node.type.toLowerCase()), node.slug]"
matTooltip="Visit page in ResearchHub"
>
<mat-icon>article</mat-icon>
Expand Down Expand Up @@ -56,7 +56,7 @@ <h2>Selected Entry</h2>
<a
mat-icon-button
color="primary"
[routerLink]="['/', neighbour.type.toLowerCase(), neighbour.slug]"
[routerLink]="['/', (neighbour.type.toLowerCase() === 'equipment' ? 'infrastructure' : neighbour.type.toLowerCase()), neighbour.slug]"
matTooltip="Visit page in ResearchHub"
>
<mat-icon>article</mat-icon>
Expand Down Expand Up @@ -98,7 +98,7 @@ <h2>Selected Entry</h2>
<a
mat-icon-button
color="primary"
[routerLink]="['/', neighbour.type.toLowerCase(), neighbour.slug]"
[routerLink]="['/', (neighbour.type.toLowerCase() === 'equipment' ? 'infrastructure' : neighbour.type.toLowerCase()), neighbour.slug]"
matTooltip="Visit page in ResearchHub"
>
<mat-icon>article</mat-icon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { map } from 'rxjs/operators';
})
export class EquipmentListComponent implements OnInit, OnDestroy {
public equipment: EquipmentCollection;
public title: string = 'Equipment Collection';
public title: string = 'Infrastructure Collection';

private subscription = new Subscription();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
fxLayout="column"
>
<h3 *ngIf="relatedItems.length > 0">
Explore Related
Explore related
<hr />
</h3>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,21 @@ export class ErrorRoutingModule extends UoaErrorsConfig {

this.ErrorPageContent['ErrorCode403'] = {
title: 'Access Restricted',
content: `<p>Sorry, You do not have permission to view this page. Please ensure that you are logged in and try again.</p>
content: `<p>This page is restricted.</p>
<p>
If you still do not have access and believe you are seeing this page in error, please contact
<a href=mailto:${this.contactEmail} target="_blank">${this.contactEmail}</a>.
We apologize, but you currently lack the necessary permissions to view this page.
To gain access to this content, kindly retry and ensure that you are logged in
using your University email address (or UPI) along with the corresponding password.
</p>
<p>
Please be aware that content secured behind Single Sign-On (SSO) is exclusively
available to University of Auckland staff and PhD students. Masters students,
under-graduates, collaborating District Health Boards (DHBs),
and the public are not able to access content protected by SSO.
</p>
<p>
<a href="/article/get-access-to-researchhub">
Learn more about SSO and accessing ResearchHub content via the ‘Get access to ResearchHub’ page</a>
</p>`
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<!-- Related -->
<div class="event-owners section" fxLayout="column">
<h3 *ngIf="relatedItems.length > 0">
Explore Related
Explore related
<hr />
</h3>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ <h3>
<!-- Related -->
<div class="funding-owners section" fxLayout="column">
<h3 *ngIf="relatedItems.length > 0">
Explore Related
Explore related
<hr />
</h3>
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="25px">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@
>
{{
activeFilters.stage.length === 1
? activeFilters.stage.length + " activity"
: activeFilters.stage.length + " activities"
? activeFilters.stage.length + " stage"
: activeFilters.stage.length + " stages"
}}
<mat-icon matChipRemove>cancel</mat-icon>
</mat-chip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<ng-container *ngIf="activeFilters.stage.length > 0">
<b>{{ activeFilters.stage.length }}</b>
{{ activeFilters.stage.length === 1 ? "activity" : "activities" }}
{{ activeFilters.stage.length === 1 ? "stage" : "stages" }}
</ng-container>

<ng-container *ngIf="activeFilters.relatedOrgs.length > 0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
role="listitem"
(keydown.enter)="navigate(result.contentType, result.slug)"
>
<a class="search-link" [routerLink]="['/', result.contentType.toLowerCase(), result.slug]"></a>
<a class="search-link" [routerLink]="['/', (result.contentType.toLowerCase() === 'equipment' ? 'infrastructure' : result.contentType.toLowerCase()), result.slug]"></a>

<span class="card-label">{{
result.contentType | contentTypeDisplayName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
fxLayout="column"
>
<h3 *ngIf="relatedItems.length > 0">
Explore Related
Explore related
<hr />
</h3>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ <h3>{{ contentItem.name }}</h3>
<a
[routerLink]="
'/' +
contentItem['__typename'].toLowerCase() +
(contentItem['__typename'].toLowerCase() === 'equipment' ? 'infrastructure' : contentItem['__typename'].toLowerCase()) +
'/' +
contentItem['slug']
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class BlocksEmbeddedEntryComponent extends NodeRenderer implements OnInit
ngOnInit(): void {
try {
this.contentItem = this.bodyMediaService.getContentItem(this.node);
console.log(this.contentItem['__typename'].toLowerCase() === 'equipment' ? 'infrastructure' : this.contentItem['__typename'].toLowerCase())
} catch(e) {
console.error(e);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Entry Inline -->
<span *ngIf="contentItem">
<span>
<a class="embedded-entry-inline" [routerLink]="'/' + contentItem['__typename'].toLowerCase() + '/' + contentItem['slug']">
<a class="embedded-entry-inline" [routerLink]="'/' + (contentItem['__typename'].toLowerCase() === 'equipment' ? 'infrastructure' : contentItem['__typename'].toLowerCase()) + '/' + contentItem['slug']">
{{ contentItem.title }}
</a>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<span *ngIf="contentItem">
<span>
<a
[routerLink]="['/', contentItem.__typename.toLowerCase(), contentItem.slug]"
[routerLink]="['/', (contentItem.__typename.toLowerCase() === 'equipment' ? 'infrastructure' : contentItem.__typename.toLowerCase()), contentItem.slug]"
>
<b>{{ data.content[0].value }}</b>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
<ng-container *ngIf="collection">
<!-- Content Collection -->
<h1 id="title">
{{ collection.__typename | humanCase }}
{{ (collection.__typename === 'EquipmentCollection' ? 'InfrastructureCollection' : collection.__typename) | humanCase }}
</h1>
Found
<span class="search-results-text">
{{ collection.items.length }} </span
>results in
<span class="search-results-text">
{{ collection.__typename | humanCase }}
{{ (collection.__typename === 'EquipmentCollection' ? 'InfrastructureCollection' : collection.__typename) | humanCase }}
</span>

<!-- Content Collection -->
<mat-nav-list>
<mat-card *ngFor="let content of collection.items">
<a
[routerLink]="['/' + content.__typename.toLowerCase(), content.slug]"
[routerLink]="['/' + (content.__typename.toLowerCase() === 'equipment' ? 'infrastructure' : content.__typename.toLowerCase()), content.slug]"
class="result-item"
[ngClass]="{ ssoProtected: content.ssoProtected }"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class CollectionListComponent implements OnChanges {
constructor() { }

ngOnChanges(changes: SimpleChanges) {
try { this.collection = changes['collection'].currentValue; this.loading = false } catch { }
try { this.collection = changes['collection'].currentValue; this.loading = false; console.log(this.collection.__typename) } catch { }
}

// Scrolling to top of page on page change
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
fxLayout="column"
>
<h3 *ngIf="relatedItems.length > 0">
Explore Related
Explore related
<hr />
</h3>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
fxLayout="column"
>
<h3 *ngIf="relatedItems.length > 0">
Explore Related
Explore related
<hr />
</h3>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('ContentTypeDisplayNamePipe', () => {
it('Should return correct content display names', () => {
expect(pipe.transform('article')).toBe('Article');
expect(pipe.transform('caseStudy')).toBe('Case Study');
expect(pipe.transform('equipment')).toBe('Equipment');
expect(pipe.transform('equipment')).toBe('Infrastructure');
expect(pipe.transform('event')).toBe('Event');
expect(pipe.transform('funding')).toBe('Funding');
expect(pipe.transform('service')).toBe('Service');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const ContentTypeDisplayNames = {
'article': 'Article',
'capability': 'Capability',
'casestudy': 'Case Study',
'equipment': 'Equipment',
'equipment': 'Infrastructure',
'event': 'Event',
'funding': 'Funding',
'service': 'Service',
Expand Down
2 changes: 1 addition & 1 deletion research-hub-web/src/app/routing/routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const appRoutes: Routes = [
loadChildren: () => import('@components/activities-page/activities-page.module').then((m) => m.ActivitiesPageModule),
},
{
path: 'equipment',
path: 'infrastructure',
loadChildren: () => import('@components/equipments/equipments.module').then(m => m.EquipmentsModule)
},
{
Expand Down
3 changes: 2 additions & 1 deletion research-hub-web/src/app/services/search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export class SearchService {
summary: summary,
slug: element._source.fields.slug["en-US"],
ssoProtected: element._source.fields.ssoProtected["en-US"],
contentType: element._source.sys.contentType.sys.id,
contentType: element._source.sys.contentType.sys.id == 'equipment' ?
'infrastructure' : element._source.sys.contentType.sys.id,
chips: element._source.fields.category?.["en-US"].map(x => {
return { name: x.name, id: x.sys.id };
})
Expand Down

0 comments on commit c651198

Please sign in to comment.