Skip to content

Commit

Permalink
Merge branch 'main' into DS-1764
Browse files Browse the repository at this point in the history
  • Loading branch information
sergius02 authored Feb 1, 2023
2 parents 60af900 + ce09649 commit bd277b3
Show file tree
Hide file tree
Showing 211 changed files with 7,575 additions and 13,145 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ WORKDIR /app
ADD . /app/
EXPOSE 4000

# Ensure Python and other build tools are available
# These are needed to install some node modules, especially on linux/arm64
RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/*

# We run yarn install with an increased network timeout (5min) to avoid "ESOCKETTIMEDOUT" errors from hub.docker.com
# See, for example https://github.com/yarnpkg/yarn/issues/5540
RUN yarn install --network-timeout 300000
Expand Down
2 changes: 0 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@
}
},
"allowedCommonJsDependencies": [
"angular2-text-mask",
"cerialize",
"core-js",
"lodash",
"jwt-decode",
"url-parse",
"uuid",
"webfontloader",
"zone.js"
Expand Down
14 changes: 14 additions & 0 deletions config/config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ auth:

# Form settings
form:
# Sets the spellcheck textarea attribute value
spellCheck: true
# NOTE: Map server-side validators to comparative Angular form validators
validatorMap:
required: required
Expand Down Expand Up @@ -143,6 +145,9 @@ languages:
- code: nl
label: Nederlands
active: true
- code: pl
label: Polski
active: true
- code: pt-PT
label: Português
active: true
Expand Down Expand Up @@ -174,6 +179,7 @@ languages:
label: Yкраї́нська
active: true


# Browse-By Pages
browseBy:
# Amount of years to display using jumps of one year (current year - oneYearLimit)
Expand Down Expand Up @@ -316,3 +322,11 @@ info:
markdown:
enabled: false
mathjax: false

# Which vocabularies should be used for which search filters
# and whether to show the filter in the search sidebar
# Take a look at the filter-vocabulary-config.ts file for documentation on how the options are obtained
vocabularies:
- filter: 'subject'
vocabulary: 'srsc'
enabled: true
77 changes: 29 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
"clean:log": "rimraf *.log*",
"clean:json": "rimraf *.records.json",
"clean:node": "rimraf node_modules",
"clean:cli": "rimraf .angular/cache",
"clean:prod": "yarn run clean:dist && yarn run clean:log && yarn run clean:doc && yarn run clean:coverage && yarn run clean:json",
"clean": "yarn run clean:prod && yarn run clean:dev:config && yarn run clean:node",
"clean": "yarn run clean:prod && yarn run clean:dev:config && yarn run clean:cli && yarn run clean:node",
"sync-i18n": "ts-node --project ./tsconfig.ts-node.json scripts/sync-i18n-files.ts",
"build:mirador": "webpack --config webpack/webpack.mirador.config.ts",
"merge-i18n": "ts-node --project ./tsconfig.ts-node.json scripts/merge-i18n-files.ts",
Expand All @@ -54,18 +55,18 @@
"ts-node": "10.2.1"
},
"dependencies": {
"@angular/animations": "~13.2.6",
"@angular/animations": "~13.3.12",
"@angular/cdk": "^13.2.6",
"@angular/common": "~13.2.6",
"@angular/compiler": "~13.2.6",
"@angular/core": "~13.2.6",
"@angular/forms": "~13.2.6",
"@angular/localize": "13.2.6",
"@angular/platform-browser": "~13.2.6",
"@angular/platform-browser-dynamic": "~13.2.6",
"@angular/platform-server": "~13.2.6",
"@angular/router": "~13.2.6",
"@babel/runtime": "^7.17.2",
"@angular/common": "~13.3.12",
"@angular/compiler": "~13.3.12",
"@angular/core": "~13.3.12",
"@angular/forms": "~13.3.12",
"@angular/localize": "13.3.12",
"@angular/platform-browser": "~13.3.12",
"@angular/platform-browser-dynamic": "~13.3.12",
"@angular/platform-server": "~13.3.12",
"@angular/router": "~13.3.12",
"@babel/runtime": "7.17.2",
"@kolkov/ngx-gallery": "^2.0.1",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
Expand All @@ -77,32 +78,30 @@
"@ngrx/store": "^13.0.2",
"@nguniversal/express-engine": "^13.0.2",
"@ngx-translate/core": "^13.0.0",
"@nicky-lenaers/ngx-scroll-to": "^9.0.0",
"@nicky-lenaers/ngx-scroll-to": "^13.0.0",
"@types/grecaptcha": "^3.0.4",
"angular-idle-preload": "3.0.0",
"angulartics2": "^12.0.0",
"axios": "^0.27.2",
"bootstrap": "4.3.1",
"caniuse-lite": "^1.0.30001165",
"bootstrap": "^4.6.1",
"cerialize": "0.1.18",
"cli-progress": "^3.8.0",
"colors": "^1.4.0",
"compression": "^1.7.4",
"cookie-parser": "1.4.5",
"core-js": "^3.7.0",
"date-fns": "^2.29.3",
"date-fns-tz": "^1.3.7",
"deepmerge": "^4.2.2",
"ejs": "^3.1.8",
"express": "^4.17.1",
"express-rate-limit": "^5.1.3",
"fast-json-patch": "^3.0.0-1",
"file-saver": "^2.0.5",
"filesize": "^6.1.0",
"font-awesome": "4.7.0",
"http-proxy-middleware": "^1.0.5",
"https": "1.0.0",
"js-cookie": "2.2.1",
"js-yaml": "^4.1.0",
"json5": "^2.1.3",
"json5": "^2.2.2",
"jsonschema": "1.4.0",
"jwt-decode": "^3.1.2",
"klaro": "^0.7.18",
Expand All @@ -119,43 +118,39 @@
"ngx-infinite-scroll": "^10.0.1",
"ngx-pagination": "5.0.0",
"ngx-sortablejs": "^11.1.0",
"ngx-ui-switch": "^11.0.1",
"ngx-ui-switch": "^13.0.2",
"nouislider": "^14.6.3",
"pem": "1.14.4",
"postcss-cli": "^9.1.0",
"prop-types": "^15.7.2",
"react-copy-to-clipboard": "^5.0.1",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.5.5",
"sanitize-html": "^2.7.2",
"sortablejs": "1.13.0",
"tslib": "^2.0.0",
"url-parse": "^1.5.6",
"uuid": "^8.3.2",
"webfontloader": "1.6.28",
"zone.js": "~0.11.5"
},
"devDependencies": {
"@angular-builders/custom-webpack": "~13.1.0",
"@angular-devkit/build-angular": "~13.2.6",
"@angular-devkit/build-angular": "~13.3.10",
"@angular-eslint/builder": "13.1.0",
"@angular-eslint/eslint-plugin": "13.1.0",
"@angular-eslint/eslint-plugin-template": "13.1.0",
"@angular-eslint/schematics": "13.1.0",
"@angular-eslint/template-parser": "13.1.0",
"@angular/cli": "~13.2.6",
"@angular/compiler-cli": "~13.2.6",
"@angular/language-service": "~13.2.6",
"@angular/cli": "~13.3.10",
"@angular/compiler-cli": "~13.3.12",
"@angular/language-service": "~13.3.12",
"@cypress/schematic": "^1.5.0",
"@fortawesome/fontawesome-free": "^5.5.0",
"@fortawesome/fontawesome-free": "^6.2.1",
"@ngrx/store-devtools": "^13.0.2",
"@ngtools/webpack": "^13.2.6",
"@nguniversal/builders": "^13.0.2",
"@nguniversal/builders": "^13.1.1",
"@types/deep-freeze": "0.1.2",
"@types/ejs": "^3.1.1",
"@types/express": "^4.17.9",
"@types/file-saver": "^2.0.1",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.8",
"@types/js-cookie": "2.2.6",
"@types/lodash": "^4.14.165",
"@types/node": "^14.14.9",
Expand All @@ -166,53 +161,39 @@
"compression-webpack-plugin": "^9.2.0",
"copy-webpack-plugin": "^6.4.1",
"cross-env": "^7.0.3",
"css-loader": "^6.2.0",
"css-minimizer-webpack-plugin": "^3.4.1",
"cssnano": "^5.0.6",
"cypress": "9.7.0",
"cypress-axe": "^0.14.0",
"debug-loader": "^0.0.1",
"deep-freeze": "0.0.1",
"dotenv": "^8.2.0",
"eslint": "^8.2.0",
"eslint-plugin-deprecation": "^1.3.2",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsdoc": "^39.3.6",
"eslint-plugin-jsdoc": "^39.6.4",
"eslint-plugin-lodash": "^7.4.0",
"eslint-plugin-unused-imports": "^2.0.0",
"express-static-gzip": "^2.1.5",
"fork-ts-checker-webpack-plugin": "^6.0.3",
"html-loader": "^1.3.2",
"jasmine-core": "^3.8.0",
"jasmine-marbles": "0.9.2",
"jasmine-spec-reporter": "~5.0.0",
"karma": "^6.3.14",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"karma-mocha-reporter": "2.2.5",
"ngx-mask": "^13.1.7",
"nodemon": "^2.0.15",
"nodemon": "^2.0.20",
"postcss": "^8.1",
"postcss-apply": "0.12.0",
"postcss-import": "^14.0.0",
"postcss-loader": "^4.0.3",
"postcss-preset-env": "^7.4.2",
"postcss-responsive-type": "1.0.0",
"protractor": "^7.0.0",
"protractor-istanbul-plugin": "2.0.0",
"raw-loader": "0.5.1",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"rimraf": "^3.0.2",
"rxjs-spy": "^8.0.2",
"sass": "~1.32.6",
"sass": "~1.33.0",
"sass-loader": "^12.6.0",
"sass-resources-loader": "^2.1.1",
"string-replace-loader": "^3.1.0",
"terser-webpack-plugin": "^2.3.1",
"ts-loader": "^5.2.0",
"ts-node": "^8.10.2",
"typescript": "~4.5.5",
"webpack": "^5.69.1",
Expand Down
14 changes: 14 additions & 0 deletions server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import 'rxjs';
/* eslint-disable import/no-namespace */
import * as morgan from 'morgan';
import * as express from 'express';
import * as ejs from 'ejs';
import * as compression from 'compression';
import * as expressStaticGzip from 'express-static-gzip';
/* eslint-enable import/no-namespace */
Expand Down Expand Up @@ -136,10 +137,23 @@ export function app() {
})(_, (options as any), callback)
);

