Skip to content

Commit

Permalink
Merge branch 'dspace-7.6-sistedes' into dspace-7.6.1-sistedes
Browse files Browse the repository at this point in the history
  • Loading branch information
abelgomez committed Nov 17, 2023
2 parents d8ed267 + 1da1476 commit f039ffb
Show file tree
Hide file tree
Showing 292 changed files with 4,286 additions and 6 deletions.
5 changes: 5 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
"input": "src/themes/dspace/styles/theme.scss",
"inject": false,
"bundleName": "dspace-theme"
},
{
"input": "src/themes/sistedes/styles/theme.scss",
"inject": false,
"bundleName": "sistedes-theme"
}
],
"scripts": [],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"config:watch": "nodemon",
"test:rest": "ts-node --project ./tsconfig.ts-node.json scripts/test-rest.ts",
"start": "yarn run start:prod",
"start:dev": "nodemon --exec \"cross-env NODE_ENV=development yarn run serve\"",
"start:dev": "nodemon --exec \"cross-env NODE_OPTIONS='--max-old-space-size=4096' NODE_ENV=development yarn run serve\"",
"start:prod": "yarn run build:prod && cross-env NODE_ENV=production yarn run serve:ssr",
"start:mirador:prod": "yarn run build:mirador && yarn run start:prod",
"preserve": "yarn base-href",
Expand Down
21 changes: 19 additions & 2 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ import { ServerCheckGuard } from './core/server-check/server-check.guard';
import { MenuResolver } from './menu.resolver';
import { ThemedPageErrorComponent } from './page-error/themed-page-error.component';

// BEGIN: Sistedes
import { SistedesRoutingModule } from 'src/themes/sistedes/app/sistedes-routing.module';
import { SistedesMenuResolver } from 'src/themes/sistedes/app/sistedes-menu.resolver';
// END: Sistedes

