mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
angular cli
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
# http://editorconfig.org
|
# Editor configuration, see https://editorconfig.org
|
||||||
|
|
||||||
root = true
|
root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@@ -7,8 +7,8 @@ npm-debug.log
|
|||||||
|
|
||||||
/build/
|
/build/
|
||||||
|
|
||||||
/config/environment.dev.js
|
/src/environments/environment.dev.ts
|
||||||
/config/environment.prod.js
|
/src/environments/environment.prod.ts
|
||||||
|
|
||||||
/coverage
|
/coverage
|
||||||
|
|
||||||
|
@@ -53,6 +53,5 @@ cache:
|
|||||||
bundler_args: --retry 5
|
bundler_args: --retry 5
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- yarn run build
|
|
||||||
- yarn run ci
|
- yarn run ci
|
||||||
- cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
|
- cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
|
||||||
|
48
README.md
48
README.md
@@ -29,7 +29,7 @@ yarn install
|
|||||||
yarn start
|
yarn start
|
||||||
```
|
```
|
||||||
|
|
||||||
Then go to [http://localhost:3000](http://localhost:3000) in your browser
|
Then go to [http://localhost:4000](http://localhost:4000) in your browser
|
||||||
|
|
||||||
Not sure where to start? watch the training videos linked in the [Introduction to the technology](#introduction-to-the-technology) section below.
|
Not sure where to start? watch the training videos linked in the [Introduction to the technology](#introduction-to-the-technology) section below.
|
||||||
|
|
||||||
@@ -59,13 +59,13 @@ Table of Contents
|
|||||||
Introduction to the technology
|
Introduction to the technology
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
You can find more information on the technologies used in this project (Angular.io, Typescript, Angular Universal, RxJS, etc) on the [LYRASIS wiki](https://wiki.lyrasis.org/display/DSPACE/DSpace+7+UI+Technology+Stack)
|
You can find more information on the technologies used in this project (Angular.io, Angular CLI, Typescript, Angular Universal, RxJS, etc) on the [LYRASIS wiki](https://wiki.lyrasis.org/display/DSPACE/DSpace+7+UI+Technology+Stack)
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
- [Node.js](https://nodejs.org), [npm](https://www.npmjs.com/), and [yarn](https://yarnpkg.com)
|
- [Node.js](https://nodejs.org) and [yarn](https://yarnpkg.com)
|
||||||
- Ensure you're running node `v10.x` or `v12.x`, npm >= `v5.x` and yarn >= `v1.x`
|
- Ensure you're running node `v10.x` or `v12.x` and yarn >= `v1.x`
|
||||||
|
|
||||||
If you have [`nvm`](https://github.com/creationix/nvm#install-script) or [`nvm-windows`](https://github.com/coreybutler/nvm-windows) installed, which is highly recommended, you can run `nvm install --lts && nvm use` to install and start using the latest Node LTS.
|
If you have [`nvm`](https://github.com/creationix/nvm#install-script) or [`nvm-windows`](https://github.com/coreybutler/nvm-windows) installed, which is highly recommended, you can run `nvm install --lts && nvm use` to install and start using the latest Node LTS.
|
||||||
|
|
||||||
@@ -77,25 +77,23 @@ Installing
|
|||||||
|
|
||||||
### Configuring
|
### Configuring
|
||||||
|
|
||||||
Default configuration file is located in `config/` folder.
|
Default configuration file is located in `src/environments/` folder.
|
||||||
|
|
||||||
To change the default configuration values, create local files that override the parameters you need to change:
|
To change the default configuration values, create local files that override the parameters you need to change:
|
||||||
|
|
||||||
- Create a new `environment.dev.js` file in `config/` for `devel` environment;
|
- Create a new `environment.dev.ts` file in `src/environments/` for `development` environment;
|
||||||
- Create a new `environment.prod.js` file in `config/` for `production` environment;
|
- Create a new `environment.prod.ts` file in `src/environments/` for `production` environment;
|
||||||
|
|
||||||
To use the configuration parameters in your component:
|
To use the configuration parameters in your component:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
import { GLOBAL_CONFIG, GlobalConfig } from '../config';
|
import { environment } from '../environment.ts';
|
||||||
|
|
||||||
constructor(@Inject(GLOBAL_CONFIG) public config: GlobalConfig) {}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Running the app
|
Running the app
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
After you have installed all dependencies you can now run the app. Run `yarn run watch` to start a local server which will watch for changes, rebuild the code, and reload the server for you. You can visit it at `http://localhost:3000`.
|
After you have installed all dependencies you can now run the app. Run `yarn run start:dev` to start a local server which will watch for changes, rebuild the code, and reload the server for you. You can visit it at `http://localhost:4200`.
|
||||||
|
|
||||||
### Running in production mode
|
### Running in production mode
|
||||||
|
|
||||||
@@ -115,14 +113,6 @@ yarn run build:prod
|
|||||||
|
|
||||||
This will build the application and put the result in the `dist` folder
|
This will build the application and put the result in the `dist` folder
|
||||||
|
|
||||||
### Deploy
|
|
||||||
```bash
|
|
||||||
# deploy production in standalone pm2 container
|
|
||||||
yarn run deploy
|
|
||||||
|
|
||||||
# remove production from standalone pm2 container
|
|
||||||
yarn run undeploy
|
|
||||||
```
|
|
||||||
|
|
||||||
### Running the application with Docker
|
### Running the application with Docker
|
||||||
See [Docker Runtime Options](docker/README.md)
|
See [Docker Runtime Options](docker/README.md)
|
||||||
@@ -155,17 +145,15 @@ If you would like to contribute by testing a Pull Request (PR), here's how to do
|
|||||||
* Click it, and follow "Step 1" of those instructions to checkout the pull down the PR branch.
|
* Click it, and follow "Step 1" of those instructions to checkout the pull down the PR branch.
|
||||||
2. `yarn run clean` (This resets your local dependencies to ensure you are up-to-date with this PR)
|
2. `yarn run clean` (This resets your local dependencies to ensure you are up-to-date with this PR)
|
||||||
3. `yarn install` (Updates your local dependencies to those in the PR)
|
3. `yarn install` (Updates your local dependencies to those in the PR)
|
||||||
4. `yarn start` (Rebuilds the project, and deploys to localhost:3000, by default)
|
4. `yarn start` (Rebuilds the project, and deploys to localhost:4000, by default)
|
||||||
5. At this point, the code from the PR will be deployed to http://localhost:3000. Test it out, and ensure that it does what is described in the PR (or fixes the bug described in the ticket linked to the PR).
|
5. At this point, the code from the PR will be deployed to http://localhost:4000. Test it out, and ensure that it does what is described in the PR (or fixes the bug described in the ticket linked to the PR).
|
||||||
|
|
||||||
Once you have tested the Pull Request, please add a comment and/or approval to the PR to let us know whether you found it to be successful (or not). Thanks!
|
Once you have tested the Pull Request, please add a comment and/or approval to the PR to let us know whether you found it to be successful (or not). Thanks!
|
||||||
|
|
||||||
|
|
||||||
### Unit Tests
|
### Unit Tests
|
||||||
|
|
||||||
Unit tests use Karma. You can find the configuration file at the same level of this README file:`./karma.conf.js` If you are going to use a remote test enviroment you need to edit the `./karma.conf.js`. Follow the instructions you will find inside it. To executing tests whenever any file changes you can modify the 'autoWatch' option to 'true' and 'singleRun' option to 'false'. A coverage report is also available at: http://localhost:9876/ after you run: `yarn run coverage`.
|
Unit tests use Karma. You can find the configuration file at the same level of this README file:`./karma.conf.js` If you are going to use a remote test environment you need to edit the `./karma.conf.js`. Follow the instructions you will find inside it. To executing tests whenever any file changes you can modify the 'autoWatch' option to 'true' and 'singleRun' option to 'false'. A coverage report is also available at: http://localhost:9876/ after you run: `yarn run coverage`.
|
||||||
|
|
||||||
To correctly run the tests you need to run the build once with: `yarn run build`.
|
|
||||||
|
|
||||||
The default browser is Google Chrome.
|
The default browser is Google Chrome.
|
||||||
|
|
||||||
@@ -177,17 +165,13 @@ and run: `yarn run test`
|
|||||||
|
|
||||||
E2E tests use Protractor + Selenium server + browsers. You can find the configuration file at the same level of this README file:`./protractor.conf.js` Protractor is installed as 'local' as a dev dependency.
|
E2E tests use Protractor + Selenium server + browsers. You can find the configuration file at the same level of this README file:`./protractor.conf.js` Protractor is installed as 'local' as a dev dependency.
|
||||||
|
|
||||||
If you are going to use a remote test enviroment you need to edit the './protractor.conf.js'. Follow the instructions you will find inside it.
|
If you are going to use a remote test enviroment you need to edit the './e2e//protractor.conf.js'. Follow the instructions you will find inside it.
|
||||||
|
|
||||||
The default browser is Google Chrome.
|
The default browser is Google Chrome.
|
||||||
|
|
||||||
Protractor needs a functional instance of the DSpace interface to run the E2E tests, so you need to run:`yarn run watch`
|
|
||||||
|
|
||||||
or any command that bring up the DSpace interface.
|
|
||||||
|
|
||||||
Place your tests at the following path: `./e2e`
|
Place your tests at the following path: `./e2e`
|
||||||
|
|
||||||
and run: `yarn run e2e`
|
and run: `ng e2e`
|
||||||
|
|
||||||
### Continuous Integration (CI) Test
|
### Continuous Integration (CI) Test
|
||||||
|
|
||||||
@@ -200,7 +184,7 @@ See [`./docs`](docs) for further documentation.
|
|||||||
|
|
||||||
### Building code documentation
|
### Building code documentation
|
||||||
|
|
||||||
To build the code documentation we use [TYPEDOC](http://typedoc.org). TYPEDOC is a documentation generator for TypeScript projects. It extracts informations from properly formatted comments that can be written within the code files. Follow the instructions [here](http://typedoc.org/guides/doccomments/) to know how to make those comments.
|
To build the code documentation we use [TYPEDOC](http://typedoc.org). TYPEDOC is a documentation generator for TypeScript projects. It extracts information from properly formatted comments that can be written within the code files. Follow the instructions [here](http://typedoc.org/guides/doccomments/) to know how to make those comments.
|
||||||
|
|
||||||
Run:`yarn run docs` to produce the documentation that will be available in the 'doc' folder.
|
Run:`yarn run docs` to produce the documentation that will be available in the 'doc' folder.
|
||||||
|
|
||||||
@@ -388,7 +372,7 @@ Frequently asked questions
|
|||||||
- Where do I write my tests?
|
- Where do I write my tests?
|
||||||
- You can write your tests next to your component files. e.g. for `src/app/home/home.component.ts` call it `src/app/home/home.component.spec.ts`
|
- You can write your tests next to your component files. e.g. for `src/app/home/home.component.ts` call it `src/app/home/home.component.spec.ts`
|
||||||
- How do I start the app when I get `EACCES` and `EADDRINUSE` errors?
|
- How do I start the app when I get `EACCES` and `EADDRINUSE` errors?
|
||||||
- The `EADDRINUSE` error means the port `3000` is currently being used and `EACCES` is lack of permission to build files to `./dist/`
|
- The `EADDRINUSE` error means the port `4000` of `4200` is currently being used and `EACCES` is lack of permission to build files to `./dist/`
|
||||||
- What are the naming conventions for Angular 2?
|
- What are the naming conventions for Angular 2?
|
||||||
- See [the official angular 2 style guide](https://angular.io/styleguide)
|
- See [the official angular 2 style guide](https://angular.io/styleguide)
|
||||||
- Why is the size of my app larger in development?
|
- Why is the size of my app larger in development?
|
||||||
|
181
angular.json
181
angular.json
@@ -1,13 +1,180 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||||
"version": 1,
|
"version": 1,
|
||||||
"cli": {
|
"newProjectRoot": "projects",
|
||||||
"defaultCollection": "@ngrx/schematics"
|
|
||||||
},
|
|
||||||
"projects": {
|
"projects": {
|
||||||
"core": {
|
"dspace-angular-cli": {
|
||||||
|
"projectType": "application",
|
||||||
|
"schematics": {
|
||||||
|
"@schematics/angular:component": {
|
||||||
|
"style": "scss"
|
||||||
|
}
|
||||||
|
},
|
||||||
"root": "",
|
"root": "",
|
||||||
"projectType": "application"
|
"sourceRoot": "src",
|
||||||
|
"prefix": "ds",
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular-builders/custom-webpack:browser",
|
||||||
|
"options": {
|
||||||
|
"customWebpackConfig": {
|
||||||
|
"path": "./webpack/webpack.common.ts",
|
||||||
|
"mergeStrategies": {
|
||||||
|
"loaders": "prepend"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"outputPath": "dist/browser",
|
||||||
|
"index": "src/index.html",
|
||||||
|
"main": "src/main.browser.ts",
|
||||||
|
"polyfills": "src/polyfills.ts",
|
||||||
|
"tsConfig": "tsconfig.app.json",
|
||||||
|
"aot": false,
|
||||||
|
"assets": [
|
||||||
|
"src/assets"
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"src/styles.scss"
|
||||||
|
],
|
||||||
|
"scripts": [],
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.dev.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.prod.ts"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"extractCss": true,
|
||||||
|
"namedChunks": false,
|
||||||
|
"aot": true,
|
||||||
|
"extractLicenses": true,
|
||||||
|
"vendorChunk": false,
|
||||||
|
"buildOptimizer": true,
|
||||||
|
"budgets": [
|
||||||
|
{
|
||||||
|
"type": "initial",
|
||||||
|
"maximumWarning": "3mb",
|
||||||
|
"maximumError": "5mb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "anyComponentStyle",
|
||||||
|
"maximumWarning": "6kb",
|
||||||
|
"maximumError": "10kb"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"builder": "@angular-builders/custom-webpack:dev-server",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "dspace-angular-cli:build"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"browserTarget": "dspace-angular-cli:build:production"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extract-i18n": {
|
||||||
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "dspace-angular-cli:build"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"builder": "@angular-builders/custom-webpack:karma",
|
||||||
|
"options": {
|
||||||
|
"customWebpackConfig": {
|
||||||
|
"path": "./webpack/webpack.common.ts",
|
||||||
|
"mergeStrategies": {
|
||||||
|
"loaders": "prepend"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"main": "src/test.ts",
|
||||||
|
"polyfills": "src/polyfills.ts",
|
||||||
|
"tsConfig": "tsconfig.spec.json",
|
||||||
|
"karmaConfig": "karma.conf.js",
|
||||||
|
"assets": [
|
||||||
|
"src/assets"
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"src/styles.scss"
|
||||||
|
],
|
||||||
|
"scripts": [],
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.test.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": [
|
||||||
|
"tsconfig.app.json",
|
||||||
|
"tsconfig.spec.json",
|
||||||
|
"e2e/tsconfig.json"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"**/node_modules/**"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"e2e": {
|
||||||
|
"builder": "@angular-devkit/build-angular:protractor",
|
||||||
|
"options": {
|
||||||
|
"protractorConfig": "e2e/protractor.conf.js",
|
||||||
|
"devServerTarget": "dspace-angular-cli:serve"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"devServerTarget": "dspace-angular-cli:serve:production"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"server": {
|
||||||
|
"builder": "@angular-builders/custom-webpack:server",
|
||||||
|
"options": {
|
||||||
|
"customWebpackConfig": {
|
||||||
|
"path": "./webpack/webpack.prod.ts",
|
||||||
|
"mergeStrategies": {
|
||||||
|
"loaders": "prepend"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"outputPath": "dist/server",
|
||||||
|
"main": "src/main.server.ts",
|
||||||
|
"tsConfig": "tsconfig.server.json"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.prod.ts"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"sourceMap": false,
|
||||||
|
"optimization": {
|
||||||
|
"scripts": false,
|
||||||
|
"styles": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
"defaultProject": "dspace-angular-cli"
|
||||||
|
}
|
||||||
|
17
app.yaml
17
app.yaml
@@ -1,17 +0,0 @@
|
|||||||
# Copyright 2015-2016, Google, Inc.
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
# [START app_yaml]
|
|
||||||
runtime: nodejs
|
|
||||||
env: flex
|
|
||||||
# [END app_yaml]
|
|
11
browserslist
Normal file
11
browserslist
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
||||||
|
# For additional information regarding the format and rule options, please see:
|
||||||
|
# https://github.com/browserslist/browserslist#queries
|
||||||
|
|
||||||
|
# You can see what browsers were selected by your queries by running:
|
||||||
|
# npx browserslist
|
||||||
|
|
||||||
|
> 0.5%
|
||||||
|
last 2 versions
|
||||||
|
Firefox ESR
|
||||||
|
not IE 9-11 # For IE 9-11 support, remove 'not'.
|
@@ -1,4 +0,0 @@
|
|||||||
// This configuration is currently only being used for unit tests, end-to-end tests use environment.dev.ts
|
|
||||||
module.exports = {
|
|
||||||
|
|
||||||
};
|
|
@@ -12,10 +12,10 @@ exports.config = {
|
|||||||
// Change to 'false' to run tests using a remote Selenium server
|
// Change to 'false' to run tests using a remote Selenium server
|
||||||
directConnect: true,
|
directConnect: true,
|
||||||
// Change if the website to test is not on the localhost
|
// Change if the website to test is not on the localhost
|
||||||
baseUrl: 'http://localhost:3000/',
|
baseUrl: 'http://localhost:4200/',
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
specs: [
|
specs: [
|
||||||
'./e2e/**/*.e2e-spec.ts'
|
'./src/**/*.e2e-spec.ts'
|
||||||
],
|
],
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
// Browser and Capabilities: PhantomJS
|
// Browser and Capabilities: PhantomJS
|
||||||
@@ -67,7 +67,7 @@ exports.config = {
|
|||||||
//],
|
//],
|
||||||
|
|
||||||
plugins: [{
|
plugins: [{
|
||||||
path: 'node_modules/protractor-istanbul-plugin'
|
path: '../node_modules/protractor-istanbul-plugin'
|
||||||
}],
|
}],
|
||||||
|
|
||||||
framework: 'jasmine',
|
framework: 'jasmine',
|
188
karma.conf.js
188
karma.conf.js
@@ -1,176 +1,36 @@
|
|||||||
/**
|
// Karma configuration file, see link for more information
|
||||||
* @author: @AngularClass
|
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = function (config) {
|
module.exports = function (config) {
|
||||||
|
config.set({
|
||||||
var testWebpackConfig = require('./webpack/webpack.test.js')({
|
|
||||||
env: 'test'
|
|
||||||
});
|
|
||||||
|
|
||||||
// Uncomment and change to run tests on a remote Selenium server
|
|
||||||
var webdriverConfig = {
|
|
||||||
hostname: 'localhost',
|
|
||||||
port: 4444
|
|
||||||
};
|
|
||||||
|
|
||||||
var configuration = {
|
|
||||||
client: {
|
|
||||||
jasmine: {
|
|
||||||
random: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// base path that will be used to resolve all patterns (e.g. files, exclude)
|
|
||||||
basePath: '',
|
basePath: '',
|
||||||
|
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||||
/*
|
|
||||||
* Frameworks to use
|
|
||||||
*
|
|
||||||
* available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
|
||||||
*/
|
|
||||||
frameworks: ['jasmine'],
|
|
||||||
|
|
||||||
plugins: [
|
plugins: [
|
||||||
require("istanbul-instrumenter-loader"),
|
|
||||||
require('karma-chrome-launcher'),
|
|
||||||
require('karma-coverage'),
|
|
||||||
require("karma-istanbul-preprocessor"),
|
|
||||||
require('karma-jasmine'),
|
require('karma-jasmine'),
|
||||||
|
require('karma-chrome-launcher'),
|
||||||
|
require('karma-jasmine-html-reporter'),
|
||||||
|
require('karma-coverage-istanbul-reporter'),
|
||||||
|
require('@angular-devkit/build-angular/plugins/karma'),
|
||||||
require('karma-mocha-reporter'),
|
require('karma-mocha-reporter'),
|
||||||
require('karma-phantomjs-launcher'),
|
|
||||||
require('karma-remap-coverage'),
|
|
||||||
require('karma-remap-istanbul'),
|
|
||||||
require('karma-sourcemap-loader'),
|
|
||||||
require('karma-webdriver-launcher'),
|
|
||||||
require('karma-webpack')
|
|
||||||
],
|
],
|
||||||
|
client: {
|
||||||
// list of files to exclude
|
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||||
exclude: [],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* list of files / patterns to load in the browser
|
|
||||||
*
|
|
||||||
* we are building the test environment in ./spec-bundle.js
|
|
||||||
*/
|
|
||||||
files: [{
|
|
||||||
pattern: './spec-bundle.js',
|
|
||||||
watched: false,
|
|
||||||
}],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* preprocess matching files before serving them to the browser
|
|
||||||
* available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
|
||||||
*/
|
|
||||||
preprocessors: {
|
|
||||||
'./spec-bundle.js': [
|
|
||||||
'istanbul',
|
|
||||||
'webpack',
|
|
||||||
'sourcemap'
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
|
coverageIstanbulReporter: {
|
||||||
// Webpack Config at ./webpack.test.js
|
dir: require('path').join(__dirname, './coverage/dspace-angular-cli'),
|
||||||
webpack: testWebpackConfig,
|
reports: ['html', 'lcovonly', 'text-summary'],
|
||||||
|
fixWebpackSourcePaths: true
|
||||||
// save interim raw coverage report in memory
|
|
||||||
coverageReporter: {
|
|
||||||
type: 'in-memory'
|
|
||||||
},
|
},
|
||||||
|
reporters: ['mocha', 'kjhtml'],
|
||||||
remapCoverageReporter: {
|
|
||||||
'text-summary': null, // to show summary in console
|
|
||||||
html: './coverage/html',
|
|
||||||
cobertura: './coverage/cobertura.xml'
|
|
||||||
},
|
|
||||||
|
|
||||||
remapIstanbulReporter: {
|
|
||||||
remapOptions: {}, //additional remap options
|
|
||||||
reports: {
|
|
||||||
json: './coverage/coverage.json',
|
|
||||||
lcovonly: './coverage/lcov.info',
|
|
||||||
html: './coverage/html/',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Webpack please don't spam the console when running in karma!
|
|
||||||
*/
|
|
||||||
webpackMiddleware: {
|
|
||||||
/**
|
|
||||||
* webpack-dev-middleware configuration
|
|
||||||
* i.e.
|
|
||||||
*/
|
|
||||||
noInfo: true,
|
|
||||||
/**
|
|
||||||
* and use stats to turn off verbose output
|
|
||||||
*/
|
|
||||||
stats: {
|
|
||||||
/**
|
|
||||||
* options i.e.
|
|
||||||
*/
|
|
||||||
chunks: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/*
|
|
||||||
* test results reporter to use
|
|
||||||
*
|
|
||||||
* possible values: 'dots', 'progress'
|
|
||||||
* available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
|
||||||
*/
|
|
||||||
reporters: [
|
|
||||||
'mocha',
|
|
||||||
'coverage',
|
|
||||||
'remap-coverage',
|
|
||||||
'karma-remap-istanbul'
|
|
||||||
],
|
|
||||||
|
|
||||||
// Karma web server port
|
|
||||||
port: 9876,
|
|
||||||
|
|
||||||
// enable / disable colors in the output (reporters and logs)
|
|
||||||
colors: true,
|
|
||||||
|
|
||||||
/*
|
|
||||||
* level of logging
|
|
||||||
* possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
|
||||||
*/
|
|
||||||
logLevel: config.LOG_WARN,
|
|
||||||
|
|
||||||
// enable / disable watching file and executing tests whenever any file changes
|
|
||||||
autoWatch: false,
|
|
||||||
|
|
||||||
/*
|
|
||||||
* start these browsers
|
|
||||||
* available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
|
||||||
*/
|
|
||||||
browsers: [
|
|
||||||
'Chrome'
|
|
||||||
],
|
|
||||||
|
|
||||||
customLaunchers: {
|
|
||||||
// Remote Selenium Server with Chrome - launcher
|
|
||||||
'SeleniumChrome': {
|
|
||||||
base: 'WebDriver',
|
|
||||||
config: webdriverConfig,
|
|
||||||
browserName: 'chrome'
|
|
||||||
},
|
|
||||||
// Remote Selenium Server with Firefox - launcher
|
|
||||||
'SeleniumFirefox': {
|
|
||||||
base: 'WebDriver',
|
|
||||||
config: webdriverConfig,
|
|
||||||
browserName: 'firefox'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
mochaReporter: {
|
mochaReporter: {
|
||||||
ignoreSkipped: true
|
output: 'autowatch'
|
||||||
},
|
},
|
||||||
|
port: 9876,
|
||||||
browserNoActivityTimeout: 30000
|
colors: true,
|
||||||
|
logLevel: config.LOG_INFO,
|
||||||
};
|
autoWatch: true,
|
||||||
|
browsers: ['Chrome'],
|
||||||
config.set(configuration);
|
singleRun: false,
|
||||||
|
restartOnFileChange: true
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"watch": [
|
|
||||||
"dist",
|
|
||||||
"config",
|
|
||||||
"src/index.html"
|
|
||||||
],
|
|
||||||
"ext": "js ts json html",
|
|
||||||
"delay": "50"
|
|
||||||
}
|
|
230
package.json
230
package.json
@@ -1,21 +1,22 @@
|
|||||||
{
|
{
|
||||||
"name": "dspace-angular",
|
"name": "dspace-angular-cli",
|
||||||
"version": "0.0.1",
|
"version": "0.0.0",
|
||||||
"description": "Angular Universal UI for DSpace",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/dspace/dspace-angular.git"
|
|
||||||
},
|
|
||||||
"license": "BSD-2-Clause",
|
|
||||||
"engines": {
|
|
||||||
"node": "10.* || >= 12.*"
|
|
||||||
},
|
|
||||||
"resolutions": {
|
|
||||||
"serialize-javascript": ">= 2.1.2",
|
|
||||||
"set-value": ">= 2.0.1"
|
|
||||||
},
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"global": "npm install -g @angular/cli marked node-gyp nodemon node-nightly npm-check-updates npm-run-all rimraf typescript ts-node typedoc webpack webpack-bundle-analyzer pm2 rollup",
|
"ng": "ng",
|
||||||
|
"start": "yarn run start:prod",
|
||||||
|
"start:dev": "ng serve",
|
||||||
|
"start:prod": "yarn run build:prod && yarn run serve:ssr",
|
||||||
|
"build": "ng build",
|
||||||
|
"build:prod": "yarn run build:ssr",
|
||||||
|
"build:ssr": "yarn run build:client-and-server-bundles && yarn run compile:server",
|
||||||
|
"build:client-and-server-bundles": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --prod && ng run dspace-angular-cli:server:production --bundleDependencies all",
|
||||||
|
"test": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng test",
|
||||||
|
"test:headless": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng test --watch=false --browsers=ChromeHeadless --code-coverage",
|
||||||
|
"lint": "ng lint",
|
||||||
|
"e2e": "ng e2e",
|
||||||
|
"compile:server": "webpack --config webpack.server.config.js --progress --colors",
|
||||||
|
"serve:ssr": "node dist/server",
|
||||||
|
"ci": "ng lint && yarn run build:prod && yarn test:headless && ng e2e",
|
||||||
"clean:coverage": "rimraf coverage",
|
"clean:coverage": "rimraf coverage",
|
||||||
"clean:dist": "rimraf dist",
|
"clean:dist": "rimraf dist",
|
||||||
"clean:doc": "rimraf doc",
|
"clean:doc": "rimraf doc",
|
||||||
@@ -24,105 +25,56 @@
|
|||||||
"clean:bld": "rimraf build",
|
"clean:bld": "rimraf build",
|
||||||
"clean:node": "rimraf node_modules",
|
"clean:node": "rimraf node_modules",
|
||||||
"clean:prod": "yarn run clean:coverage && yarn run clean:doc && yarn run clean:dist && yarn run clean:log && yarn run clean:json && yarn run clean:bld",
|
"clean:prod": "yarn run clean:coverage && yarn run clean:doc && yarn run clean:dist && yarn run clean:log && yarn run clean:json && yarn run clean:bld",
|
||||||
"clean": "yarn run clean:prod && yarn run clean:node",
|
"clean": "yarn run clean:prod && yarn run clean:node"
|
||||||
"prebuild": "yarn run clean:bld && yarn run clean:dist",
|
|
||||||
"prebuild:ci": "yarn run prebuild",
|
|
||||||
"prebuild:prod": "yarn run prebuild",
|
|
||||||
"build": "node ./scripts/webpack.js --progress --mode development",
|
|
||||||
"build:ci": "yarn run syncbuilddir && node ./scripts/webpack.js --env.aot --env.server --mode development && node ./scripts/webpack.js --env.aot --env.client --mode development",
|
|
||||||
"build:prod": "yarn run syncbuilddir && node ./scripts/webpack.js --env.aot --env.server --mode production && node ./scripts/webpack.js --env.aot --env.client --mode production",
|
|
||||||
"postbuild:prod": "yarn run rollup",
|
|
||||||
"rollup": "rollup -c rollup.config.js",
|
|
||||||
"prestart": "yarn run build:prod",
|
|
||||||
"prestart:dev": "yarn run build",
|
|
||||||
"start": "yarn run server",
|
|
||||||
"start:dev": "yarn run server",
|
|
||||||
"deploy": "pm2 start dist/server.js",
|
|
||||||
"predeploy": "npm run build:prod",
|
|
||||||
"preundeploy": "pm2 stop dist/server.js",
|
|
||||||
"undeploy": "pm2 delete dist/server.js",
|
|
||||||
"postundeploy": "npm run clean:dist",
|
|
||||||
"server": "node dist/server.js",
|
|
||||||
"server:watch": "nodemon dist/server.js",
|
|
||||||
"server:watch:debug": "nodemon --debug dist/server.js",
|
|
||||||
"syncbuilddir": "node ./scripts/sync-build-dir.js",
|
|
||||||
"webpack:watch": "node ./scripts/webpack.js -w --mode development",
|
|
||||||
"watch": "yarn run build && npm-run-all -p webpack:watch server:watch",
|
|
||||||
"watch:debug": "yarn run build && npm-run-all -p webpack:watch server:watch:debug",
|
|
||||||
"predebug": "yarn run build",
|
|
||||||
"predebug:server": "yarn run build",
|
|
||||||
"debug": "node --debug-brk dist/server.js",
|
|
||||||
"debug:server": "node-nightly --inspect --debug-brk dist/server.js",
|
|
||||||
"debug:build": "node-nightly --inspect --debug-brk node_modules/webpack/bin/webpack.js --mode development",
|
|
||||||
"debug:build:prod": "node-nightly --inspect --debug-brk node_modules/webpack/bin/webpack.js --env.aot --env.client --env.server --mode production",
|
|
||||||
"ci": "yarn run lint && yarn run build:ci && yarn run test:headless && npm-run-all -p -r server e2e",
|
|
||||||
"protractor": "node node_modules/protractor/bin/protractor",
|
|
||||||
"pree2e": "yarn run webdriver:update",
|
|
||||||
"e2e": "yarn run protractor",
|
|
||||||
"pretest": "yarn run clean:bld",
|
|
||||||
"pretest:headless": "yarn run pretest",
|
|
||||||
"pretest:watch": "yarn run pretest",
|
|
||||||
"test": "karma start --single-run",
|
|
||||||
"test:headless": "karma start --single-run --browsers ChromeHeadless",
|
|
||||||
"test:watch": "karma start --no-single-run --auto-watch",
|
|
||||||
"webdriver:start": "node node_modules/protractor/bin/webdriver-manager start --seleniumPort 4444",
|
|
||||||
"webdriver:update": "node node_modules/protractor/bin/webdriver-manager update --standalone --gecko false",
|
|
||||||
"lint": "tslint \"src/**/*.ts\" && tslint \"e2e/**/*.ts\"",
|
|
||||||
"docs": "typedoc --options typedoc.json ./src/",
|
|
||||||
"coverage": "http-server -c-1 -o -p 9875 ./coverage",
|
|
||||||
"postinstall": "yarn run patch-protractor",
|
|
||||||
"patch-protractor": "ncp node_modules/webdriver-manager node_modules/protractor/node_modules/webdriver-manager",
|
|
||||||
"sync-i18n": "node ./scripts/sync-i18n-files.js"
|
|
||||||
},
|
},
|
||||||
|
"browser": {
|
||||||
|
"fs": false,
|
||||||
|
"path": false,
|
||||||
|
"http": false,
|
||||||
|
"https": false
|
||||||
|
},
|
||||||
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^8.2.14",
|
"@angular/animations": "~8.2.14",
|
||||||
"@angular/cdk": "8.2.3",
|
"@angular/cdk": "8.2.3",
|
||||||
"@angular/cli": "^8.3.25",
|
"@angular/common": "~8.2.14",
|
||||||
"@angular/common": "^8.2.14",
|
"@angular/compiler": "~8.2.14",
|
||||||
"@angular/core": "^8.2.14",
|
"@angular/core": "~8.2.14",
|
||||||
"@angular/forms": "^8.2.14",
|
"@angular/forms": "~8.2.14",
|
||||||
"@angular/platform-browser": "^8.2.14",
|
"@angular/platform-browser": "~8.2.14",
|
||||||
"@angular/platform-browser-dynamic": "^8.2.14",
|
"@angular/platform-browser-dynamic": "~8.2.14",
|
||||||
"@angular/platform-server": "^8.2.14",
|
"@angular/platform-server": "~8.2.14",
|
||||||
"@angular/router": "^8.2.14",
|
"@angular/router": "~8.2.14",
|
||||||
"@angularclass/bootloader": "1.0.1",
|
"@angularclass/bootloader": "1.0.1",
|
||||||
"@ng-bootstrap/ng-bootstrap": "^5.2.1",
|
"@ng-bootstrap/ng-bootstrap": "5.2.1",
|
||||||
"@ng-dynamic-forms/core": "8.1.1",
|
"@ng-dynamic-forms/core": "8.1.1",
|
||||||
"@ng-dynamic-forms/ui-ng-bootstrap": "8.1.1",
|
"@ng-dynamic-forms/ui-ng-bootstrap": "8.1.1",
|
||||||
"@ngrx/effects": "^8.6.0",
|
"@ngrx/effects": "^8.6.0",
|
||||||
"@ngrx/router-store": "^8.6.0",
|
"@ngrx/router-store": "^8.6.0",
|
||||||
"@ngrx/store": "^8.6.0",
|
"@ngrx/store": "^8.6.0",
|
||||||
"@nguniversal/express-engine": "^8.2.6",
|
"@nguniversal/express-engine": "8.2.6",
|
||||||
|
"@nguniversal/module-map-ngfactory-loader": "v8.2.6",
|
||||||
"@ngx-translate/core": "11.0.1",
|
"@ngx-translate/core": "11.0.1",
|
||||||
"@ngx-translate/http-loader": "4.0.0",
|
|
||||||
"@nicky-lenaers/ngx-scroll-to": "^3.0.1",
|
"@nicky-lenaers/ngx-scroll-to": "^3.0.1",
|
||||||
"angular-idle-preload": "3.0.0",
|
"angular-idle-preload": "3.0.0",
|
||||||
"angular2-text-mask": "9.0.0",
|
"angular2-text-mask": "9.0.0",
|
||||||
"angulartics2": "7.5.2",
|
"angulartics2": "7.5.2",
|
||||||
"body-parser": "1.18.2",
|
|
||||||
"bootstrap": "4.3.1",
|
"bootstrap": "4.3.1",
|
||||||
|
"caniuse-lite": "^1.0.30000697",
|
||||||
"cerialize": "0.1.18",
|
"cerialize": "0.1.18",
|
||||||
"compression": "1.7.1",
|
|
||||||
"cookie-parser": "1.4.3",
|
"cookie-parser": "1.4.3",
|
||||||
"core-js": "^3.6.4",
|
"core-js": "^3.6.4",
|
||||||
"debug-loader": "^0.0.1",
|
"debug-loader": "^0.0.1",
|
||||||
"express": "4.16.2",
|
"express": "4.16.2",
|
||||||
"express-session": "1.15.6",
|
|
||||||
"fast-json-patch": "^2.0.7",
|
"fast-json-patch": "^2.0.7",
|
||||||
"file-saver": "^1.3.8",
|
"file-saver": "^1.3.8",
|
||||||
"font-awesome": "4.7.0",
|
"font-awesome": "4.7.0",
|
||||||
"fork-ts-checker-webpack-plugin": "^0.4.10",
|
|
||||||
"hammerjs": "^2.0.8",
|
|
||||||
"http-server": "0.11.1",
|
|
||||||
"https": "1.0.0",
|
"https": "1.0.0",
|
||||||
"js-cookie": "2.2.0",
|
"js-cookie": "2.2.0",
|
||||||
"js.clone": "0.0.3",
|
|
||||||
"json5": "^2.1.0",
|
"json5": "^2.1.0",
|
||||||
"jsonschema": "1.2.2",
|
"jsonschema": "1.2.2",
|
||||||
"jwt-decode": "^2.2.0",
|
"jwt-decode": "^2.2.0",
|
||||||
"methods": "1.1.2",
|
|
||||||
"moment": "^2.22.1",
|
"moment": "^2.22.1",
|
||||||
"moment-range": "^4.0.2",
|
|
||||||
"morgan": "^1.9.1",
|
"morgan": "^1.9.1",
|
||||||
"ng-mocks": "^8.1.0",
|
"ng-mocks": "^8.1.0",
|
||||||
"ng2-file-upload": "1.2.1",
|
"ng2-file-upload": "1.2.1",
|
||||||
@@ -134,124 +86,70 @@
|
|||||||
"ngx-sortablejs": "^3.1.4",
|
"ngx-sortablejs": "^3.1.4",
|
||||||
"nouislider": "^11.0.0",
|
"nouislider": "^11.0.0",
|
||||||
"pem": "1.13.2",
|
"pem": "1.13.2",
|
||||||
|
"postcss-cli": "^6.0.0",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"rxjs": "6.5.4",
|
"rxjs": "~6.4.0",
|
||||||
"rxjs-spy": "^7.5.1",
|
"rxjs-spy": "^7.5.1",
|
||||||
"sass-resources-loader": "^2.0.0",
|
"sass-resources-loader": "^2.0.0",
|
||||||
"sortablejs": "1.7.0",
|
"sortablejs": "1.7.0",
|
||||||
"text-mask-core": "5.0.1",
|
"tslib": "^1.10.0",
|
||||||
"ts-loader": "^5.2.1",
|
|
||||||
"ts-md5": "^1.2.4",
|
|
||||||
"url-parse": "^1.4.7",
|
|
||||||
"uuid": "^3.2.1",
|
|
||||||
"webfontloader": "1.6.28",
|
"webfontloader": "1.6.28",
|
||||||
"webpack-cli": "^3.2.0",
|
|
||||||
"zone.js": "^0.9.1"
|
"zone.js": "^0.9.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "^0.803.25",
|
"@angular-builders/custom-webpack": "8.4.1",
|
||||||
"@angular/compiler": "^8.2.14",
|
"@angular-devkit/build-angular": "~0.803.25",
|
||||||
"@angular/compiler-cli": "^8.2.14",
|
"@angular/cli": "~8.3.25",
|
||||||
|
"@angular/compiler-cli": "~8.2.14",
|
||||||
|
"@angular/language-service": "~8.2.14",
|
||||||
"@fortawesome/fontawesome-free": "^5.5.0",
|
"@fortawesome/fontawesome-free": "^5.5.0",
|
||||||
"@ngrx/entity": "^8.6.0",
|
|
||||||
"@ngrx/schematics": "^8.6.0",
|
|
||||||
"@ngrx/store-devtools": "^8.6.0",
|
"@ngrx/store-devtools": "^8.6.0",
|
||||||
"@ngtools/webpack": "^8.3.25",
|
"@ngtools/webpack": "^8.3.25",
|
||||||
"@schematics/angular": "^0.7.5",
|
|
||||||
"@types/acorn": "^4.0.3",
|
|
||||||
"@types/cookie-parser": "1.4.1",
|
|
||||||
"@types/deep-freeze": "0.1.1",
|
"@types/deep-freeze": "0.1.1",
|
||||||
"@types/express": "^4.11.1",
|
"@types/express": "^4.17.0",
|
||||||
"@types/express-serve-static-core": "4.16.0",
|
|
||||||
"@types/file-saver": "^1.3.0",
|
"@types/file-saver": "^1.3.0",
|
||||||
"@types/hammerjs": "2.0.35",
|
|
||||||
"@types/jasmine": "^3.3.9",
|
"@types/jasmine": "^3.3.9",
|
||||||
|
"@types/jasminewd2": "~2.0.3",
|
||||||
"@types/js-cookie": "2.1.0",
|
"@types/js-cookie": "2.1.0",
|
||||||
"@types/json5": "^0.0.30",
|
|
||||||
"@types/lodash": "^4.14.110",
|
"@types/lodash": "^4.14.110",
|
||||||
"@types/memory-cache": "0.2.0",
|
"@types/node": "11.15.3",
|
||||||
"@types/mime": "2.0.0",
|
"codelyzer": "^5.0.0",
|
||||||
"@types/node": "^11.11.2",
|
|
||||||
"@types/serve-static": "1.13.2",
|
|
||||||
"@types/uuid": "^3.4.3",
|
|
||||||
"@types/webfontloader": "1.6.29",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^2.12.0",
|
|
||||||
"@typescript-eslint/parser": "^2.12.0",
|
|
||||||
"ajv": "^6.1.1",
|
|
||||||
"ajv-keywords": "^3.1.0",
|
|
||||||
"angular2-template-loader": "0.6.2",
|
|
||||||
"autoprefixer": "^9.1.3",
|
|
||||||
"caniuse-lite": "^1.0.30000697",
|
|
||||||
"cli-progress": "^3.3.1",
|
|
||||||
"codelyzer": "^5.1.0",
|
|
||||||
"commander": "^3.0.2",
|
|
||||||
"compression-webpack-plugin": "^3.0.1",
|
"compression-webpack-plugin": "^3.0.1",
|
||||||
"copy-webpack-plugin": "^5.1.1",
|
"copy-webpack-plugin": "^5.1.1",
|
||||||
"copyfiles": "^2.1.1",
|
|
||||||
"coveralls": "3.0.0",
|
"coveralls": "3.0.0",
|
||||||
"css-loader": "3.4.0",
|
"css-loader": "3.4.0",
|
||||||
"cssnano": "^4.1.10",
|
"cssnano": "^4.1.10",
|
||||||
"deep-freeze": "0.0.1",
|
"deep-freeze": "0.0.1",
|
||||||
"eslint": "^6.7.2",
|
"fork-ts-checker-webpack-plugin": "^0.4.10",
|
||||||
"exports-loader": "^0.7.0",
|
"html-webpack-plugin": "^3.2.0",
|
||||||
"html-webpack-plugin": "3.2.0",
|
|
||||||
"imports-loader": "0.8.0",
|
|
||||||
"istanbul-instrumenter-loader": "3.0.1",
|
|
||||||
"jasmine-core": "^3.3.0",
|
"jasmine-core": "^3.3.0",
|
||||||
"jasmine-marbles": "0.3.1",
|
"jasmine-marbles": "0.3.1",
|
||||||
"jasmine-spec-reporter": "4.2.1",
|
"jasmine-spec-reporter": "~4.2.1",
|
||||||
"karma": "4.0.1",
|
"karma": "~4.1.0",
|
||||||
"karma-chrome-launcher": "2.2.0",
|
"karma-chrome-launcher": "~2.2.0",
|
||||||
"karma-cli": "2.0.0",
|
"karma-coverage-istanbul-reporter": "~2.0.1",
|
||||||
"karma-coverage": "1.1.2",
|
|
||||||
"karma-istanbul-preprocessor": "0.0.2",
|
|
||||||
"karma-jasmine": "2.0.1",
|
"karma-jasmine": "2.0.1",
|
||||||
|
"karma-jasmine-html-reporter": "^1.4.0",
|
||||||
"karma-mocha-reporter": "2.2.5",
|
"karma-mocha-reporter": "2.2.5",
|
||||||
"karma-phantomjs-launcher": "1.0.4",
|
|
||||||
"karma-remap-coverage": "^0.1.5",
|
|
||||||
"karma-remap-istanbul": "0.6.0",
|
|
||||||
"karma-sourcemap-loader": "0.3.7",
|
|
||||||
"karma-webdriver-launcher": "^1.0.7",
|
|
||||||
"karma-webpack": "3.0.0",
|
|
||||||
"ncp": "^2.0.0",
|
|
||||||
"nodemon": "^1.15.0",
|
|
||||||
"npm-run-all": "4.1.3",
|
|
||||||
"optimize-css-assets-webpack-plugin": "^5.0.1",
|
"optimize-css-assets-webpack-plugin": "^5.0.1",
|
||||||
"postcss": "^7.0.2",
|
|
||||||
"postcss-apply": "0.11.0",
|
"postcss-apply": "0.11.0",
|
||||||
"postcss-cli": "^6.0.0",
|
|
||||||
"postcss-cssnext": "3.1.0",
|
"postcss-cssnext": "3.1.0",
|
||||||
"postcss-loader": "^3.0.0",
|
"postcss-loader": "^3.0.0",
|
||||||
"postcss-responsive-type": "1.0.0",
|
"postcss-responsive-type": "1.0.0",
|
||||||
"postcss-smart-import": "0.7.6",
|
"postcss-smart-import": "^0.7.6",
|
||||||
"protractor": "^5.4.2",
|
"protractor": "~5.4.0",
|
||||||
"protractor-istanbul-plugin": "2.0.0",
|
"protractor-istanbul-plugin": "2.0.0",
|
||||||
"raw-loader": "0.5.1",
|
"raw-loader": "0.5.1",
|
||||||
"rimraf": "2.6.2",
|
|
||||||
"rollup": "^0.65.0",
|
|
||||||
"rollup-plugin-commonjs": "^9.1.6",
|
|
||||||
"rollup-plugin-node-globals": "1.2.1",
|
|
||||||
"rollup-plugin-node-resolve": "^3.0.3",
|
|
||||||
"rollup-plugin-terser": "^2.0.2",
|
|
||||||
"sass-loader": "7.3.1",
|
|
||||||
"script-ext-html-webpack-plugin": "2.1.4",
|
"script-ext-html-webpack-plugin": "2.1.4",
|
||||||
"source-map": "0.7.3",
|
|
||||||
"source-map-loader": "0.2.4",
|
|
||||||
"string-replace-loader": "^2.1.1",
|
"string-replace-loader": "^2.1.1",
|
||||||
"terser-webpack-plugin": "^2.3.1",
|
"terser-webpack-plugin": "^2.3.1",
|
||||||
"to-string-loader": "1.1.5",
|
"ts-loader": "^5.2.0",
|
||||||
"ts-helpers": "1.1.2",
|
|
||||||
"ts-node": "4.1.0",
|
"ts-node": "4.1.0",
|
||||||
"tslint": "5.11.0",
|
"tslint": "~5.15.0",
|
||||||
"typedoc": "^0.9.0",
|
"typescript": "~3.5.3",
|
||||||
"typescript": "3.5.3",
|
"webpack": "^4.0.0",
|
||||||
"webdriver-manager": "^12.1.7",
|
|
||||||
"webpack": "^4.29.6",
|
|
||||||
"webpack-bundle-analyzer": "^3.3.2",
|
"webpack-bundle-analyzer": "^3.3.2",
|
||||||
"webpack-dev-middleware": "3.2.0",
|
"webpack-cli": "^3.1.0",
|
||||||
"webpack-dev-server": "^3.1.11",
|
|
||||||
"webpack-import-glob-loader": "^1.6.3",
|
|
||||||
"webpack-merge": "4.1.4",
|
|
||||||
"webpack-node-externals": "1.7.2"
|
"webpack-node-externals": "1.7.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,21 +0,0 @@
|
|||||||
import nodeResolve from 'rollup-plugin-node-resolve'
|
|
||||||
import commonjs from 'rollup-plugin-commonjs';
|
|
||||||
import terser from 'rollup-plugin-terser'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
input: 'dist/client.js',
|
|
||||||
output: {
|
|
||||||
file: 'dist/client.js',
|
|
||||||
format: 'iife',
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
nodeResolve({
|
|
||||||
jsnext: true,
|
|
||||||
module: true
|
|
||||||
}),
|
|
||||||
commonjs({
|
|
||||||
include: 'node_modules/rxjs/**'
|
|
||||||
}),
|
|
||||||
terser.terser()
|
|
||||||
]
|
|
||||||
}
|
|
74
server.ts
Normal file
74
server.ts
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
/**
|
||||||
|
* *** NOTE ON IMPORTING FROM ANGULAR AND NGUNIVERSAL IN THIS FILE ***
|
||||||
|
*
|
||||||
|
* If your application uses third-party dependencies, you'll need to
|
||||||
|
* either use Webpack or the Angular CLI's `bundleDependencies` feature
|
||||||
|
* in order to adequately package them for use on the server without a
|
||||||
|
* node_modules directory.
|
||||||
|
*
|
||||||
|
* However, due to the nature of the CLI's `bundleDependencies`, importing
|
||||||
|
* Angular in this file will create a different instance of Angular than
|
||||||
|
* the version in the compiled application code. This leads to unavoidable
|
||||||
|
* conflicts. Therefore, please do not explicitly import from @angular or
|
||||||
|
* @nguniversal in this file. You can export any needed resources
|
||||||
|
* from your application's main.server.ts file, as seen below with the
|
||||||
|
* import for `ngExpressEngine`.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import 'zone.js/dist/zone-node';
|
||||||
|
import 'reflect-metadata';
|
||||||
|
|
||||||
|
import * as express from 'express';
|
||||||
|
import { join } from 'path';
|
||||||
|
import { REQUEST, RESPONSE } from '@nguniversal/express-engine/tokens';
|
||||||
|
import * as bodyParser from 'body-parser';
|
||||||
|
import * as cookieParser from 'cookie-parser';
|
||||||
|
|
||||||
|
// Express server
|
||||||
|
const app = express();
|
||||||
|
|
||||||
|
const PORT = process.env.PORT || 4000;
|
||||||
|
const DIST_FOLDER = join(process.cwd(), 'dist/browser');
|
||||||
|
|
||||||
|
// * NOTE :: leave this as require() since this file is built Dynamically from webpack
|
||||||
|
const { ServerAppModuleNgFactory, LAZY_MODULE_MAP, ngExpressEngine, provideModuleMap } = require('./dist/server/main');
|
||||||
|
|
||||||
|
app.use(cookieParser());
|
||||||
|
app.use(bodyParser.json());
|
||||||
|
|
||||||
|
app.engine('html', (_, options, callback) =>
|
||||||
|
ngExpressEngine({
|
||||||
|
bootstrap: ServerAppModuleNgFactory,
|
||||||
|
providers: [
|
||||||
|
{
|
||||||
|
provide: REQUEST,
|
||||||
|
useValue: (options as any).req,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provide: RESPONSE,
|
||||||
|
useValue: (options as any).req.res,
|
||||||
|
},
|
||||||
|
provideModuleMap(LAZY_MODULE_MAP)
|
||||||
|
],
|
||||||
|
})(_, options, callback)
|
||||||
|
);
|
||||||
|
|
||||||
|
app.set('view engine', 'html');
|
||||||
|
app.set('views', DIST_FOLDER);
|
||||||
|
|
||||||
|
// Example Express Rest API endpoints
|
||||||
|
// app.get('/api/**', (req, res) => { });
|
||||||
|
// Serve static files from /browser
|
||||||
|
app.get('*.*', express.static(DIST_FOLDER, {
|
||||||
|
maxAge: '1y'
|
||||||
|
}));
|
||||||
|
|
||||||
|
// All regular routes use the Universal engine
|
||||||
|
app.get('*', (req, res) => {
|
||||||
|
res.render('index', { req });
|
||||||
|
});
|
||||||
|
|
||||||
|
// Start up the Node server
|
||||||
|
app.listen(PORT, () => {
|
||||||
|
console.log(`Node Express server listening on http://localhost:${PORT}`);
|
||||||
|
});
|
@@ -1,48 +0,0 @@
|
|||||||
/**
|
|
||||||
* @author: @AngularClass
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* When testing with webpack and ES6, we have to do some extra
|
|
||||||
* things to get testing to work right. Because we are gonna write tests
|
|
||||||
* in ES6 too, we have to compile those as well. That's handled in
|
|
||||||
* karma.conf.js with the karma-webpack plugin. This is the entry
|
|
||||||
* file for webpack test. Just like webpack will create a bundle.js
|
|
||||||
* file for our client, when we run test, it will compile and bundle them
|
|
||||||
* all here! Crazy huh. So we need to do some setup
|
|
||||||
*/
|
|
||||||
Error.stackTraceLimit = Infinity;
|
|
||||||
|
|
||||||
require('core-js/es');
|
|
||||||
require('core-js/features/reflect');
|
|
||||||
|
|
||||||
// Typescript emit helpers polyfill
|
|
||||||
require('ts-helpers');
|
|
||||||
|
|
||||||
require('zone.js/dist/zone');
|
|
||||||
require('zone.js/dist/long-stack-trace-zone');
|
|
||||||
require('zone.js/dist/proxy'); // since zone.js 0.6.15
|
|
||||||
require('zone.js/dist/sync-test');
|
|
||||||
require('zone.js/dist/jasmine-patch'); // put here since zone.js 0.6.14
|
|
||||||
require('zone.js/dist/async-test');
|
|
||||||
require('zone.js/dist/fake-async-test');
|
|
||||||
|
|
||||||
// RxJS
|
|
||||||
require('rxjs');
|
|
||||||
|
|
||||||
var testing = require('@angular/core/testing');
|
|
||||||
var browser = require('@angular/platform-browser-dynamic/testing');
|
|
||||||
|
|
||||||
testing.TestBed.initTestEnvironment(
|
|
||||||
browser.BrowserDynamicTestingModule,
|
|
||||||
browser.platformBrowserDynamicTesting()
|
|
||||||
);
|
|
||||||
|
|
||||||
var tests = require.context('./src', true, /\.spec\.ts$/);
|
|
||||||
|
|
||||||
tests.keys().forEach(tests);
|
|
||||||
|
|
||||||
// includes all modules into test coverage
|
|
||||||
const modules = require.context('./src/app', true, /\.module\.ts$/);
|
|
||||||
|
|
||||||
modules.keys().forEach(modules);
|
|
@@ -11,8 +11,8 @@ import { BitstreamFormatDataService } from '../../../../core/data/bitstream-form
|
|||||||
import { BitstreamFormatSupportLevel } from '../../../../core/shared/bitstream-format-support-level';
|
import { BitstreamFormatSupportLevel } from '../../../../core/shared/bitstream-format-support-level';
|
||||||
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||||
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
||||||
import { RouterStub } from '../../../../shared/testing/router-stub';
|
import { RouterStub } from '../../../../shared/testing/router.stub';
|
||||||
import { AddBitstreamFormatComponent } from './add-bitstream-format.component';
|
import { AddBitstreamFormatComponent } from './add-bitstream-format.component';
|
||||||
|
|
||||||
describe('AddBitstreamFormatComponent', () => {
|
describe('AddBitstreamFormatComponent', () => {
|
||||||
|
@@ -11,10 +11,10 @@ import { PaginationComponent } from '../../../shared/pagination/pagination.compo
|
|||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
||||||
import { HostWindowService } from '../../../shared/host-window.service';
|
import { HostWindowService } from '../../../shared/host-window.service';
|
||||||
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service-stub';
|
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service.stub';
|
||||||
import { BitstreamFormatDataService } from '../../../core/data/bitstream-format-data.service';
|
import { BitstreamFormatDataService } from '../../../core/data/bitstream-format-data.service';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
import { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
import { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
||||||
import { BitstreamFormatSupportLevel } from '../../../core/shared/bitstream-format-support-level';
|
import { BitstreamFormatSupportLevel } from '../../../core/shared/bitstream-format-support-level';
|
||||||
import { cold, getTestScheduler, hot } from 'jasmine-marbles';
|
import { cold, getTestScheduler, hot } from 'jasmine-marbles';
|
||||||
|
@@ -12,8 +12,8 @@ import { RemoteData } from '../../../../core/data/remote-data';
|
|||||||
import { BitstreamFormatSupportLevel } from '../../../../core/shared/bitstream-format-support-level';
|
import { BitstreamFormatSupportLevel } from '../../../../core/shared/bitstream-format-support-level';
|
||||||
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||||
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
||||||
import { RouterStub } from '../../../../shared/testing/router-stub';
|
import { RouterStub } from '../../../../shared/testing/router.stub';
|
||||||
import { EditBitstreamFormatComponent } from './edit-bitstream-format.component';
|
import { EditBitstreamFormatComponent } from './edit-bitstream-format.component';
|
||||||
|
|
||||||
describe('EditBitstreamFormatComponent', () => {
|
describe('EditBitstreamFormatComponent', () => {
|
||||||
|
@@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common';
|
|||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { RouterStub } from '../../../../shared/testing/router-stub';
|
import { RouterStub } from '../../../../shared/testing/router.stub';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { FormatFormComponent } from './format-form.component';
|
import { FormatFormComponent } from './format-form.component';
|
||||||
|
@@ -10,14 +10,14 @@ import { RegistryService } from '../../../core/registry/registry.service';
|
|||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service-stub';
|
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service.stub';
|
||||||
import { HostWindowService } from '../../../shared/host-window.service';
|
import { HostWindowService } from '../../../shared/host-window.service';
|
||||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
import { RestResponse } from '../../../core/cache/response.models';
|
import { RestResponse } from '../../../core/cache/response.models';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/testing/utils';
|
|
||||||
import { MetadataSchema } from '../../../core/metadata/metadata-schema.model';
|
import { MetadataSchema } from '../../../core/metadata/metadata-schema.model';
|
||||||
|
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||||
|
|
||||||
describe('MetadataRegistryComponent', () => {
|
describe('MetadataRegistryComponent', () => {
|
||||||
let comp: MetadataRegistryComponent;
|
let comp: MetadataRegistryComponent;
|
||||||
|
@@ -10,18 +10,18 @@ import { RegistryService } from '../../../core/registry/registry.service';
|
|||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service-stub';
|
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service.stub';
|
||||||
import { HostWindowService } from '../../../shared/host-window.service';
|
import { HostWindowService } from '../../../shared/host-window.service';
|
||||||
import { RouterStub } from '../../../shared/testing/router-stub';
|
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { ActivatedRouteStub } from '../../../shared/testing/active-router-stub';
|
import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
import { RestResponse } from '../../../core/cache/response.models';
|
import { RestResponse } from '../../../core/cache/response.models';
|
||||||
import { MetadataSchema } from '../../../core/metadata/metadata-schema.model';
|
import { MetadataSchema } from '../../../core/metadata/metadata-schema.model';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/testing/utils';
|
|
||||||
import { MetadataField } from '../../../core/metadata/metadata-field.model';
|
import { MetadataField } from '../../../core/metadata/metadata-field.model';
|
||||||
|
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||||
|
|
||||||
describe('MetadataSchemaComponent', () => {
|
describe('MetadataSchemaComponent', () => {
|
||||||
let comp: MetadataSchemaComponent;
|
let comp: MetadataSchemaComponent;
|
||||||
|
@@ -10,7 +10,6 @@ import { Bitstream } from '../../../../../core/shared/bitstream.model';
|
|||||||
import { Item } from '../../../../../core/shared/item.model';
|
import { Item } from '../../../../../core/shared/item.model';
|
||||||
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
||||||
import { SharedModule } from '../../../../../shared/shared.module';
|
import { SharedModule } from '../../../../../shared/shared.module';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/testing/utils';
|
|
||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||||
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
@@ -18,6 +17,7 @@ import { By } from '@angular/platform-browser';
|
|||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
|
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
|
||||||
import { ItemAdminSearchResultGridElementComponent } from './item-admin-search-result-grid-element.component';
|
import { ItemAdminSearchResultGridElementComponent } from './item-admin-search-result-grid-element.component';
|
||||||
|
import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils';
|
||||||
|
|
||||||
describe('ItemAdminSearchResultGridElementComponent', () => {
|
describe('ItemAdminSearchResultGridElementComponent', () => {
|
||||||
let component: ItemAdminSearchResultGridElementComponent;
|
let component: ItemAdminSearchResultGridElementComponent;
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { MenuService } from '../../../shared/menu/menu.service';
|
import { MenuService } from '../../../shared/menu/menu.service';
|
||||||
import { MenuServiceStub } from '../../../shared/testing/menu-service-stub';
|
import { MenuServiceStub } from '../../../shared/testing/menu-service.stub';
|
||||||
import { CSSVariableService } from '../../../shared/sass-helper/sass-helper.service';
|
import { CSSVariableService } from '../../../shared/sass-helper/sass-helper.service';
|
||||||
import { CSSVariableServiceStub } from '../../../shared/testing/css-variable-service-stub';
|
import { CSSVariableServiceStub } from '../../../shared/testing/css-variable-service.stub';
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { AdminSidebarSectionComponent } from './admin-sidebar-section.component';
|
import { AdminSidebarSectionComponent } from './admin-sidebar-section.component';
|
||||||
|
@@ -4,10 +4,10 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||||||
import { ChangeDetectionStrategy, Injector, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, Injector, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { AdminSidebarComponent } from './admin-sidebar.component';
|
import { AdminSidebarComponent } from './admin-sidebar.component';
|
||||||
import { MenuService } from '../../shared/menu/menu.service';
|
import { MenuService } from '../../shared/menu/menu.service';
|
||||||
import { MenuServiceStub } from '../../shared/testing/menu-service-stub';
|
import { MenuServiceStub } from '../../shared/testing/menu-service.stub';
|
||||||
import { CSSVariableService } from '../../shared/sass-helper/sass-helper.service';
|
import { CSSVariableService } from '../../shared/sass-helper/sass-helper.service';
|
||||||
import { CSSVariableServiceStub } from '../../shared/testing/css-variable-service-stub';
|
import { CSSVariableServiceStub } from '../../shared/testing/css-variable-service.stub';
|
||||||
import { AuthServiceStub } from '../../shared/testing/auth-service-stub';
|
import { AuthServiceStub } from '../../shared/testing/auth-service.stub';
|
||||||
import { AuthService } from '../../core/auth/auth.service';
|
import { AuthService } from '../../core/auth/auth.service';
|
||||||
|
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
|
@@ -2,9 +2,9 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
|
|
||||||
import { ExpandableAdminSidebarSectionComponent } from './expandable-admin-sidebar-section.component';
|
import { ExpandableAdminSidebarSectionComponent } from './expandable-admin-sidebar-section.component';
|
||||||
import { MenuService } from '../../../shared/menu/menu.service';
|
import { MenuService } from '../../../shared/menu/menu.service';
|
||||||
import { MenuServiceStub } from '../../../shared/testing/menu-service-stub';
|
import { MenuServiceStub } from '../../../shared/testing/menu-service.stub';
|
||||||
import { CSSVariableService } from '../../../shared/sass-helper/sass-helper.service';
|
import { CSSVariableService } from '../../../shared/sass-helper/sass-helper.service';
|
||||||
import { CSSVariableServiceStub } from '../../../shared/testing/css-variable-service-stub';
|
import { CSSVariableServiceStub } from '../../../shared/testing/css-variable-service.stub';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
@@ -8,17 +8,16 @@ import { EnumKeysPipe } from '../../shared/utils/enum-keys-pipe';
|
|||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { BrowseService } from '../../core/browse/browse.service';
|
import { BrowseService } from '../../core/browse/browse.service';
|
||||||
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
||||||
import { MockRouter } from '../../shared/mocks/mock-router';
|
import { RouterMock } from '../../shared/mocks/router.mock';
|
||||||
import { ChangeDetectorRef, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectorRef, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { of as observableOf } from 'rxjs/internal/observable/of';
|
import { of as observableOf } from 'rxjs/internal/observable/of';
|
||||||
import { ActivatedRouteStub } from '../../shared/testing/active-router-stub';
|
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||||
import { Community } from '../../core/shared/community.model';
|
import { Community } from '../../core/shared/community.model';
|
||||||
import { Item } from '../../core/shared/item.model';
|
import { Item } from '../../core/shared/item.model';
|
||||||
import { ENV_CONFIG, GLOBAL_CONFIG } from '../../../config';
|
|
||||||
import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model';
|
import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model';
|
||||||
import { toRemoteData } from '../+browse-by-metadata-page/browse-by-metadata-page.component.spec';
|
import { toRemoteData } from '../+browse-by-metadata-page/browse-by-metadata-page.component.spec';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils';
|
|
||||||
import { VarDirective } from '../../shared/utils/var.directive';
|
import { VarDirective } from '../../shared/utils/var.directive';
|
||||||
|
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||||
|
|
||||||
describe('BrowseByDatePageComponent', () => {
|
describe('BrowseByDatePageComponent', () => {
|
||||||
let comp: BrowseByDatePageComponent;
|
let comp: BrowseByDatePageComponent;
|
||||||
@@ -71,11 +70,10 @@ describe('BrowseByDatePageComponent', () => {
|
|||||||
imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule],
|
imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule],
|
||||||
declarations: [BrowseByDatePageComponent, EnumKeysPipe, VarDirective],
|
declarations: [BrowseByDatePageComponent, EnumKeysPipe, VarDirective],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: GLOBAL_CONFIG, useValue: ENV_CONFIG },
|
|
||||||
{ provide: ActivatedRoute, useValue: activatedRouteStub },
|
{ provide: ActivatedRoute, useValue: activatedRouteStub },
|
||||||
{ provide: BrowseService, useValue: mockBrowseService },
|
{ provide: BrowseService, useValue: mockBrowseService },
|
||||||
{ provide: DSpaceObjectDataService, useValue: mockDsoService },
|
{ provide: DSpaceObjectDataService, useValue: mockDsoService },
|
||||||
{ provide: Router, useValue: new MockRouter() },
|
{ provide: Router, useValue: new RouterMock() },
|
||||||
{ provide: ChangeDetectorRef, useValue: mockCdRef }
|
{ provide: ChangeDetectorRef, useValue: mockCdRef }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
|
@@ -11,9 +11,9 @@ import { hasValue, isNotEmpty } from '../../shared/empty.util';
|
|||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { BrowseService } from '../../core/browse/browse.service';
|
import { BrowseService } from '../../core/browse/browse.service';
|
||||||
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
||||||
import { GLOBAL_CONFIG, GlobalConfig } from '../../../config';
|
|
||||||
import { StartsWithType } from '../../shared/starts-with/starts-with-decorator';
|
import { StartsWithType } from '../../shared/starts-with/starts-with-decorator';
|
||||||
import { BrowseByType, rendersBrowseBy } from '../+browse-by-switcher/browse-by-decorator';
|
import { BrowseByType, rendersBrowseBy } from '../+browse-by-switcher/browse-by-decorator';
|
||||||
|
import { environment } from '../../../environments/environment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-browse-by-date-page',
|
selector: 'ds-browse-by-date-page',
|
||||||
@@ -33,8 +33,7 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent {
|
|||||||
*/
|
*/
|
||||||
defaultMetadataField = 'dc.date.issued';
|
defaultMetadataField = 'dc.date.issued';
|
||||||
|
|
||||||
public constructor(@Inject(GLOBAL_CONFIG) public config: GlobalConfig,
|
public constructor(protected route: ActivatedRoute,
|
||||||
protected route: ActivatedRoute,
|
|
||||||
protected browseService: BrowseService,
|
protected browseService: BrowseService,
|
||||||
protected dsoService: DSpaceObjectDataService,
|
protected dsoService: DSpaceObjectDataService,
|
||||||
protected router: Router,
|
protected router: Router,
|
||||||
@@ -77,7 +76,7 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent {
|
|||||||
updateStartsWithOptions(definition: string, metadataField: string, scope?: string) {
|
updateStartsWithOptions(definition: string, metadataField: string, scope?: string) {
|
||||||
this.subs.push(
|
this.subs.push(
|
||||||
this.browseService.getFirstItemFor(definition, scope).subscribe((firstItemRD: RemoteData<Item>) => {
|
this.browseService.getFirstItemFor(definition, scope).subscribe((firstItemRD: RemoteData<Item>) => {
|
||||||
let lowerLimit = this.config.browseBy.defaultLowerLimit;
|
let lowerLimit = environment.browseBy.defaultLowerLimit;
|
||||||
if (hasValue(firstItemRD.payload)) {
|
if (hasValue(firstItemRD.payload)) {
|
||||||
const date = firstItemRD.payload.firstMetadataValue(metadataField);
|
const date = firstItemRD.payload.firstMetadataValue(metadataField);
|
||||||
if (hasValue(date)) {
|
if (hasValue(date)) {
|
||||||
@@ -88,8 +87,8 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent {
|
|||||||
}
|
}
|
||||||
const options = [];
|
const options = [];
|
||||||
const currentYear = new Date().getFullYear();
|
const currentYear = new Date().getFullYear();
|
||||||
const oneYearBreak = Math.floor((currentYear - this.config.browseBy.oneYearLimit) / 5) * 5;
|
const oneYearBreak = Math.floor((currentYear - environment.browseBy.oneYearLimit) / 5) * 5;
|
||||||
const fiveYearBreak = Math.floor((currentYear - this.config.browseBy.fiveYearLimit) / 10) * 10;
|
const fiveYearBreak = Math.floor((currentYear - environment.browseBy.fiveYearLimit) / 10) * 10;
|
||||||
if (lowerLimit <= fiveYearBreak) {
|
if (lowerLimit <= fiveYearBreak) {
|
||||||
lowerLimit -= 10;
|
lowerLimit -= 10;
|
||||||
} else if (lowerLimit <= oneYearBreak) {
|
} else if (lowerLimit <= oneYearBreak) {
|
||||||
|
@@ -7,7 +7,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { EnumKeysPipe } from '../../shared/utils/enum-keys-pipe';
|
import { EnumKeysPipe } from '../../shared/utils/enum-keys-pipe';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { ActivatedRouteStub } from '../../shared/testing/active-router-stub';
|
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||||
import { of as observableOf } from 'rxjs/internal/observable/of';
|
import { of as observableOf } from 'rxjs/internal/observable/of';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/internal/Observable';
|
import { Observable } from 'rxjs/internal/Observable';
|
||||||
@@ -19,10 +19,10 @@ import { SortDirection } from '../../core/cache/models/sort-options.model';
|
|||||||
import { Item } from '../../core/shared/item.model';
|
import { Item } from '../../core/shared/item.model';
|
||||||
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
||||||
import { Community } from '../../core/shared/community.model';
|
import { Community } from '../../core/shared/community.model';
|
||||||
import { MockRouter } from '../../shared/mocks/mock-router';
|
import { RouterMock } from '../../shared/mocks/router.mock';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils';
|
|
||||||
import { BrowseEntry } from '../../core/shared/browse-entry.model';
|
import { BrowseEntry } from '../../core/shared/browse-entry.model';
|
||||||
import { VarDirective } from '../../shared/utils/var.directive';
|
import { VarDirective } from '../../shared/utils/var.directive';
|
||||||
|
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||||
|
|
||||||
describe('BrowseByMetadataPageComponent', () => {
|
describe('BrowseByMetadataPageComponent', () => {
|
||||||
let comp: BrowseByMetadataPageComponent;
|
let comp: BrowseByMetadataPageComponent;
|
||||||
@@ -91,7 +91,7 @@ describe('BrowseByMetadataPageComponent', () => {
|
|||||||
{ provide: ActivatedRoute, useValue: activatedRouteStub },
|
{ provide: ActivatedRoute, useValue: activatedRouteStub },
|
||||||
{ provide: BrowseService, useValue: mockBrowseService },
|
{ provide: BrowseService, useValue: mockBrowseService },
|
||||||
{ provide: DSpaceObjectDataService, useValue: mockDsoService },
|
{ provide: DSpaceObjectDataService, useValue: mockDsoService },
|
||||||
{ provide: Router, useValue: new MockRouter() }
|
{ provide: Router, useValue: new RouterMock() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
|
@@ -1,17 +1,17 @@
|
|||||||
import { BrowseBySwitcherComponent } from './browse-by-switcher.component';
|
import { BrowseBySwitcherComponent } from './browse-by-switcher.component';
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ENV_CONFIG, GLOBAL_CONFIG } from '../../../config';
|
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import * as decorator from './browse-by-decorator';
|
import * as decorator from './browse-by-decorator';
|
||||||
import createSpy = jasmine.createSpy;
|
import createSpy = jasmine.createSpy;
|
||||||
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
|
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
|
||||||
|
import { environment } from '../../../environments/environment';
|
||||||
|
|
||||||
describe('BrowseBySwitcherComponent', () => {
|
describe('BrowseBySwitcherComponent', () => {
|
||||||
let comp: BrowseBySwitcherComponent;
|
let comp: BrowseBySwitcherComponent;
|
||||||
let fixture: ComponentFixture<BrowseBySwitcherComponent>;
|
let fixture: ComponentFixture<BrowseBySwitcherComponent>;
|
||||||
|
|
||||||
const types = ENV_CONFIG.browseBy.types;
|
const types = environment.browseBy.types;
|
||||||
|
|
||||||
const params = new BehaviorSubject(createParamsWithId('initialValue'));
|
const params = new BehaviorSubject(createParamsWithId('initialValue'));
|
||||||
|
|
||||||
@@ -23,7 +23,6 @@ describe('BrowseBySwitcherComponent', () => {
|
|||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
declarations: [ BrowseBySwitcherComponent ],
|
declarations: [ BrowseBySwitcherComponent ],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: GLOBAL_CONFIG, useValue: ENV_CONFIG },
|
|
||||||
{ provide: ActivatedRoute, useValue: activatedRouteStub }
|
{ provide: ActivatedRoute, useValue: activatedRouteStub }
|
||||||
],
|
],
|
||||||
schemas: [ NO_ERRORS_SCHEMA ]
|
schemas: [ NO_ERRORS_SCHEMA ]
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
import { Component, Inject, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { Observable } from 'rxjs/internal/Observable';
|
import { Observable } from 'rxjs/internal/Observable';
|
||||||
import { GLOBAL_CONFIG, GlobalConfig } from '../../../config';
|
|
||||||
import { BrowseByTypeConfig } from '../../../config/browse-by-type-config.interface';
|
import { BrowseByTypeConfig } from '../../../config/browse-by-type-config.interface';
|
||||||
import { map, tap } from 'rxjs/operators';
|
import { map, tap } from 'rxjs/operators';
|
||||||
import { getComponentByBrowseByType } from './browse-by-decorator';
|
import { getComponentByBrowseByType } from './browse-by-decorator';
|
||||||
|
import { environment } from '../../../environments/environment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-browse-by-switcher',
|
selector: 'ds-browse-by-switcher',
|
||||||
@@ -20,8 +20,7 @@ export class BrowseBySwitcherComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
browseByComponent: Observable<any>;
|
browseByComponent: Observable<any>;
|
||||||
|
|
||||||
public constructor(@Inject(GLOBAL_CONFIG) public config: GlobalConfig,
|
public constructor(protected route: ActivatedRoute) {
|
||||||
protected route: ActivatedRoute) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,7 +30,7 @@ export class BrowseBySwitcherComponent implements OnInit {
|
|||||||
this.browseByComponent = this.route.params.pipe(
|
this.browseByComponent = this.route.params.pipe(
|
||||||
map((params) => {
|
map((params) => {
|
||||||
const id = params.id;
|
const id = params.id;
|
||||||
return this.config.browseBy.types.find((config: BrowseByTypeConfig) => config.id === id);
|
return environment.browseBy.types.find((config: BrowseByTypeConfig) => config.id === id);
|
||||||
}),
|
}),
|
||||||
map((config: BrowseByTypeConfig) => getComponentByBrowseByType(config.type))
|
map((config: BrowseByTypeConfig) => getComponentByBrowseByType(config.type))
|
||||||
);
|
);
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { Item } from '../../core/shared/item.model';
|
import { Item } from '../../core/shared/item.model';
|
||||||
import { ActivatedRouteStub } from '../../shared/testing/active-router-stub';
|
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||||
import { of as observableOf } from 'rxjs/internal/observable/of';
|
import { of as observableOf } from 'rxjs/internal/observable/of';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
@@ -13,12 +13,11 @@ import { toRemoteData } from '../+browse-by-metadata-page/browse-by-metadata-pag
|
|||||||
import { BrowseByTitlePageComponent } from './browse-by-title-page.component';
|
import { BrowseByTitlePageComponent } from './browse-by-title-page.component';
|
||||||
import { ItemDataService } from '../../core/data/item-data.service';
|
import { ItemDataService } from '../../core/data/item-data.service';
|
||||||
import { Community } from '../../core/shared/community.model';
|
import { Community } from '../../core/shared/community.model';
|
||||||
import { RemoteData } from '../../core/data/remote-data';
|
|
||||||
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
||||||
import { BrowseService } from '../../core/browse/browse.service';
|
import { BrowseService } from '../../core/browse/browse.service';
|
||||||
import { MockRouter } from '../../shared/mocks/mock-router';
|
import { RouterMock } from '../../shared/mocks/router.mock';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils';
|
|
||||||
import { VarDirective } from '../../shared/utils/var.directive';
|
import { VarDirective } from '../../shared/utils/var.directive';
|
||||||
|
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||||
|
|
||||||
describe('BrowseByTitlePageComponent', () => {
|
describe('BrowseByTitlePageComponent', () => {
|
||||||
let comp: BrowseByTitlePageComponent;
|
let comp: BrowseByTitlePageComponent;
|
||||||
@@ -70,7 +69,7 @@ describe('BrowseByTitlePageComponent', () => {
|
|||||||
{ provide: ActivatedRoute, useValue: activatedRouteStub },
|
{ provide: ActivatedRoute, useValue: activatedRouteStub },
|
||||||
{ provide: BrowseService, useValue: mockBrowseService },
|
{ provide: BrowseService, useValue: mockBrowseService },
|
||||||
{ provide: DSpaceObjectDataService, useValue: mockDsoService },
|
{ provide: DSpaceObjectDataService, useValue: mockDsoService },
|
||||||
{ provide: Router, useValue: new MockRouter() }
|
{ provide: Router, useValue: new RouterMock() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
import { first } from 'rxjs/operators';
|
import { first } from 'rxjs/operators';
|
||||||
import { BrowseByGuard } from './browse-by-guard';
|
import { BrowseByGuard } from './browse-by-guard';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { ENV_CONFIG } from '../../config';
|
|
||||||
|
|
||||||
describe('BrowseByGuard', () => {
|
describe('BrowseByGuard', () => {
|
||||||
describe('canActivate', () => {
|
describe('canActivate', () => {
|
||||||
@@ -25,7 +24,7 @@ describe('BrowseByGuard', () => {
|
|||||||
translateService = {
|
translateService = {
|
||||||
instant: () => field
|
instant: () => field
|
||||||
};
|
};
|
||||||
guard = new BrowseByGuard(ENV_CONFIG, dsoService, translateService);
|
guard = new BrowseByGuard(dsoService, translateService);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return true, and sets up the data correctly, with a scope and value', () => {
|
it('should return true, and sets up the data correctly, with a scope and value', () => {
|
||||||
|
@@ -6,7 +6,7 @@ import { map } from 'rxjs/operators';
|
|||||||
import { getSucceededRemoteData } from '../core/shared/operators';
|
import { getSucceededRemoteData } from '../core/shared/operators';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { GLOBAL_CONFIG, GlobalConfig } from '../../config';
|
import { environment } from '../../environments/environment';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
/**
|
/**
|
||||||
@@ -14,8 +14,7 @@ import { GLOBAL_CONFIG, GlobalConfig } from '../../config';
|
|||||||
*/
|
*/
|
||||||
export class BrowseByGuard implements CanActivate {
|
export class BrowseByGuard implements CanActivate {
|
||||||
|
|
||||||
constructor(@Inject(GLOBAL_CONFIG) public config: GlobalConfig,
|
constructor(protected dsoService: DSpaceObjectDataService,
|
||||||
protected dsoService: DSpaceObjectDataService,
|
|
||||||
protected translate: TranslateService) {
|
protected translate: TranslateService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,7 +23,7 @@ export class BrowseByGuard implements CanActivate {
|
|||||||
const id = route.params.id || route.queryParams.id || route.data.id;
|
const id = route.params.id || route.queryParams.id || route.data.id;
|
||||||
let metadataField = route.data.metadataField;
|
let metadataField = route.data.metadataField;
|
||||||
if (hasNoValue(metadataField) && hasValue(id)) {
|
if (hasNoValue(metadataField) && hasValue(id)) {
|
||||||
const config = this.config.browseBy.types.find((conf) => conf.id === id);
|
const config = environment.browseBy.types.find((conf) => conf.id === id);
|
||||||
if (hasValue(config) && hasValue(config.metadataField)) {
|
if (hasValue(config) && hasValue(config.metadataField)) {
|
||||||
metadataField = config.metadataField;
|
metadataField = config.metadataField;
|
||||||
}
|
}
|
||||||
|
@@ -7,11 +7,11 @@ import { CommonModule } from '@angular/common';
|
|||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||||
import { SearchFormComponent } from '../../shared/search-form/search-form.component';
|
import { SearchFormComponent } from '../../shared/search-form/search-form.component';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { ActivatedRouteStub } from '../../shared/testing/active-router-stub';
|
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||||
import { RouterStub } from '../../shared/testing/router-stub';
|
import { RouterStub } from '../../shared/testing/router.stub';
|
||||||
import { SearchServiceStub } from '../../shared/testing/search-service-stub';
|
import { SearchServiceStub } from '../../shared/testing/search-service.stub';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||||
import { ItemDataService } from '../../core/data/item-data.service';
|
import { ItemDataService } from '../../core/data/item-data.service';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { Collection } from '../../core/shared/collection.model';
|
import { Collection } from '../../core/shared/collection.model';
|
||||||
@@ -20,7 +20,7 @@ import { PaginationComponentOptions } from '../../shared/pagination/pagination-c
|
|||||||
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
|
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
|
||||||
import { EventEmitter } from '@angular/core';
|
import { EventEmitter } from '@angular/core';
|
||||||
import { HostWindowService } from '../../shared/host-window.service';
|
import { HostWindowService } from '../../shared/host-window.service';
|
||||||
import { HostWindowServiceStub } from '../../shared/testing/host-window-service-stub';
|
import { HostWindowServiceStub } from '../../shared/testing/host-window-service.stub';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { PaginatedList } from '../../core/data/paginated-list';
|
import { PaginatedList } from '../../core/data/paginated-list';
|
||||||
import { PageInfo } from '../../core/shared/page-info.model';
|
import { PageInfo } from '../../core/shared/page-info.model';
|
||||||
@@ -29,7 +29,7 @@ import { PaginationComponent } from '../../shared/pagination/pagination.componen
|
|||||||
import { EnumKeysPipe } from '../../shared/utils/enum-keys-pipe';
|
import { EnumKeysPipe } from '../../shared/utils/enum-keys-pipe';
|
||||||
import { ItemSelectComponent } from '../../shared/object-select/item-select/item-select.component';
|
import { ItemSelectComponent } from '../../shared/object-select/item-select/item-select.component';
|
||||||
import { ObjectSelectService } from '../../shared/object-select/object-select.service';
|
import { ObjectSelectService } from '../../shared/object-select/object-select.service';
|
||||||
import { ObjectSelectServiceStub } from '../../shared/testing/object-select-service-stub';
|
import { ObjectSelectServiceStub } from '../../shared/testing/object-select-service.stub';
|
||||||
import { VarDirective } from '../../shared/utils/var.directive';
|
import { VarDirective } from '../../shared/utils/var.directive';
|
||||||
import { of as observableOf, of } from 'rxjs/internal/observable/of';
|
import { of as observableOf, of } from 'rxjs/internal/observable/of';
|
||||||
import { RestResponse } from '../../core/cache/response.models';
|
import { RestResponse } from '../../core/cache/response.models';
|
||||||
|
@@ -11,7 +11,7 @@ import { of as observableOf } from 'rxjs';
|
|||||||
import { CommunityDataService } from '../../core/data/community-data.service';
|
import { CommunityDataService } from '../../core/data/community-data.service';
|
||||||
import { CreateCollectionPageComponent } from './create-collection-page.component';
|
import { CreateCollectionPageComponent } from './create-collection-page.component';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||||
|
|
||||||
describe('CreateCollectionPageComponent', () => {
|
describe('CreateCollectionPageComponent', () => {
|
||||||
let comp: CreateCollectionPageComponent;
|
let comp: CreateCollectionPageComponent;
|
||||||
|
@@ -1,11 +1,8 @@
|
|||||||
import { CreateCollectionPageGuard } from './create-collection-page.guard';
|
import { CreateCollectionPageGuard } from './create-collection-page.guard';
|
||||||
import { MockRouter } from '../../shared/mocks/mock-router';
|
import { RouterMock } from '../../shared/mocks/router.mock';
|
||||||
import { Community } from '../../core/shared/community.model';
|
import { Community } from '../../core/shared/community.model';
|
||||||
import { first } from 'rxjs/operators';
|
import { first } from 'rxjs/operators';
|
||||||
import {
|
import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||||
createFailedRemoteDataObject$,
|
|
||||||
createSuccessfulRemoteDataObject$
|
|
||||||
} from '../../shared/testing/utils';
|
|
||||||
|
|
||||||
describe('CreateCollectionPageGuard', () => {
|
describe('CreateCollectionPageGuard', () => {
|
||||||
describe('canActivate', () => {
|
describe('canActivate', () => {
|
||||||
@@ -25,7 +22,7 @@ describe('CreateCollectionPageGuard', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
router = new MockRouter();
|
router = new RouterMock();
|
||||||
|
|
||||||
guard = new CreateCollectionPageGuard(router, communityDataServiceStub);
|
guard = new CreateCollectionPageGuard(router, communityDataServiceStub);
|
||||||
});
|
});
|
||||||
|
@@ -9,7 +9,7 @@ import { of as observableOf } from 'rxjs/internal/observable/of';
|
|||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { CollectionMetadataComponent } from './collection-metadata.component';
|
import { CollectionMetadataComponent } from './collection-metadata.component';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
|
|
||||||
describe('CollectionMetadataComponent', () => {
|
describe('CollectionMetadataComponent', () => {
|
||||||
let comp: CollectionMetadataComponent;
|
let comp: CollectionMetadataComponent;
|
||||||
|
@@ -14,8 +14,7 @@ import { NotificationsService } from '../../../shared/notifications/notification
|
|||||||
import { DynamicFormControlModel, DynamicFormService } from '@ng-dynamic-forms/core';
|
import { DynamicFormControlModel, DynamicFormService } from '@ng-dynamic-forms/core';
|
||||||
import { hasValue } from '../../../shared/empty.util';
|
import { hasValue } from '../../../shared/empty.util';
|
||||||
import { FormControl, FormGroup } from '@angular/forms';
|
import { FormControl, FormGroup } from '@angular/forms';
|
||||||
import { RouterStub } from '../../../shared/testing/router-stub';
|
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||||
import { GLOBAL_CONFIG } from '../../../../config';
|
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { Collection } from '../../../core/shared/collection.model';
|
import { Collection } from '../../../core/shared/collection.model';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
@@ -128,7 +127,6 @@ describe('CollectionSourceComponent', () => {
|
|||||||
{ provide: DynamicFormService, useValue: formService },
|
{ provide: DynamicFormService, useValue: formService },
|
||||||
{ provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: new RemoteData(false, false, true, null, collection) }) } } },
|
{ provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: new RemoteData(false, false, true, null, collection) }) } } },
|
||||||
{ provide: Router, useValue: router },
|
{ provide: Router, useValue: router },
|
||||||
{ provide: GLOBAL_CONFIG, useValue: { collection: { edit: { undoTimeout: 10 } } } as any },
|
|
||||||
{ provide: CollectionDataService, useValue: collectionService },
|
{ provide: CollectionDataService, useValue: collectionService },
|
||||||
{ provide: RequestService, useValue: requestService }
|
{ provide: RequestService, useValue: requestService }
|
||||||
],
|
],
|
||||||
|
@@ -26,12 +26,12 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
import { FieldUpdate, FieldUpdates } from '../../../core/data/object-updates/object-updates.reducer';
|
import { FieldUpdate, FieldUpdates } from '../../../core/data/object-updates/object-updates.reducer';
|
||||||
import { Subscription } from 'rxjs/internal/Subscription';
|
import { Subscription } from 'rxjs/internal/Subscription';
|
||||||
import { cloneDeep } from 'lodash';
|
import { cloneDeep } from 'lodash';
|
||||||
import { GLOBAL_CONFIG, GlobalConfig } from '../../../../config';
|
|
||||||
import { CollectionDataService } from '../../../core/data/collection-data.service';
|
import { CollectionDataService } from '../../../core/data/collection-data.service';
|
||||||
import { getSucceededRemoteData } from '../../../core/shared/operators';
|
import { getSucceededRemoteData } from '../../../core/shared/operators';
|
||||||
import { MetadataConfig } from '../../../core/shared/metadata-config.model';
|
import { MetadataConfig } from '../../../core/shared/metadata-config.model';
|
||||||
import { INotification } from '../../../shared/notifications/models/notification.model';
|
import { INotification } from '../../../shared/notifications/models/notification.model';
|
||||||
import { RequestService } from '../../../core/data/request.service';
|
import { RequestService } from '../../../core/data/request.service';
|
||||||
|
import { environment } from '../../../../environments/environment';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component for managing the content source of the collection
|
* Component for managing the content source of the collection
|
||||||
@@ -236,7 +236,6 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem
|
|||||||
protected translate: TranslateService,
|
protected translate: TranslateService,
|
||||||
protected route: ActivatedRoute,
|
protected route: ActivatedRoute,
|
||||||
protected router: Router,
|
protected router: Router,
|
||||||
@Inject(GLOBAL_CONFIG) protected EnvConfig: GlobalConfig,
|
|
||||||
protected collectionService: CollectionDataService,
|
protected collectionService: CollectionDataService,
|
||||||
protected requestService: RequestService) {
|
protected requestService: RequestService) {
|
||||||
super(objectUpdatesService, notificationsService, translate);
|
super(objectUpdatesService, notificationsService, translate);
|
||||||
@@ -247,7 +246,7 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem
|
|||||||
*/
|
*/
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.notificationsPrefix = 'collection.edit.tabs.source.notifications.';
|
this.notificationsPrefix = 'collection.edit.tabs.source.notifications.';
|
||||||
this.discardTimeOut = this.EnvConfig.collection.edit.undoTimeout;
|
this.discardTimeOut = environment.collection.edit.undoTimeout;
|
||||||
this.url = this.router.url;
|
this.url = this.router.url;
|
||||||
if (this.url.indexOf('?') > 0) {
|
if (this.url.indexOf('?') > 0) {
|
||||||
this.url = this.url.substr(0, this.url.indexOf('?'));
|
this.url = this.url.substr(0, this.url.indexOf('?'));
|
||||||
|
@@ -11,7 +11,7 @@ import { of as observableOf } from 'rxjs';
|
|||||||
import { CommunityDataService } from '../../core/data/community-data.service';
|
import { CommunityDataService } from '../../core/data/community-data.service';
|
||||||
import { CreateCommunityPageComponent } from './create-community-page.component';
|
import { CreateCommunityPageComponent } from './create-community-page.component';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||||
|
|
||||||
describe('CreateCommunityPageComponent', () => {
|
describe('CreateCommunityPageComponent', () => {
|
||||||
let comp: CreateCommunityPageComponent;
|
let comp: CreateCommunityPageComponent;
|
||||||
|
@@ -1,11 +1,8 @@
|
|||||||
import { CreateCommunityPageGuard } from './create-community-page.guard';
|
import { CreateCommunityPageGuard } from './create-community-page.guard';
|
||||||
import { MockRouter } from '../../shared/mocks/mock-router';
|
import { RouterMock } from '../../shared/mocks/router.mock';
|
||||||
import { Community } from '../../core/shared/community.model';
|
import { Community } from '../../core/shared/community.model';
|
||||||
import { first } from 'rxjs/operators';
|
import { first } from 'rxjs/operators';
|
||||||
import {
|
import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||||
createFailedRemoteDataObject$,
|
|
||||||
createSuccessfulRemoteDataObject$
|
|
||||||
} from '../../shared/testing/utils';
|
|
||||||
|
|
||||||
describe('CreateCommunityPageGuard', () => {
|
describe('CreateCommunityPageGuard', () => {
|
||||||
describe('canActivate', () => {
|
describe('canActivate', () => {
|
||||||
@@ -25,7 +22,7 @@ describe('CreateCommunityPageGuard', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
router = new MockRouter();
|
router = new RouterMock();
|
||||||
|
|
||||||
guard = new CreateCommunityPageGuard(router, communityDataServiceStub);
|
guard = new CreateCommunityPageGuard(router, communityDataServiceStub);
|
||||||
});
|
});
|
||||||
|
@@ -9,7 +9,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|||||||
import { CommunityMetadataComponent } from './community-metadata.component';
|
import { CommunityMetadataComponent } from './community-metadata.component';
|
||||||
import { CommunityDataService } from '../../../core/data/community-data.service';
|
import { CommunityDataService } from '../../../core/data/community-data.service';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
|
|
||||||
describe('CommunityMetadataComponent', () => {
|
describe('CommunityMetadataComponent', () => {
|
||||||
let comp: CommunityMetadataComponent;
|
let comp: CommunityMetadataComponent;
|
||||||
|
@@ -12,11 +12,11 @@ import { Community } from '../../core/shared/community.model';
|
|||||||
import { SharedModule } from '../../shared/shared.module';
|
import { SharedModule } from '../../shared/shared.module';
|
||||||
import { CollectionDataService } from '../../core/data/collection-data.service';
|
import { CollectionDataService } from '../../core/data/collection-data.service';
|
||||||
import { FindListOptions } from '../../core/data/request.models';
|
import { FindListOptions } from '../../core/data/request.models';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||||
import { PaginatedList } from '../../core/data/paginated-list';
|
import { PaginatedList } from '../../core/data/paginated-list';
|
||||||
import { PageInfo } from '../../core/shared/page-info.model';
|
import { PageInfo } from '../../core/shared/page-info.model';
|
||||||
import { HostWindowService } from '../../shared/host-window.service';
|
import { HostWindowService } from '../../shared/host-window.service';
|
||||||
import { HostWindowServiceStub } from '../../shared/testing/host-window-service-stub';
|
import { HostWindowServiceStub } from '../../shared/testing/host-window-service.stub';
|
||||||
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
||||||
|
|
||||||
describe('CommunityPageSubCollectionList Component', () => {
|
describe('CommunityPageSubCollectionList Component', () => {
|
||||||
|
@@ -12,10 +12,10 @@ import { Community } from '../../core/shared/community.model';
|
|||||||
import { PaginatedList } from '../../core/data/paginated-list';
|
import { PaginatedList } from '../../core/data/paginated-list';
|
||||||
import { PageInfo } from '../../core/shared/page-info.model';
|
import { PageInfo } from '../../core/shared/page-info.model';
|
||||||
import { SharedModule } from '../../shared/shared.module';
|
import { SharedModule } from '../../shared/shared.module';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||||
import { FindListOptions } from '../../core/data/request.models';
|
import { FindListOptions } from '../../core/data/request.models';
|
||||||
import { HostWindowService } from '../../shared/host-window.service';
|
import { HostWindowService } from '../../shared/host-window.service';
|
||||||
import { HostWindowServiceStub } from '../../shared/testing/host-window-service-stub';
|
import { HostWindowServiceStub } from '../../shared/testing/host-window-service.stub';
|
||||||
import { CommunityDataService } from '../../core/data/community-data.service';
|
import { CommunityDataService } from '../../core/data/community-data.service';
|
||||||
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
||||||
|
|
||||||
|
@@ -12,10 +12,10 @@ import { Community } from '../../core/shared/community.model';
|
|||||||
import { PaginatedList } from '../../core/data/paginated-list';
|
import { PaginatedList } from '../../core/data/paginated-list';
|
||||||
import { PageInfo } from '../../core/shared/page-info.model';
|
import { PageInfo } from '../../core/shared/page-info.model';
|
||||||
import { SharedModule } from '../../shared/shared.module';
|
import { SharedModule } from '../../shared/shared.module';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||||
import { FindListOptions } from '../../core/data/request.models';
|
import { FindListOptions } from '../../core/data/request.models';
|
||||||
import { HostWindowService } from '../../shared/host-window.service';
|
import { HostWindowService } from '../../shared/host-window.service';
|
||||||
import { HostWindowServiceStub } from '../../shared/testing/host-window-service-stub';
|
import { HostWindowServiceStub } from '../../shared/testing/host-window-service.stub';
|
||||||
import { CommunityDataService } from '../../core/data/community-data.service';
|
import { CommunityDataService } from '../../core/data/community-data.service';
|
||||||
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component, Inject, Injectable, OnInit } from '@angular/core';
|
import { Injectable, OnInit } from '@angular/core';
|
||||||
import { FieldUpdate, FieldUpdates } from '../../../core/data/object-updates/object-updates.reducer';
|
import { FieldUpdate, FieldUpdates } from '../../../core/data/object-updates/object-updates.reducer';
|
||||||
import { Observable } from 'rxjs/internal/Observable';
|
import { Observable } from 'rxjs/internal/Observable';
|
||||||
import { Item } from '../../../core/shared/item.model';
|
import { Item } from '../../../core/shared/item.model';
|
||||||
@@ -7,9 +7,9 @@ import { ObjectUpdatesService } from '../../../core/data/object-updates/object-u
|
|||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { GLOBAL_CONFIG, GlobalConfig } from '../../../../config';
|
|
||||||
import { first, map } from 'rxjs/operators';
|
import { first, map } from 'rxjs/operators';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
|
import { environment } from '../../../../environments/environment';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
/**
|
/**
|
||||||
@@ -45,7 +45,6 @@ export abstract class AbstractItemUpdateComponent implements OnInit {
|
|||||||
protected router: Router,
|
protected router: Router,
|
||||||
protected notificationsService: NotificationsService,
|
protected notificationsService: NotificationsService,
|
||||||
protected translateService: TranslateService,
|
protected translateService: TranslateService,
|
||||||
@Inject(GLOBAL_CONFIG) protected EnvConfig: GlobalConfig,
|
|
||||||
protected route: ActivatedRoute
|
protected route: ActivatedRoute
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@@ -63,7 +62,7 @@ export abstract class AbstractItemUpdateComponent implements OnInit {
|
|||||||
this.item = item;
|
this.item = item;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.discardTimeOut = this.EnvConfig.item.edit.undoTimeout;
|
this.discardTimeOut = environment.item.edit.undoTimeout;
|
||||||
this.url = this.router.url;
|
this.url = this.router.url;
|
||||||
if (this.url.indexOf('?') > 0) {
|
if (this.url.indexOf('?') > 0) {
|
||||||
this.url = this.url.substr(0, this.url.indexOf('?'));
|
this.url = this.url.substr(0, this.url.indexOf('?'));
|
||||||
|
@@ -5,7 +5,7 @@ import {findSuccessfulAccordingTo} from './edit-item-operators';
|
|||||||
import {
|
import {
|
||||||
createFailedRemoteDataObject,
|
createFailedRemoteDataObject,
|
||||||
createSuccessfulRemoteDataObject
|
createSuccessfulRemoteDataObject
|
||||||
} from '../../shared/testing/utils';
|
} from '../../shared/remote-data.utils';
|
||||||
|
|
||||||
describe('findSuccessfulAccordingTo', () => {
|
describe('findSuccessfulAccordingTo', () => {
|
||||||
let mockItem1;
|
let mockItem1;
|
||||||
|
@@ -29,12 +29,12 @@ import { PaginationComponentOptions } from '../../../shared/pagination/paginatio
|
|||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
import { SearchFormComponent } from '../../../shared/search-form/search-form.component';
|
import { SearchFormComponent } from '../../../shared/search-form/search-form.component';
|
||||||
import { PaginatedSearchOptions } from '../../../shared/search/paginated-search-options.model';
|
import { PaginatedSearchOptions } from '../../../shared/search/paginated-search-options.model';
|
||||||
import { ActivatedRouteStub } from '../../../shared/testing/active-router-stub';
|
import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub';
|
||||||
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service-stub';
|
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service.stub';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
import { ObjectSelectServiceStub } from '../../../shared/testing/object-select-service-stub';
|
import { ObjectSelectServiceStub } from '../../../shared/testing/object-select-service.stub';
|
||||||
import { RouterStub } from '../../../shared/testing/router-stub';
|
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||||
import { SearchServiceStub } from '../../../shared/testing/search-service-stub';
|
import { SearchServiceStub } from '../../../shared/testing/search-service.stub';
|
||||||
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
||||||
import { VarDirective } from '../../../shared/utils/var.directive';
|
import { VarDirective } from '../../../shared/utils/var.directive';
|
||||||
import { ItemCollectionMapperComponent } from './item-collection-mapper.component';
|
import { ItemCollectionMapperComponent } from './item-collection-mapper.component';
|
||||||
|
@@ -1,31 +1,31 @@
|
|||||||
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { ItemType } from '../../../core/shared/item-relationships/item-type.model';
|
import { ItemType } from '../../../core/shared/item-relationships/item-type.model';
|
||||||
import { Relationship } from '../../../core/shared/item-relationships/relationship.model';
|
import { Relationship } from '../../../core/shared/item-relationships/relationship.model';
|
||||||
import {Item} from '../../../core/shared/item.model';
|
import { Item } from '../../../core/shared/item.model';
|
||||||
import {RouterStub} from '../../../shared/testing/router-stub';
|
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||||
import {of as observableOf} from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import {NotificationsServiceStub} from '../../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
import {CommonModule} from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import {FormsModule} from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import {RouterTestingModule} from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import {TranslateModule} from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import {ItemDataService} from '../../../core/data/item-data.service';
|
import { ItemDataService } from '../../../core/data/item-data.service';
|
||||||
import {NotificationsService} from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
import {By} from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import {ItemDeleteComponent} from './item-delete.component';
|
import { ItemDeleteComponent } from './item-delete.component';
|
||||||
import {getItemEditPath} from '../../item-page-routing.module';
|
import { getItemEditPath } from '../../item-page-routing.module';
|
||||||
import {createSuccessfulRemoteDataObject} from '../../../shared/testing/utils';
|
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
||||||
import {VarDirective} from '../../../shared/utils/var.directive';
|
import { VarDirective } from '../../../shared/utils/var.directive';
|
||||||
import {ObjectUpdatesService} from '../../../core/data/object-updates/object-updates.service';
|
import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service';
|
||||||
import {RelationshipService} from '../../../core/data/relationship.service';
|
import { RelationshipService } from '../../../core/data/relationship.service';
|
||||||
import {RelationshipType} from '../../../core/shared/item-relationships/relationship-type.model';
|
import { RelationshipType } from '../../../core/shared/item-relationships/relationship-type.model';
|
||||||
import {RemoteData} from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import {PaginatedList} from '../../../core/data/paginated-list';
|
import { PaginatedList } from '../../../core/data/paginated-list';
|
||||||
import {PageInfo} from '../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||||
import {EntityTypeService} from '../../../core/data/entity-type.service';
|
import { EntityTypeService } from '../../../core/data/entity-type.service';
|
||||||
|
|
||||||
let comp: ItemDeleteComponent;
|
let comp: ItemDeleteComponent;
|
||||||
let fixture: ComponentFixture<ItemDeleteComponent>;
|
let fixture: ComponentFixture<ItemDeleteComponent>;
|
||||||
|
@@ -15,7 +15,7 @@ import { RegistryService } from '../../../../core/registry/registry.service';
|
|||||||
import { MetadatumViewModel } from '../../../../core/shared/metadata.models';
|
import { MetadatumViewModel } from '../../../../core/shared/metadata.models';
|
||||||
import { InputSuggestion } from '../../../../shared/input-suggestions/input-suggestions.model';
|
import { InputSuggestion } from '../../../../shared/input-suggestions/input-suggestions.model';
|
||||||
import { SharedModule } from '../../../../shared/shared.module';
|
import { SharedModule } from '../../../../shared/shared.module';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils';
|
||||||
import { EditInPlaceFieldComponent } from './edit-in-place-field.component';
|
import { EditInPlaceFieldComponent } from './edit-in-place-field.component';
|
||||||
|
|
||||||
let comp: EditInPlaceFieldComponent;
|
let comp: EditInPlaceFieldComponent;
|
||||||
|
@@ -85,7 +85,7 @@ export class EditInPlaceFieldComponent implements OnInit, OnChanges {
|
|||||||
* Method to check the validity of a form control
|
* Method to check the validity of a form control
|
||||||
* @param ngModel
|
* @param ngModel
|
||||||
*/
|
*/
|
||||||
private checkValidity(ngModel: NgModel) {
|
public checkValidity(ngModel: NgModel) {
|
||||||
ngModel.control.setValue(ngModel.viewModel);
|
ngModel.control.setValue(ngModel.viewModel);
|
||||||
ngModel.control.updateValueAndValidity();
|
ngModel.control.updateValueAndValidity();
|
||||||
this.objectUpdatesService.setValidFieldUpdate(this.url, this.metadata.uuid, ngModel.control.valid);
|
this.objectUpdatesService.setValidFieldUpdate(this.url, this.metadata.uuid, ngModel.control.valid);
|
||||||
|
@@ -16,8 +16,7 @@ import {
|
|||||||
Notification
|
Notification
|
||||||
} from '../../../shared/notifications/models/notification.model';
|
} from '../../../shared/notifications/models/notification.model';
|
||||||
import { NotificationType } from '../../../shared/notifications/models/notification-type';
|
import { NotificationType } from '../../../shared/notifications/models/notification-type';
|
||||||
import { RouterStub } from '../../../shared/testing/router-stub';
|
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||||
import { GLOBAL_CONFIG } from '../../../../config';
|
|
||||||
import { Item } from '../../../core/shared/item.model';
|
import { Item } from '../../../core/shared/item.model';
|
||||||
import { FieldChangeType } from '../../../core/data/object-updates/object-updates.actions';
|
import { FieldChangeType } from '../../../core/data/object-updates/object-updates.actions';
|
||||||
import { MetadatumViewModel } from '../../../core/shared/metadata.models';
|
import { MetadatumViewModel } from '../../../core/shared/metadata.models';
|
||||||
@@ -29,7 +28,7 @@ import { MetadataField } from '../../../core/metadata/metadata-field.model';
|
|||||||
import {
|
import {
|
||||||
createSuccessfulRemoteDataObject,
|
createSuccessfulRemoteDataObject,
|
||||||
createSuccessfulRemoteDataObject$
|
createSuccessfulRemoteDataObject$
|
||||||
} from '../../../shared/testing/utils';
|
} from '../../../shared/remote-data.utils';
|
||||||
|
|
||||||
let comp: any;
|
let comp: any;
|
||||||
let fixture: ComponentFixture<ItemMetadataComponent>;
|
let fixture: ComponentFixture<ItemMetadataComponent>;
|
||||||
@@ -130,7 +129,7 @@ describe('ItemMetadataComponent', () => {
|
|||||||
paginatedMetadataFields = new PaginatedList(undefined, [mdField1, mdField2, mdField3]);
|
paginatedMetadataFields = new PaginatedList(undefined, [mdField1, mdField2, mdField3]);
|
||||||
|
|
||||||
metadataFieldService = jasmine.createSpyObj({
|
metadataFieldService = jasmine.createSpyObj({
|
||||||
getAllMetadataFields:createSuccessfulRemoteDataObject$(paginatedMetadataFields)
|
getAllMetadataFields: createSuccessfulRemoteDataObject$(paginatedMetadataFields)
|
||||||
});
|
});
|
||||||
scheduler = getTestScheduler();
|
scheduler = getTestScheduler();
|
||||||
objectUpdatesService = jasmine.createSpyObj('objectUpdatesService',
|
objectUpdatesService = jasmine.createSpyObj('objectUpdatesService',
|
||||||
@@ -161,7 +160,6 @@ describe('ItemMetadataComponent', () => {
|
|||||||
{ provide: Router, useValue: router },
|
{ provide: Router, useValue: router },
|
||||||
{ provide: ActivatedRoute, useValue: routeStub },
|
{ provide: ActivatedRoute, useValue: routeStub },
|
||||||
{ provide: NotificationsService, useValue: notificationsService },
|
{ provide: NotificationsService, useValue: notificationsService },
|
||||||
{ provide: GLOBAL_CONFIG, useValue: { item: { edit: { undoTimeout: 10 } } } as any },
|
|
||||||
{ provide: RegistryService, useValue: metadataFieldService },
|
{ provide: RegistryService, useValue: metadataFieldService },
|
||||||
], schemas: [
|
], schemas: [
|
||||||
NO_ERRORS_SCHEMA
|
NO_ERRORS_SCHEMA
|
||||||
|
@@ -13,7 +13,6 @@ import { first, map, switchMap, take, tap } from 'rxjs/operators';
|
|||||||
import { getSucceededRemoteData } from '../../../core/shared/operators';
|
import { getSucceededRemoteData } from '../../../core/shared/operators';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { GLOBAL_CONFIG, GlobalConfig } from '../../../../config';
|
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { RegistryService } from '../../../core/registry/registry.service';
|
import { RegistryService } from '../../../core/registry/registry.service';
|
||||||
import { MetadatumViewModel } from '../../../core/shared/metadata.models';
|
import { MetadatumViewModel } from '../../../core/shared/metadata.models';
|
||||||
@@ -42,11 +41,10 @@ export class ItemMetadataComponent extends AbstractItemUpdateComponent {
|
|||||||
protected router: Router,
|
protected router: Router,
|
||||||
protected notificationsService: NotificationsService,
|
protected notificationsService: NotificationsService,
|
||||||
protected translateService: TranslateService,
|
protected translateService: TranslateService,
|
||||||
@Inject(GLOBAL_CONFIG) protected EnvConfig: GlobalConfig,
|
|
||||||
protected route: ActivatedRoute,
|
protected route: ActivatedRoute,
|
||||||
protected metadataFieldService: RegistryService,
|
protected metadataFieldService: RegistryService,
|
||||||
) {
|
) {
|
||||||
super(itemService, objectUpdatesService, router, notificationsService, translateService, EnvConfig, route);
|
super(itemService, objectUpdatesService, router, notificationsService, translateService, route);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -15,8 +15,8 @@ import { Collection } from '../../../core/shared/collection.model';
|
|||||||
import { Item } from '../../../core/shared/item.model';
|
import { Item } from '../../../core/shared/item.model';
|
||||||
import { SearchService } from '../../../core/shared/search/search.service';
|
import { SearchService } from '../../../core/shared/search/search.service';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
import { RouterStub } from '../../../shared/testing/router-stub';
|
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||||
import { ItemMoveComponent } from './item-move.component';
|
import { ItemMoveComponent } from './item-move.component';
|
||||||
|
|
||||||
describe('ItemMoveComponent', () => {
|
describe('ItemMoveComponent', () => {
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { Item } from '../../../core/shared/item.model';
|
import { Item } from '../../../core/shared/item.model';
|
||||||
import { RouterStub } from '../../../shared/testing/router-stub';
|
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
@@ -16,7 +16,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { ItemPrivateComponent } from './item-private.component';
|
import { ItemPrivateComponent } from './item-private.component';
|
||||||
import { RestResponse } from '../../../core/cache/response.models';
|
import { RestResponse } from '../../../core/cache/response.models';
|
||||||
import { createSuccessfulRemoteDataObject } from '../../../shared/testing/utils';
|
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
||||||
|
|
||||||
let comp: ItemPrivateComponent;
|
let comp: ItemPrivateComponent;
|
||||||
let fixture: ComponentFixture<ItemPrivateComponent>;
|
let fixture: ComponentFixture<ItemPrivateComponent>;
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { Item } from '../../../core/shared/item.model';
|
import { Item } from '../../../core/shared/item.model';
|
||||||
import { RouterStub } from '../../../shared/testing/router-stub';
|
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
@@ -16,7 +16,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { ItemPublicComponent } from './item-public.component';
|
import { ItemPublicComponent } from './item-public.component';
|
||||||
import { RestResponse } from '../../../core/cache/response.models';
|
import { RestResponse } from '../../../core/cache/response.models';
|
||||||
import { createSuccessfulRemoteDataObject } from '../../../shared/testing/utils';
|
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
||||||
|
|
||||||
let comp: ItemPublicComponent;
|
let comp: ItemPublicComponent;
|
||||||
let fixture: ComponentFixture<ItemPublicComponent>;
|
let fixture: ComponentFixture<ItemPublicComponent>;
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { Item } from '../../../core/shared/item.model';
|
import { Item } from '../../../core/shared/item.model';
|
||||||
import { RouterStub } from '../../../shared/testing/router-stub';
|
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
@@ -16,7 +16,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { ItemReinstateComponent } from './item-reinstate.component';
|
import { ItemReinstateComponent } from './item-reinstate.component';
|
||||||
import { RestResponse } from '../../../core/cache/response.models';
|
import { RestResponse } from '../../../core/cache/response.models';
|
||||||
import { createSuccessfulRemoteDataObject } from '../../../shared/testing/utils';
|
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
||||||
|
|
||||||
let comp: ItemReinstateComponent;
|
let comp: ItemReinstateComponent;
|
||||||
let fixture: ComponentFixture<ItemReinstateComponent>;
|
let fixture: ComponentFixture<ItemReinstateComponent>;
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
@import '../../../../../styles/variables.scss';
|
|
||||||
|
|
||||||
.relationship-row:not(.alert-danger) {
|
.relationship-row:not(.alert-danger) {
|
||||||
padding: $alert-padding-y 0;
|
padding: $alert-padding-y 0;
|
||||||
}
|
}
|
||||||
|
@@ -14,7 +14,7 @@ import { RelationshipType } from '../../../../core/shared/item-relationships/rel
|
|||||||
import { Relationship } from '../../../../core/shared/item-relationships/relationship.model';
|
import { Relationship } from '../../../../core/shared/item-relationships/relationship.model';
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||||
import { getMockLinkService } from '../../../../shared/mocks/mock-link-service';
|
import { getMockLinkService } from '../../../../shared/mocks/link-service.mock';
|
||||||
import { SharedModule } from '../../../../shared/shared.module';
|
import { SharedModule } from '../../../../shared/shared.module';
|
||||||
import { EditRelationshipListComponent } from './edit-relationship-list.component';
|
import { EditRelationshipListComponent } from './edit-relationship-list.component';
|
||||||
|
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
@import '../../../../../styles/variables.scss';
|
|
||||||
|
|
||||||
.btn[disabled] {
|
.btn[disabled] {
|
||||||
color: $gray-600;
|
color: $gray-600;
|
||||||
border-color: $gray-600;
|
border-color: $gray-600;
|
||||||
|
@@ -40,8 +40,8 @@ export class EditRelationshipComponent implements OnChanges {
|
|||||||
return this.fieldUpdate.field as Relationship;
|
return this.fieldUpdate.field as Relationship;
|
||||||
}
|
}
|
||||||
|
|
||||||
private leftItem$: Observable<Item>;
|
public leftItem$: Observable<Item>;
|
||||||
private rightItem$: Observable<Item>;
|
public rightItem$: Observable<Item>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The related item of this relationship
|
* The related item of this relationship
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
@import '../../../../styles/variables.scss';
|
|
||||||
|
|
||||||
.button-row {
|
.button-row {
|
||||||
.btn {
|
.btn {
|
||||||
margin-right: 0.5 * $spacer;
|
margin-right: 0.5 * $spacer;
|
||||||
|
@@ -5,7 +5,6 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||||||
import { getTestScheduler } from 'jasmine-marbles';
|
import { getTestScheduler } from 'jasmine-marbles';
|
||||||
import { combineLatest as observableCombineLatest, of as observableOf } from 'rxjs';
|
import { combineLatest as observableCombineLatest, of as observableOf } from 'rxjs';
|
||||||
import { TestScheduler } from 'rxjs/testing';
|
import { TestScheduler } from 'rxjs/testing';
|
||||||
import { GLOBAL_CONFIG } from '../../../../config';
|
|
||||||
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
||||||
import { RestResponse } from '../../../core/cache/response.models';
|
import { RestResponse } from '../../../core/cache/response.models';
|
||||||
import { EntityTypeService } from '../../../core/data/entity-type.service';
|
import { EntityTypeService } from '../../../core/data/entity-type.service';
|
||||||
@@ -28,7 +27,7 @@ import {
|
|||||||
} from '../../../shared/notifications/models/notification.model';
|
} from '../../../shared/notifications/models/notification.model';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { SharedModule } from '../../../shared/shared.module';
|
import { SharedModule } from '../../../shared/shared.module';
|
||||||
import { RouterStub } from '../../../shared/testing/router-stub';
|
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||||
import { ItemRelationshipsComponent } from './item-relationships.component';
|
import { ItemRelationshipsComponent } from './item-relationships.component';
|
||||||
|
|
||||||
let comp: any;
|
let comp: any;
|
||||||
@@ -221,7 +220,6 @@ describe('ItemRelationshipsComponent', () => {
|
|||||||
{ provide: Router, useValue: router },
|
{ provide: Router, useValue: router },
|
||||||
{ provide: ActivatedRoute, useValue: routeStub },
|
{ provide: ActivatedRoute, useValue: routeStub },
|
||||||
{ provide: NotificationsService, useValue: notificationsService },
|
{ provide: NotificationsService, useValue: notificationsService },
|
||||||
{ provide: GLOBAL_CONFIG, useValue: { item: { edit: { undoTimeout: 10 } } } as any },
|
|
||||||
{ provide: RelationshipService, useValue: relationshipService },
|
{ provide: RelationshipService, useValue: relationshipService },
|
||||||
{ provide: EntityTypeService, useValue: entityTypeService },
|
{ provide: EntityTypeService, useValue: entityTypeService },
|
||||||
{ provide: ObjectCacheService, useValue: objectCache },
|
{ provide: ObjectCacheService, useValue: objectCache },
|
||||||
|
@@ -11,7 +11,6 @@ import { ObjectUpdatesService } from '../../../core/data/object-updates/object-u
|
|||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { GLOBAL_CONFIG, GlobalConfig } from '../../../../config';
|
|
||||||
import { RelationshipService } from '../../../core/data/relationship.service';
|
import { RelationshipService } from '../../../core/data/relationship.service';
|
||||||
import { ErrorResponse, RestResponse } from '../../../core/cache/response.models';
|
import { ErrorResponse, RestResponse } from '../../../core/cache/response.models';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
@@ -54,7 +53,6 @@ export class ItemRelationshipsComponent extends AbstractItemUpdateComponent impl
|
|||||||
protected router: Router,
|
protected router: Router,
|
||||||
protected notificationsService: NotificationsService,
|
protected notificationsService: NotificationsService,
|
||||||
protected translateService: TranslateService,
|
protected translateService: TranslateService,
|
||||||
@Inject(GLOBAL_CONFIG) protected EnvConfig: GlobalConfig,
|
|
||||||
protected route: ActivatedRoute,
|
protected route: ActivatedRoute,
|
||||||
protected relationshipService: RelationshipService,
|
protected relationshipService: RelationshipService,
|
||||||
protected objectCache: ObjectCacheService,
|
protected objectCache: ObjectCacheService,
|
||||||
@@ -62,7 +60,7 @@ export class ItemRelationshipsComponent extends AbstractItemUpdateComponent impl
|
|||||||
protected entityTypeService: EntityTypeService,
|
protected entityTypeService: EntityTypeService,
|
||||||
protected cdr: ChangeDetectorRef,
|
protected cdr: ChangeDetectorRef,
|
||||||
) {
|
) {
|
||||||
super(itemService, objectUpdatesService, router, notificationsService, translateService, EnvConfig, route);
|
super(itemService, objectUpdatesService, router, notificationsService, translateService, route);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -3,7 +3,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service-stub';
|
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service.stub';
|
||||||
import { HostWindowService } from '../../../shared/host-window.service';
|
import { HostWindowService } from '../../../shared/host-window.service';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
@@ -11,7 +11,7 @@ import { Item } from '../../../core/shared/item.model';
|
|||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { createSuccessfulRemoteDataObject } from '../../../shared/testing/utils';
|
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
||||||
|
|
||||||
describe('ItemStatusComponent', () => {
|
describe('ItemStatusComponent', () => {
|
||||||
let comp: ItemStatusComponent;
|
let comp: ItemStatusComponent;
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { Item } from '../../../core/shared/item.model';
|
import { Item } from '../../../core/shared/item.model';
|
||||||
import { RouterStub } from '../../../shared/testing/router-stub';
|
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
@@ -16,7 +16,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|||||||
import { ItemWithdrawComponent } from './item-withdraw.component';
|
import { ItemWithdrawComponent } from './item-withdraw.component';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { RestResponse } from '../../../core/cache/response.models';
|
import { RestResponse } from '../../../core/cache/response.models';
|
||||||
import { createSuccessfulRemoteDataObject } from '../../../shared/testing/utils';
|
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
||||||
|
|
||||||
let comp: ItemWithdrawComponent;
|
let comp: ItemWithdrawComponent;
|
||||||
let fixture: ComponentFixture<ItemWithdrawComponent>;
|
let fixture: ComponentFixture<ItemWithdrawComponent>;
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { Item } from '../../../core/shared/item.model';
|
import { Item } from '../../../core/shared/item.model';
|
||||||
import { RouterStub } from '../../../shared/testing/router-stub';
|
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
@@ -20,7 +20,7 @@ import { RestResponse } from '../../../core/cache/response.models';
|
|||||||
import {
|
import {
|
||||||
createSuccessfulRemoteDataObject,
|
createSuccessfulRemoteDataObject,
|
||||||
createSuccessfulRemoteDataObject$
|
createSuccessfulRemoteDataObject$
|
||||||
} from '../../../shared/testing/utils';
|
} from '../../../shared/remote-data.utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test component that implements the AbstractSimpleItemActionComponent used to test the
|
* Test component that implements the AbstractSimpleItemActionComponent used to test the
|
||||||
|
@@ -52,7 +52,7 @@ export class VirtualMetadataComponent implements OnInit {
|
|||||||
return [this.leftItem, this.rightItem];
|
return [this.leftItem, this.rightItem];
|
||||||
}
|
}
|
||||||
|
|
||||||
private virtualMetadata: Map<string, VirtualMetadata[]> = new Map<string, VirtualMetadata[]>();
|
public virtualMetadata: Map<string, VirtualMetadata[]> = new Map<string, VirtualMetadata[]>();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected objectUpdatesService: ObjectUpdatesService,
|
protected objectUpdatesService: ObjectUpdatesService,
|
||||||
|
@@ -6,8 +6,8 @@ import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data
|
|||||||
import { CollectionDataService } from '../../../core/data/collection-data.service';
|
import { CollectionDataService } from '../../../core/data/collection-data.service';
|
||||||
import { Collection } from '../../../core/shared/collection.model';
|
import { Collection } from '../../../core/shared/collection.model';
|
||||||
import { Item } from '../../../core/shared/item.model';
|
import { Item } from '../../../core/shared/item.model';
|
||||||
import { getMockRemoteDataBuildService } from '../../../shared/mocks/mock-remote-data-build.service';
|
import { getMockRemoteDataBuildService } from '../../../shared/mocks/remote-data-build.service.mock';
|
||||||
import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../../../shared/testing/utils';
|
import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||||
import { CollectionsComponent } from './collections.component';
|
import { CollectionsComponent } from './collections.component';
|
||||||
|
|
||||||
let collectionsComponent: CollectionsComponent;
|
let collectionsComponent: CollectionsComponent;
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { ChangeDetectionStrategy, DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { MockTranslateLoader } from '../../../shared/mocks/mock-translate-loader';
|
import { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { MetadataUriValuesComponent } from './metadata-uri-values.component';
|
import { MetadataUriValuesComponent } from './metadata-uri-values.component';
|
||||||
import { isNotEmpty } from '../../../shared/empty.util';
|
import { isNotEmpty } from '../../../shared/empty.util';
|
||||||
@@ -30,7 +30,7 @@ describe('MetadataUriValuesComponent', () => {
|
|||||||
imports: [TranslateModule.forRoot({
|
imports: [TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: MockTranslateLoader
|
useClass: TranslateLoaderMock
|
||||||
}
|
}
|
||||||
})],
|
})],
|
||||||
declarations: [MetadataUriValuesComponent],
|
declarations: [MetadataUriValuesComponent],
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { MockTranslateLoader } from '../../../shared/mocks/mock-translate-loader';
|
import { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock';
|
||||||
import { MetadataValuesComponent } from './metadata-values.component';
|
import { MetadataValuesComponent } from './metadata-values.component';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { MetadataValue } from '../../../core/shared/metadata.models';
|
import { MetadataValue } from '../../../core/shared/metadata.models';
|
||||||
@@ -31,7 +31,7 @@ describe('MetadataValuesComponent', () => {
|
|||||||
imports: [TranslateModule.forRoot({
|
imports: [TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: MockTranslateLoader
|
useClass: TranslateLoaderMock
|
||||||
}
|
}
|
||||||
})],
|
})],
|
||||||
declarations: [MetadataValuesComponent],
|
declarations: [MetadataValuesComponent],
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { ItemDataService } from '../../core/data/item-data.service';
|
import { ItemDataService } from '../../core/data/item-data.service';
|
||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { MockTranslateLoader } from '../../shared/mocks/mock-translate-loader';
|
import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock';
|
||||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { TruncatePipe } from '../../shared/utils/truncate.pipe';
|
import { TruncatePipe } from '../../shared/utils/truncate.pipe';
|
||||||
import { FullItemPageComponent } from './full-item-page.component';
|
import { FullItemPageComponent } from './full-item-page.component';
|
||||||
import { MetadataService } from '../../core/metadata/metadata.service';
|
import { MetadataService } from '../../core/metadata/metadata.service';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { ActivatedRouteStub } from '../../shared/testing/active-router-stub';
|
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||||
import { VarDirective } from '../../shared/utils/var.directive';
|
import { VarDirective } from '../../shared/utils/var.directive';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { Item } from '../../core/shared/item.model';
|
import { Item } from '../../core/shared/item.model';
|
||||||
@@ -20,7 +20,7 @@ import { By } from '@angular/platform-browser';
|
|||||||
import {
|
import {
|
||||||
createSuccessfulRemoteDataObject,
|
createSuccessfulRemoteDataObject,
|
||||||
createSuccessfulRemoteDataObject$
|
createSuccessfulRemoteDataObject$
|
||||||
} from '../../shared/testing/utils';
|
} from '../../shared/remote-data.utils';
|
||||||
|
|
||||||
const mockItem: Item = Object.assign(new Item(), {
|
const mockItem: Item = Object.assign(new Item(), {
|
||||||
bundles: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])),
|
bundles: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])),
|
||||||
@@ -51,7 +51,7 @@ describe('FullItemPageComponent', () => {
|
|||||||
imports: [TranslateModule.forRoot({
|
imports: [TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: MockTranslateLoader
|
useClass: TranslateLoaderMock
|
||||||
}
|
}
|
||||||
}), RouterTestingModule.withRoutes([]), BrowserAnimationsModule],
|
}), RouterTestingModule.withRoutes([]), BrowserAnimationsModule],
|
||||||
declarations: [FullItemPageComponent, TruncatePipe, VarDirective],
|
declarations: [FullItemPageComponent, TruncatePipe, VarDirective],
|
||||||
|
@@ -2,7 +2,7 @@ import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
|||||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { ItemPageAbstractFieldComponent } from './item-page-abstract-field.component';
|
import { ItemPageAbstractFieldComponent } from './item-page-abstract-field.component';
|
||||||
import { MockTranslateLoader } from '../../../../../shared/testing/mock-translate-loader';
|
import { TranslateLoaderMock } from '../../../../../shared/testing/translate-loader.mock';
|
||||||
import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component';
|
import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component';
|
||||||
import { mockItemWithMetadataFieldAndValue } from '../item-page-field.component.spec';
|
import { mockItemWithMetadataFieldAndValue } from '../item-page-field.component.spec';
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ describe('ItemPageAbstractFieldComponent', () => {
|
|||||||
imports: [TranslateModule.forRoot({
|
imports: [TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: MockTranslateLoader
|
useClass: TranslateLoaderMock
|
||||||
}
|
}
|
||||||
})],
|
})],
|
||||||
declarations: [ItemPageAbstractFieldComponent, MetadataValuesComponent],
|
declarations: [ItemPageAbstractFieldComponent, MetadataValuesComponent],
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { MockTranslateLoader } from '../../../../../shared/testing/mock-translate-loader';
|
import { TranslateLoaderMock } from '../../../../../shared/testing/translate-loader.mock';
|
||||||
import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component';
|
import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component';
|
||||||
import { mockItemWithMetadataFieldAndValue } from '../item-page-field.component.spec';
|
import { mockItemWithMetadataFieldAndValue } from '../item-page-field.component.spec';
|
||||||
import { ItemPageAuthorFieldComponent } from './item-page-author-field.component';
|
import { ItemPageAuthorFieldComponent } from './item-page-author-field.component';
|
||||||
@@ -18,7 +18,7 @@ describe('ItemPageAuthorFieldComponent', () => {
|
|||||||
imports: [TranslateModule.forRoot({
|
imports: [TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: MockTranslateLoader
|
useClass: TranslateLoaderMock
|
||||||
}
|
}
|
||||||
})],
|
})],
|
||||||
declarations: [ItemPageAuthorFieldComponent, MetadataValuesComponent],
|
declarations: [ItemPageAuthorFieldComponent, MetadataValuesComponent],
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { MockTranslateLoader } from '../../../../../shared/testing/mock-translate-loader';
|
import { TranslateLoaderMock } from '../../../../../shared/testing/translate-loader.mock';
|
||||||
import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component';
|
import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component';
|
||||||
import { mockItemWithMetadataFieldAndValue } from '../item-page-field.component.spec';
|
import { mockItemWithMetadataFieldAndValue } from '../item-page-field.component.spec';
|
||||||
import { ItemPageDateFieldComponent } from './item-page-date-field.component';
|
import { ItemPageDateFieldComponent } from './item-page-date-field.component';
|
||||||
@@ -18,7 +18,7 @@ describe('ItemPageDateFieldComponent', () => {
|
|||||||
imports: [TranslateModule.forRoot({
|
imports: [TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: MockTranslateLoader
|
useClass: TranslateLoaderMock
|
||||||
}
|
}
|
||||||
})],
|
})],
|
||||||
declarations: [ItemPageDateFieldComponent, MetadataValuesComponent],
|
declarations: [ItemPageDateFieldComponent, MetadataValuesComponent],
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { MockTranslateLoader } from '../../../../../shared/testing/mock-translate-loader';
|
import { TranslateLoaderMock } from '../../../../../shared/testing/translate-loader.mock';
|
||||||
import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component';
|
import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component';
|
||||||
import { mockItemWithMetadataFieldAndValue } from '../item-page-field.component.spec';
|
import { mockItemWithMetadataFieldAndValue } from '../item-page-field.component.spec';
|
||||||
import { GenericItemPageFieldComponent } from './generic-item-page-field.component';
|
import { GenericItemPageFieldComponent } from './generic-item-page-field.component';
|
||||||
@@ -20,7 +20,7 @@ describe('GenericItemPageFieldComponent', () => {
|
|||||||
imports: [TranslateModule.forRoot({
|
imports: [TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: MockTranslateLoader
|
useClass: TranslateLoaderMock
|
||||||
}
|
}
|
||||||
})],
|
})],
|
||||||
declarations: [GenericItemPageFieldComponent, MetadataValuesComponent],
|
declarations: [GenericItemPageFieldComponent, MetadataValuesComponent],
|
||||||
|
@@ -3,12 +3,12 @@ import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { Item } from '../../../../core/shared/item.model';
|
import { Item } from '../../../../core/shared/item.model';
|
||||||
import { PaginatedList } from '../../../../core/data/paginated-list';
|
import { PaginatedList } from '../../../../core/data/paginated-list';
|
||||||
import { MockTranslateLoader } from '../../../../shared/mocks/mock-translate-loader';
|
import { TranslateLoaderMock } from '../../../../shared/mocks/translate-loader.mock';
|
||||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||||
import { ItemPageFieldComponent } from './item-page-field.component';
|
import { ItemPageFieldComponent } from './item-page-field.component';
|
||||||
import { MetadataValuesComponent } from '../../../field-components/metadata-values/metadata-values.component';
|
import { MetadataValuesComponent } from '../../../field-components/metadata-values/metadata-values.component';
|
||||||
import { MetadataMap, MetadataValue } from '../../../../core/shared/metadata.models';
|
import { MetadataMap, MetadataValue } from '../../../../core/shared/metadata.models';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils';
|
||||||
|
|
||||||
let comp: ItemPageFieldComponent;
|
let comp: ItemPageFieldComponent;
|
||||||
let fixture: ComponentFixture<ItemPageFieldComponent>;
|
let fixture: ComponentFixture<ItemPageFieldComponent>;
|
||||||
@@ -24,7 +24,7 @@ describe('ItemPageFieldComponent', () => {
|
|||||||
imports: [TranslateModule.forRoot({
|
imports: [TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: MockTranslateLoader
|
useClass: TranslateLoaderMock
|
||||||
}
|
}
|
||||||
})],
|
})],
|
||||||
declarations: [ItemPageFieldComponent, MetadataValuesComponent],
|
declarations: [ItemPageFieldComponent, MetadataValuesComponent],
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { MockTranslateLoader } from '../../../../../shared/testing/mock-translate-loader';
|
import { TranslateLoaderMock } from '../../../../../shared/testing/translate-loader.mock';
|
||||||
import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component';
|
import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component';
|
||||||
import { mockItemWithMetadataFieldAndValue } from '../item-page-field.component.spec';
|
import { mockItemWithMetadataFieldAndValue } from '../item-page-field.component.spec';
|
||||||
import { ItemPageTitleFieldComponent } from './item-page-title-field.component';
|
import { ItemPageTitleFieldComponent } from './item-page-title-field.component';
|
||||||
@@ -18,7 +18,7 @@ describe('ItemPageTitleFieldComponent', () => {
|
|||||||
imports: [TranslateModule.forRoot({
|
imports: [TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: MockTranslateLoader
|
useClass: TranslateLoaderMock
|
||||||
}
|
}
|
||||||
})],
|
})],
|
||||||
declarations: [ItemPageTitleFieldComponent, MetadataValuesComponent],
|
declarations: [ItemPageTitleFieldComponent, MetadataValuesComponent],
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { MockTranslateLoader } from '../../../../../shared/testing/mock-translate-loader';
|
import { TranslateLoaderMock } from '../../../../../shared/testing/translate-loader.mock';
|
||||||
import { mockItemWithMetadataFieldAndValue } from '../item-page-field.component.spec';
|
import { mockItemWithMetadataFieldAndValue } from '../item-page-field.component.spec';
|
||||||
import { ItemPageUriFieldComponent } from './item-page-uri-field.component';
|
import { ItemPageUriFieldComponent } from './item-page-uri-field.component';
|
||||||
import { MetadataUriValuesComponent } from '../../../../field-components/metadata-uri-values/metadata-uri-values.component';
|
import { MetadataUriValuesComponent } from '../../../../field-components/metadata-uri-values/metadata-uri-values.component';
|
||||||
@@ -19,7 +19,7 @@ describe('ItemPageUriFieldComponent', () => {
|
|||||||
imports: [TranslateModule.forRoot({
|
imports: [TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: MockTranslateLoader
|
useClass: TranslateLoaderMock
|
||||||
}
|
}
|
||||||
})],
|
})],
|
||||||
declarations: [ItemPageUriFieldComponent, MetadataUriValuesComponent],
|
declarations: [ItemPageUriFieldComponent, MetadataUriValuesComponent],
|
||||||
|
@@ -1,6 +1,3 @@
|
|||||||
@import '../../../styles/variables.scss';
|
|
||||||
@import '../../../styles/mixins.scss';
|
|
||||||
|
|
||||||
@include media-breakpoint-down(md) {
|
@include media-breakpoint-down(md) {
|
||||||
.container {
|
.container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { MockTranslateLoader } from '../../shared/mocks/mock-translate-loader';
|
import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock';
|
||||||
import { ItemDataService } from '../../core/data/item-data.service';
|
import { ItemDataService } from '../../core/data/item-data.service';
|
||||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ItemPageComponent } from './item-page.component';
|
import { ItemPageComponent } from './item-page.component';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { ActivatedRouteStub } from '../../shared/testing/active-router-stub';
|
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||||
import { MetadataService } from '../../core/metadata/metadata.service';
|
import { MetadataService } from '../../core/metadata/metadata.service';
|
||||||
import { VarDirective } from '../../shared/utils/var.directive';
|
import { VarDirective } from '../../shared/utils/var.directive';
|
||||||
import { RemoteData } from '../../core/data/remote-data';
|
import { RemoteData } from '../../core/data/remote-data';
|
||||||
@@ -19,7 +19,7 @@ import { of as observableOf } from 'rxjs';
|
|||||||
import {
|
import {
|
||||||
createFailedRemoteDataObject$, createPendingRemoteDataObject$, createSuccessfulRemoteDataObject,
|
createFailedRemoteDataObject$, createPendingRemoteDataObject$, createSuccessfulRemoteDataObject,
|
||||||
createSuccessfulRemoteDataObject$
|
createSuccessfulRemoteDataObject$
|
||||||
} from '../../shared/testing/utils';
|
} from '../../shared/remote-data.utils';
|
||||||
|
|
||||||
const mockItem: Item = Object.assign(new Item(), {
|
const mockItem: Item = Object.assign(new Item(), {
|
||||||
bundles: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])),
|
bundles: createSuccessfulRemoteDataObject$(new PaginatedList(new PageInfo(), [])),
|
||||||
@@ -45,7 +45,7 @@ describe('ItemPageComponent', () => {
|
|||||||
imports: [TranslateModule.forRoot({
|
imports: [TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: MockTranslateLoader
|
useClass: TranslateLoaderMock
|
||||||
}
|
}
|
||||||
}), BrowserAnimationsModule],
|
}), BrowserAnimationsModule],
|
||||||
declarations: [ItemPageComponent, VarDirective],
|
declarations: [ItemPageComponent, VarDirective],
|
||||||
|
@@ -21,9 +21,9 @@ import { Item } from '../../../../core/shared/item.model';
|
|||||||
import { MetadataMap } from '../../../../core/shared/metadata.models';
|
import { MetadataMap } from '../../../../core/shared/metadata.models';
|
||||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||||
import { UUIDService } from '../../../../core/shared/uuid.service';
|
import { UUIDService } from '../../../../core/shared/uuid.service';
|
||||||
import { MockTranslateLoader } from '../../../../shared/mocks/mock-translate-loader';
|
import { TranslateLoaderMock } from '../../../../shared/mocks/translate-loader.mock';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils';
|
||||||
import { TruncatableService } from '../../../../shared/truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../shared/truncatable/truncatable.service';
|
||||||
import { TruncatePipe } from '../../../../shared/utils/truncate.pipe';
|
import { TruncatePipe } from '../../../../shared/utils/truncate.pipe';
|
||||||
import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component';
|
import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component';
|
||||||
@@ -50,7 +50,7 @@ describe('PublicationComponent', () => {
|
|||||||
imports: [TranslateModule.forRoot({
|
imports: [TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: MockTranslateLoader
|
useClass: TranslateLoaderMock
|
||||||
}
|
}
|
||||||
})],
|
})],
|
||||||
declarations: [PublicationComponent, GenericItemPageFieldComponent, TruncatePipe],
|
declarations: [PublicationComponent, GenericItemPageFieldComponent, TruncatePipe],
|
||||||
|
@@ -23,9 +23,9 @@ import { Item } from '../../../../core/shared/item.model';
|
|||||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||||
import { UUIDService } from '../../../../core/shared/uuid.service';
|
import { UUIDService } from '../../../../core/shared/uuid.service';
|
||||||
import { isNotEmpty } from '../../../../shared/empty.util';
|
import { isNotEmpty } from '../../../../shared/empty.util';
|
||||||
import { MockTranslateLoader } from '../../../../shared/mocks/mock-translate-loader';
|
import { TranslateLoaderMock } from '../../../../shared/mocks/translate-loader.mock';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/testing/utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils';
|
||||||
import { TruncatableService } from '../../../../shared/truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../shared/truncatable/truncatable.service';
|
||||||
import { TruncatePipe } from '../../../../shared/utils/truncate.pipe';
|
import { TruncatePipe } from '../../../../shared/utils/truncate.pipe';
|
||||||
import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component';
|
import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component';
|
||||||
@@ -54,7 +54,7 @@ export function getItemPageFieldsTest(mockItem: Item, component) {
|
|||||||
imports: [TranslateModule.forRoot({
|
imports: [TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: MockTranslateLoader
|
useClass: TranslateLoaderMock
|
||||||
}
|
}
|
||||||
})],
|
})],
|
||||||
declarations: [component, GenericItemPageFieldComponent, TruncatePipe],
|
declarations: [component, GenericItemPageFieldComponent, TruncatePipe],
|
||||||
|
@@ -5,7 +5,7 @@ import { MetadataRepresentationListComponent } from './metadata-representation-l
|
|||||||
import { RelationshipService } from '../../../core/data/relationship.service';
|
import { RelationshipService } from '../../../core/data/relationship.service';
|
||||||
import { Item } from '../../../core/shared/item.model';
|
import { Item } from '../../../core/shared/item.model';
|
||||||
import { Relationship } from '../../../core/shared/item-relationships/relationship.model';
|
import { Relationship } from '../../../core/shared/item-relationships/relationship.model';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/testing/utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { VarDirective } from '../../../shared/utils/var.directive';
|
import { VarDirective } from '../../../shared/utils/var.directive';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
|
@@ -5,7 +5,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
|||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { TabbedRelatedEntitiesSearchComponent } from './tabbed-related-entities-search.component';
|
import { TabbedRelatedEntitiesSearchComponent } from './tabbed-related-entities-search.component';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { MockRouter } from '../../../../shared/mocks/mock-router';
|
import { RouterMock } from '../../../../shared/mocks/router.mock';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { VarDirective } from '../../../../shared/utils/var.directive';
|
import { VarDirective } from '../../../../shared/utils/var.directive';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
@@ -25,7 +25,7 @@ describe('TabbedRelatedEntitiesSearchComponent', () => {
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const router = new MockRouter();
|
const router = new RouterMock();
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
|
@@ -6,7 +6,7 @@ import { PaginatedList } from '../../../core/data/paginated-list';
|
|||||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { createRelationshipsObservable } from '../item-types/shared/item.component.spec';
|
import { createRelationshipsObservable } from '../item-types/shared/item.component.spec';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/testing/utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||||
import { RelationshipService } from '../../../core/data/relationship.service';
|
import { RelationshipService } from '../../../core/data/relationship.service';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { VarDirective } from '../../../shared/utils/var.directive';
|
import { VarDirective } from '../../../shared/utils/var.directive';
|
||||||
|
@@ -7,7 +7,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
|
|
||||||
import { LoginPageComponent } from './login-page.component';
|
import { LoginPageComponent } from './login-page.component';
|
||||||
import { ActivatedRouteStub } from '../shared/testing/active-router-stub';
|
import { ActivatedRouteStub } from '../shared/testing/active-router.stub';
|
||||||
|
|
||||||
describe('LoginPageComponent', () => {
|
describe('LoginPageComponent', () => {
|
||||||
let comp: LoginPageComponent;
|
let comp: LoginPageComponent;
|
||||||
|
@@ -3,7 +3,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { ObjectNotFoundComponent } from './objectnotfound.component';
|
import { ObjectNotFoundComponent } from './objectnotfound.component';
|
||||||
import { ActivatedRouteStub } from '../../shared/testing/active-router-stub';
|
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
@@ -5,8 +5,8 @@ import { PaginatedSearchOptions } from '../shared/search/paginated-search-option
|
|||||||
import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model';
|
import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model';
|
||||||
import { SortDirection, SortOptions } from '../core/cache/models/sort-options.model';
|
import { SortDirection, SortOptions } from '../core/cache/models/sort-options.model';
|
||||||
import { SearchFilter } from '../shared/search/search-filter.model';
|
import { SearchFilter } from '../shared/search/search-filter.model';
|
||||||
import { ActivatedRouteStub } from '../shared/testing/active-router-stub';
|
import { ActivatedRouteStub } from '../shared/testing/active-router.stub';
|
||||||
import { MockRoleService } from '../shared/mocks/mock-role-service';
|
import { RoleServiceMock } from '../shared/mocks/role-service.mock';
|
||||||
import { cold, hot } from 'jasmine-marbles';
|
import { cold, hot } from 'jasmine-marbles';
|
||||||
import { MyDSpaceConfigurationValueType } from './my-dspace-configuration-value-type';
|
import { MyDSpaceConfigurationValueType } from './my-dspace-configuration-value-type';
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ describe('MyDSpaceConfigurationService', () => {
|
|||||||
|
|
||||||
const activatedRoute: any = new ActivatedRouteStub();
|
const activatedRoute: any = new ActivatedRouteStub();
|
||||||
|
|
||||||
const roleService: any = new MockRoleService();
|
const roleService: any = new RoleServiceMock();
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
service = new MyDSpaceConfigurationService(roleService, spy, activatedRoute);
|
service = new MyDSpaceConfigurationService(roleService, spy, activatedRoute);
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
<ds-uploader *ngIf="uploadFilesOptions.url !== ''"
|
<ds-uploader *ngIf="uploadFilesOptions.url !== ''"
|
||||||
[uploadFilesOptions]="uploadFilesOptions"
|
[uploadFilesOptions]="uploadFilesOptions"
|
||||||
(onCompleteItem)="onCompleteItem($event)"
|
(onCompleteItem)="onCompleteItem($event)"
|
||||||
(onUploadError)="onUploadError($event)"></ds-uploader>
|
(onUploadError)="onUploadError()"></ds-uploader>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="add">
|
<div class="add">
|
||||||
|
@@ -8,18 +8,18 @@ import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-transla
|
|||||||
import { ScrollToService } from '@nicky-lenaers/ngx-scroll-to';
|
import { ScrollToService } from '@nicky-lenaers/ngx-scroll-to';
|
||||||
|
|
||||||
import { HALEndpointService } from '../../core/shared/hal-endpoint.service';
|
import { HALEndpointService } from '../../core/shared/hal-endpoint.service';
|
||||||
import { AuthServiceStub } from '../../shared/testing/auth-service-stub';
|
import { AuthServiceStub } from '../../shared/testing/auth-service.stub';
|
||||||
import { AuthService } from '../../core/auth/auth.service';
|
import { AuthService } from '../../core/auth/auth.service';
|
||||||
import { HALEndpointServiceStub } from '../../shared/testing/hal-endpoint-service-stub';
|
import { HalEndpointServiceStub } from '../../shared/testing/hal-endpoint-service.stub';
|
||||||
import { createTestComponent } from '../../shared/testing/utils';
|
import { createTestComponent } from '../../shared/testing/utils.test';
|
||||||
import { MyDSpaceNewSubmissionComponent } from './my-dspace-new-submission.component';
|
import { MyDSpaceNewSubmissionComponent } from './my-dspace-new-submission.component';
|
||||||
import { AppState } from '../../app.reducer';
|
import { AppState } from '../../app.reducer';
|
||||||
import { MockTranslateLoader } from '../../shared/mocks/mock-translate-loader';
|
import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock';
|
||||||
import { getMockTranslateService } from '../../shared/mocks/mock-translate.service';
|
import { getMockTranslateService } from '../../shared/mocks/translate.service.mock';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service-stub';
|
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||||
import { SharedModule } from '../../shared/shared.module';
|
import { SharedModule } from '../../shared/shared.module';
|
||||||
import { getMockScrollToService } from '../../shared/mocks/mock-scroll-to-service';
|
import { getMockScrollToService } from '../../shared/mocks/scroll-to-service.mock';
|
||||||
import { UploaderService } from '../../shared/uploader/uploader.service';
|
import { UploaderService } from '../../shared/uploader/uploader.service';
|
||||||
|
|
||||||
describe('MyDSpaceNewSubmissionComponent test', () => {
|
describe('MyDSpaceNewSubmissionComponent test', () => {
|
||||||
@@ -39,7 +39,7 @@ describe('MyDSpaceNewSubmissionComponent test', () => {
|
|||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: MockTranslateLoader
|
useClass: TranslateLoaderMock
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
@@ -49,7 +49,7 @@ describe('MyDSpaceNewSubmissionComponent test', () => {
|
|||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: AuthService, useClass: AuthServiceStub },
|
{ provide: AuthService, useClass: AuthServiceStub },
|
||||||
{ provide: HALEndpointService, useValue: new HALEndpointServiceStub('workspaceitems') },
|
{ provide: HALEndpointService, useValue: new HalEndpointServiceStub('workspaceitems') },
|
||||||
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
|
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
|
||||||
{ provide: ScrollToService, useValue: getMockScrollToService() },
|
{ provide: ScrollToService, useValue: getMockScrollToService() },
|
||||||
{ provide: Store, useValue: store },
|
{ provide: Store, useValue: store },
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<ds-my-dspace-new-submission *dsShowOnlyForRole="[roleTypeEnum.Submitter]"
|
<ds-my-dspace-new-submission *dsShowOnlyForRole="[roleTypeEnum.Submitter]"></ds-my-dspace-new-submission>
|
||||||
(uploadEnd)="reload($event)"></ds-my-dspace-new-submission>
|
|
||||||
<div class="search-page row">
|
<div class="search-page row">
|
||||||
<ds-search-sidebar *ngIf="!(isXsOrSm$ | async)" class="col-3 sidebar-md-sticky"
|
<ds-search-sidebar *ngIf="!(isXsOrSm$ | async)" class="col-3 sidebar-md-sticky"
|
||||||
id="search-sidebar"
|
id="search-sidebar"
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user