server.engine('ejs', ejs.renderFile);

/*
* Register the view engines for html and ejs
*/
server.set('view engine', 'html');
server.set('view engine', 'ejs');

/**
* Serve the robots.txt ejs template, filling in the origin variable
*/
server.get('/robots.txt', (req, res) => {
res.setHeader('content-type', 'text/plain');
res.render('assets/robots.txt.ejs', {
'origin': req.protocol + '://' + req.headers.host
});
});

/*
* Set views folder path to directory where template files are stored
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,43 @@ describe('GroupFormComponent', () => {
fixture.detectChanges();
});

it('should edit with name and description operations', () => {
const operations = [{
op: 'add',
path: '/metadata/dc.description',
value: 'testDescription'
}, {
op: 'replace',
path: '/name',
value: 'newGroupName'
}];
expect(groupsDataServiceStub.patch).toHaveBeenCalledWith(expected, operations);
});

it('should edit with description operations', () => {
component.groupName.value = null;
component.onSubmit();
fixture.detectChanges();
const operations = [{
op: 'add',
path: '/metadata/dc.description',
value: 'testDescription'
}];
expect(groupsDataServiceStub.patch).toHaveBeenCalledWith(expected, operations);
});

it('should edit with name operations', () => {
component.groupDescription.value = null;
component.onSubmit();
fixture.detectChanges();
const operations = [{
op: 'replace',
path: '/name',
value: 'newGroupName'
}];
expect(groupsDataServiceStub.patch).toHaveBeenCalledWith(expected, operations);
});

it('should emit the existing group using the correct new values', waitForAsync(() => {
fixture.whenStable().then(() => {
expect(component.submitForm.emit).toHaveBeenCalledWith(expected2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import { followLink } from '../../../shared/utils/follow-link-config.model';
import { NoContent } from '../../../core/shared/NoContent.model';
import { Operation } from 'fast-json-patch';
import { ValidateGroupExists } from './validators/group-exists.validator';
import { environment } from '../../../../environments/environment';

@Component({
selector: 'ds-group-form',
Expand Down Expand Up @@ -194,6 +195,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
label: groupDescription,
name: 'groupDescription',
required: false,
spellCheck: environment.form.spellCheck,
});
this.formModel = [
this.groupName,
Expand Down Expand Up @@ -344,8 +346,8 @@ export class GroupFormComponent implements OnInit, OnDestroy {

if (hasValue(this.groupDescription.value)) {
operations = [...operations, {
op: 'replace',
path: '/metadata/dc.description/0/value',
op: 'add',
path: '/metadata/dc.description',
value: this.groupDescription.value
}];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { Router } from '@angular/router';
import { hasValue, isEmpty } from '../../../../shared/empty.util';
import { TranslateService } from '@ngx-translate/core';
import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths';
import { environment } from '../../../../../environments/environment';

/**
* The component responsible for rendering the form to create/edit a bitstream format
Expand Down Expand Up @@ -90,6 +91,7 @@ export class FormatFormComponent implements OnInit {
name: 'description',
label: 'admin.registries.bitstream-formats.edit.description.label',
hint: 'admin.registries.bitstream-formats.edit.description.hint',
spellCheck: environment.form.spellCheck,

}),
new DynamicSelectModel({
Expand Down
6 changes: 0 additions & 6 deletions src/app/app.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ import {
filterReducer,
SearchFiltersState
} from './shared/search/search-filters/search-filter/search-filter.reducer';
import {
sidebarFilterReducer,
SidebarFiltersState
} from './shared/sidebar/filter/sidebar-filter.reducer';
import { sidebarReducer, SidebarState } from './shared/sidebar/sidebar.reducer';
import { truncatableReducer, TruncatablesState } from './shared/truncatable/truncatable.reducer';
import { ThemeState, themeReducer } from './shared/theme-support/theme.reducer';
Expand All @@ -59,7 +55,6 @@ export interface AppState {
metadataRegistry: MetadataRegistryState;
notifications: NotificationsState;
sidebar: SidebarState;
sidebarFilter: SidebarFiltersState;
searchFilter: SearchFiltersState;
truncatable: TruncatablesState;
cssVariables: CSSVariablesState;
Expand All @@ -81,7 +76,6 @@ export const appReducers: ActionReducerMap<AppState> = {
metadataRegistry: metadataRegistryReducer,
notifications: notificationsReducer,
sidebar: sidebarReducer,
sidebarFilter: sidebarFilterReducer,
searchFilter: filterReducer,
truncatable: truncatableReducer,
cssVariables: cssVariablesReducer,
Expand Down
Loading

0 comments on commit bd277b3

Please sign in to comment.