@NgModule({
imports: [
RouterModule.forRoot([
Expand All @@ -50,8 +55,17 @@ import { ThemedPageErrorComponent } from './page-error/themed-page-error.compone
path: '',
canActivate: [AuthBlockingGuard],
canActivateChild: [ServerCheckGuard],
resolve: [MenuResolver],
children: [
resolve: [MenuResolver,
// BEGIN: Sistedes
SistedesMenuResolver
// END: Sistedes
],
children:

Check failure on line 63 in src/app/app-routing.module.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

Trailing spaces not allowed

Check failure on line 63 in src/app/app-routing.module.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Trailing spaces not allowed
// BEGIN: Sistedes
SistedesRoutingModule.ROUTES.concat(
// BEWARE!! There's also a closing parenthesis at the end of this file
// END: Sistedes
[
{ path: '', redirectTo: '/home', pathMatch: 'full' },
{
path: 'reload/:rnd',
Expand Down Expand Up @@ -239,6 +253,9 @@ import { ThemedPageErrorComponent } from './page-error/themed-page-error.compone
},
{ path: '**', pathMatch: 'full', component: ThemedPageNotFoundComponent },
]
// BEGIN: Sistedes
)
// END: Sistedes
}
], {
// enableTracing: true,
Expand Down
24 changes: 24 additions & 0 deletions src/app/collection-page/collection-form/collection-form.models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,30 @@ export const collectionFormModels: DynamicFormControlModel[] = [
required: 'Please enter a name for this title'
},
}),
// BEGIN: Sistedes
new DynamicInputModel({
id: 'sistedesid',
name: 'dc.identifier.sistedes',
required: true,
validators: {
required: null
},
errorMessages: {
required: 'Please enter a Sistedes identifier for this collection'
},
}),
new DynamicInputModel({
id: 'date-issued',
name: 'dc.date.issued',
required: true,
validators: {
required: null
},
errorMessages: {
required: 'Please enter a creation date for this community'
},
}),
// END: Sistedes
new DynamicTextAreaModel({
id: 'description',
name: 'dc.description',
Expand Down
24 changes: 24 additions & 0 deletions src/app/community-page/community-form/community-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,30 @@ export class CommunityFormComponent extends ComColFormComponent<Community> imple
required: 'Please enter a name for this title'
},
}),
// BEGIN: Sistedes
new DynamicInputModel({
id: 'sistedesid',
name: 'dc.identifier.sistedes',
required: true,
validators: {
required: null
},
errorMessages: {
required: 'Please enter a Sistedes identifier for this community'
},
}),
new DynamicInputModel({
id: 'date-issued',
name: 'dc.date.issued',
required: true,
validators: {
required: null
},
errorMessages: {
required: 'Please enter a creation date for this community'
},
}),
// END: Sistedes
new DynamicTextAreaModel({
id: 'description',
name: 'dc.description',
Expand Down
30 changes: 29 additions & 1 deletion src/app/core/breadcrumbs/dso-name.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ export class DSONameService {
* With only two exceptions those solutions seem overkill for now.
*/
private readonly factories = {
// BEGIN: Sistedes
Autor: (dso: DSpaceObject): string => {
const familyName = dso.firstMetadataValue('person.familyName');
const givenName = dso.firstMetadataValue('person.givenName');
if (isEmpty(familyName) && isEmpty(givenName)) {
return dso.firstMetadataValue('dc.title') || this.translateService.instant('dso.name.unnamed');
} else if (isEmpty(familyName) || isEmpty(givenName)) {
return familyName || givenName;
} else {
return `${familyName}, ${givenName}`;
}
},
// END: Sistedes
EPerson: (dso: DSpaceObject): string => {
const firstName = dso.firstMetadataValue('eperson.firstname');
const lastName = dso.firstMetadataValue('eperson.lastname');
Expand Down Expand Up @@ -95,7 +108,11 @@ export class DSONameService {
const types = dso.getRenderTypes();
const entityType = types
.filter((type) => typeof type === 'string')
.find((type: string) => (['Person', 'OrgUnit']).includes(type)) as string;
.find((type: string) => ([
// BEGIN: Sistedes
'Autor',
// END: Sistedes
'Person', 'OrgUnit']).includes(type)) as string;
if (entityType === 'Person') {
const familyName = this.firstMetadataValue(object, dso, 'person.familyName');
const givenName = this.firstMetadataValue(object, dso, 'person.givenName');
Expand All @@ -105,6 +122,17 @@ export class DSONameService {
return familyName || givenName;
}
return `${familyName}, ${givenName}`;
// BEGIN: Sistedes
} else if (entityType === 'Autor') {
const familyName = this.firstMetadataValue(object, dso, 'person.familyName');
const givenName = this.firstMetadataValue(object, dso, 'person.givenName');
if (isEmpty(familyName) && isEmpty(givenName)) {
return this.firstMetadataValue(object, dso, 'dc.title') || dso.name;
} else if (isEmpty(familyName) || isEmpty(givenName)) {
return familyName || givenName;
}
return `${familyName}, ${givenName}`;
// END: Sistedes
} else if (entityType === 'OrgUnit') {
return this.firstMetadataValue(object, dso, 'organization.legalName');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
} }}
</span>
</span>
<span>{{(systemWideAlert$ |async)?.message}}</span>
<!-- BEGIN: Sistedes -->
<span [innerHTML]="(systemWideAlert$ |async)?.message"></span>
<!-- END: Sistedes -->
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ <h2 id="header">{{'system-wide-alert.form.header' | translate}}</h2>
} }}
</span>
</span>
<span>{{formMessage.value}}</span>
<!-- BEGIN: Sistedes -->
<span [innerHTML]="formMessage.value"></span>
<!-- END: Sistedes -->
</div>
</div>

Expand Down
7 changes: 7 additions & 0 deletions src/config/app-config.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ import { MarkdownConfig } from './markdown-config.interface';
import { FilterVocabularyConfig } from './filter-vocabulary-config';
import { DiscoverySortConfig } from './discovery-sort.config';

// BEGIN: Sistedes
import { SistedesConfig } from 'src/themes/sistedes/sistedes-config.interface';
// END: Sistedes

interface AppConfig extends Config {
ui: UIServerConfig;
rest: ServerConfig;
Expand All @@ -48,6 +52,9 @@ interface AppConfig extends Config {
markdown: MarkdownConfig;
vocabularies: FilterVocabularyConfig[];
comcolSelectionSort: DiscoverySortConfig;
// BEGIN: Sistedes
sistedes: SistedesConfig;
// END: Sistedes
}

/**
Expand Down
17 changes: 17 additions & 0 deletions src/config/default-app-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ import { MarkdownConfig } from './markdown-config.interface';
import { FilterVocabularyConfig } from './filter-vocabulary-config';
import { DiscoverySortConfig } from './discovery-sort.config';

// BEGIN: Sistedes
import { SistedesConfig } from 'src/themes/sistedes/sistedes-config.interface';
// END: Sistedes

export class DefaultAppConfig implements AppConfig {
production = false;

Expand Down Expand Up @@ -434,4 +438,17 @@ export class DefaultAppConfig implements AppConfig {
sortField:'dc.title',
sortDirection:'ASC',
};

// BEGIN: Sistedes
sistedes: SistedesConfig = {
highlightedCommunities: {
// The number of items showing in highlighted communities components
pageSize:5,
// sort record of highlighted submissions
sortField: 'dc.title',
// Show communities whose title contains the current year
query: 'dc.title:' + new Date().getFullYear(),

Check failure on line 450 in src/config/default-app-config.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

Trailing spaces not allowed

Check failure on line 450 in src/config/default-app-config.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Trailing spaces not allowed
},
};
// END: Sistedes
}
2 changes: 2 additions & 0 deletions src/themes/eager-themes.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { NgModule } from '@angular/core';
import { EagerThemeModule as DSpaceEagerThemeModule } from './dspace/eager-theme.module';
import { SistedesEagerThemeModule } from './sistedes/eager-theme.module';
// import { EagerThemeModule as CustomEagerThemeModule } from './custom/eager-theme.module';

/**
Expand All @@ -13,6 +14,7 @@ import { EagerThemeModule as DSpaceEagerThemeModule } from './dspace/eager-theme
imports: [
DSpaceEagerThemeModule,
// CustomEagerThemeModule,
SistedesEagerThemeModule
],
})
export class EagerThemesModule {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<nav class="navbar navbar-dark p-0"
[ngClass]="{'active': sidebarOpen, 'inactive': sidebarClosed}"
[@slideSidebar]="{
value: (!(sidebarExpanded | async) ? 'collapsed' : 'expanded'),
params: {sidebarWidth: (sidebarWidth | async)}
}" (@slideSidebar.done)="finishSlide($event)" (@slideSidebar.start)="startSlide($event)"
*ngIf="menuVisible | async"
(mouseenter)="handleMouseEnter($event)"
(mouseleave)="handleMouseLeave($event)"
role="navigation" [attr.aria-label]="'menu.header.admin.description' |translate">
<div class="sidebar-top-level-items">
<ul class="navbar-nav">
<li class="admin-menu-header">
<div class="sidebar-section">
<div href="javascript:void(0);" class="nav-item d-flex flex-row flex-nowrap py-0">
<div class="shortcut-icon navbar-brand logo-wrapper">
<img class="admin-logo" src="assets/sistedes/images/logos/sistedes.png"
[alt]="('menu.header.image.logo') | translate">
</div>
<div class="sidebar-collapsible navbar-brand">
<div class="mr-0">
<h4 class="section-header-text mb-0">{{ 'menu.header.admin' | translate }}</h4>
</div>
</div>
</div>
</div>
</li>

<ng-container *ngFor="let section of (sections | async)">
<ng-container
*ngComponentOutlet="(sectionMap$ | async).get(section.id).component; injector: (sectionMap$ | async).get(section.id).injector;"></ng-container>
</ng-container>
</ul>
</div>
<div class="navbar-nav">
<div class="sidebar-section" id="sidebar-collapse-toggle">
<a class="nav-item nav-link sidebar-section d-flex flex-row flex-nowrap"
href="javascript:void(0);"
(click)="toggle($event)"
(keyup.space)="toggle($event)"
>
<div class="shortcut-icon">
<i *ngIf="(menuCollapsed | async)" class="fas fa-fw fa-angle-double-right"
[title]="'menu.section.icon.pin' | translate"></i>
<i *ngIf="!(menuCollapsed | async)" class="fas fa-fw fa-angle-double-left"
[title]="'menu.section.icon.unpin' | translate"></i>
</div>
<div class="sidebar-collapsible">
<span *ngIf="menuCollapsed | async" class="section-header-text">{{'menu.section.pin' | translate }}</span>
<span *ngIf="!(menuCollapsed | async)" class="section-header-text">{{'menu.section.unpin' | translate }}</span>
</div>
</a>
</div>
</div>
</nav>
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component } from '@angular/core';
import { AdminSidebarComponent as BaseComponent } from '../../../../../app/admin/admin-sidebar/admin-sidebar.component';

/**
* Component representing the admin sidebar
*/
@Component({
selector: 'ds-admin-sidebar',
templateUrl: './admin-sidebar.component.html',
// templateUrl: '../../../../../app/admin/admin-sidebar/admin-sidebar.component.html',
// styleUrls: ['./admin-sidebar.component.scss']
styleUrls: ['../../../../../app/admin/admin-sidebar/admin-sidebar.component.scss']
})
export class AdminSidebarComponent extends BaseComponent {
}
Empty file.
Empty file.
15 changes: 15 additions & 0 deletions src/themes/sistedes/app/breadcrumbs/breadcrumbs.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component } from '@angular/core';
import { BreadcrumbsComponent as BaseComponent } from '../../../../app/breadcrumbs/breadcrumbs.component';

/**
* Component representing the breadcrumbs of a page
*/
@Component({
selector: 'ds-breadcrumbs',
// templateUrl: './breadcrumbs.component.html',
templateUrl: '../../../../app/breadcrumbs/breadcrumbs.component.html',
// styleUrls: ['./breadcrumbs.component.scss']
styleUrls: ['../../../../app/breadcrumbs/breadcrumbs.component.scss']
})
export class BreadcrumbsComponent extends BaseComponent {
}
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Component } from '@angular/core';
import { BrowseByDatePageComponent as BaseComponent } from '../../../../../app/browse-by/browse-by-date-page/browse-by-date-page.component';

@Component({
selector: 'ds-browse-by-date-page',
// styleUrls: ['./browse-by-date-page.component.scss'],
styleUrls: ['../../../../../app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.scss'],
// templateUrl: './browse-by-date-page.component.html'
templateUrl: '../../../../../app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.html'
})

/**
* Component for determining what Browse-By component to use depending on the metadata (browse ID) provided
*/

export class BrowseByDatePageComponent extends BaseComponent {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Component } from '@angular/core';
import { BrowseByMetadataPageComponent as BaseComponent } from '../../../../../app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component';

@Component({
selector: 'ds-browse-by-metadata-page',
// styleUrls: ['./browse-by-metadata-page.component.scss'],
styleUrls: ['../../../../../app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.scss'],
// templateUrl: './browse-by-metadata-page.component.html'
templateUrl: '../../../../../app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.html'
})

/**
* Component for determining what Browse-By component to use depending on the metadata (browse ID) provided
*/

export class BrowseByMetadataPageComponent extends BaseComponent {
}
Empty file.
Empty file.
Loading

0 comments on commit f039ffb

Please sign in to comment.