Skip to content

Commit 2cad570

Browse files
committed
Merged dspace-cris-2023_02_x into dspace-cris-2023_02_x-UXP-124
2 parents bd4cdc7 + 533cdea commit 2cad570

98 files changed

Lines changed: 1415 additions & 8553 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bitbucket-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
options:
2-
runs-on: ubuntu-latest
2+
runs-on: self.hosted
33

44
definitions:
55
steps:
@@ -15,7 +15,7 @@ definitions:
1515
- yarn install --frozen-lockfile
1616
- yarn run lint --quiet
1717
- yarn run check-circ-deps
18-
- yarn run build:prod
18+
- yarn run build:prod:ci
1919
- yarn run test:headless
2020

2121
pipelines:

config/config.example.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,10 @@ item:
308308
# Rounded to the nearest size in the list of selectable sizes on the
309309
# settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'.
310310
pageSize: 5
311+
# The maximum number of metadata values to add to the metatag list of the item page
312+
metatagLimit: 20
313+
# The maximum number of values for repeatable metadata to show in the full item
314+
metadataLimit: 20
311315

312316
# When the search results are retrieved, for each item type the metadata with a valid authority value are inspected.
313317
# Referenced items will be fetched with a find all by id strategy to avoid individual rest requests

nohup.out

Lines changed: 0 additions & 7948 deletions
This file was deleted.

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dspace-angular",
3-
"version": "2023.02.03-SNAPSHOT",
3+
"version": "2023.02.04-SNAPSHOT",
44
"scripts": {
55
"ng": "ng",
66
"config:watch": "nodemon",
@@ -17,8 +17,11 @@
1717
"build:stats": "ng build --stats-json",
1818
"build:ci": "ng config cli.cache.environment ci && yarn run build:ssr",
1919
"build:prod": "cross-env NODE_ENV=production yarn run build:ssr",
20-
"build:ssr": "npm run ng-high-memory -- build --configuration production && ng run dspace-angular:server:production",
21-
"ng-high-memory": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng",
20+
"build:prod:ci": "cross-env NODE_ENV=production yarn run build:ssr:ci",
21+
"build:ssr": "npm run ng-high-memory -- build --configuration production && npm run ng-high-memory -- run dspace-angular:server:production",
22+
"build:ssr:ci": "npm run ng-mid-memory -- build --configuration production && npm run ng-mid-memory -- run dspace-angular:server:production",
23+
"ng-high-memory": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng",
24+
"ng-mid-memory": "node --max-old-space-size=4096 node_modules/@angular/cli/bin/ng",
2225
"test": "npm run ng-high-memory -- test --source-map=true --watch=false --configuration test",
2326
"test:watch": "nodemon --exec \"npm run ng-high-memory -- test --source-map=true --watch=true --configuration test\"",
2427
"test:headless": "npm run ng-high-memory -- test --source-map=true --watch=false --configuration test --browsers=ChromeHeadless --code-coverage",
@@ -140,7 +143,6 @@
140143
"ng2-nouislider": "^2.0.0",
141144
"ngx-infinite-scroll": "^15.0.0",
142145
"ngx-pagination": "6.0.3",
143-
"ngx-sortablejs": "^11.1.0",
144146
"ngx-ui-switch": "^14.0.3",
145147
"nouislider": "^15.7.1",
146148
"pem": "1.14.7",
@@ -149,7 +151,6 @@
149151
"reflect-metadata": "^0.1.13",
150152
"rxjs": "^7.8.0",
151153
"sanitize-html": "^2.10.0",
152-
"sortablejs": "1.15.0",
153154
"uuid": "^8.3.2",
154155
"webfontloader": "1.6.28",
155156
"zone.js": "~0.11.5"

src/app/core/json-patch/builder/json-patch-operations-builder.ts

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import { VocabularyEntry } from '../../submission/vocabularies/models/vocabulary
1313
import { FormFieldMetadataValueObject } from '../../../shared/form/builder/models/form-field-metadata-value.model';
1414
import { FormFieldLanguageValueObject } from '../../../shared/form/builder/models/form-field-language-value.model';
1515
import { CoreState } from '../../core-state.model';
16+
import { Metadata } from '../../shared/metadata.utils';
17+
import { ConfidenceType } from '../../shared/confidence-type';
1618

1719
/**
1820
* Provides methods to dispatch JsonPatch Operations Actions
@@ -110,27 +112,25 @@ export class JsonPatchOperationsBuilder {
110112
operationValue = [];
111113
value.forEach((entry) => {
112114
if ((typeof entry === 'object')) {
113-
if (securityLevel != null) {
115+
if (isNotEmpty(securityLevel)) {
114116
operationValue.push(this.prepareObjectValue(entry, securityLevel));
115117
} else {
116118
operationValue.push(this.prepareObjectValue(entry));
117119
}
118-
119120
} else {
120121
operationValue.push(new FormFieldMetadataValueObject(entry, null, securityLevel));
121122
}
122123
});
123124
} else if (typeof value === 'object') {
124-
if (securityLevel != null) {
125+
if (isNotEmpty(securityLevel)) {
125126
operationValue = this.prepareObjectValue(value, securityLevel);
126127
} else {
127128
operationValue = this.prepareObjectValue(value);
128129
}
129-
130130
} else {
131131
// add the possibility to add security level when value is string
132132
// in this case security level is set on metadata value
133-
if (securityLevel != null) {
133+
if (isNotEmpty(securityLevel)) {
134134
operationValue = new FormFieldMetadataValueObject(value, null, securityLevel);
135135
} else {
136136
operationValue = new FormFieldMetadataValueObject(value, null);
@@ -143,21 +143,26 @@ export class JsonPatchOperationsBuilder {
143143
}
144144

145145
protected prepareObjectValue(value: any, securityLevel = null) {
146-
let operationValue = Object.create({});
146+
let operationValue = Object.create({});
147147
if (isEmpty(value) || value instanceof FormFieldMetadataValueObject) {
148-
if (securityLevel != null) {
149-
operationValue = {...value, securityLevel: securityLevel};
150-
} else {
148+
if (isNotEmpty(securityLevel)) {
149+
operationValue = { ...value, securityLevel: securityLevel };
150+
} else {
151151
operationValue = value;
152152
}
153+
//Update confidence if was added once the field was already created, value is set only in constructor of FormFieldMetadataValueObject
154+
if (Metadata.hasValidAuthority(operationValue.authority) && (isEmpty(operationValue.confidence) || operationValue.confidence === -1)) {
155+
operationValue.confidence = ConfidenceType.CF_ACCEPTED;
156+
}
157+
153158
} else if (value instanceof Date) {
154159
if (securityLevel != null) {
155-
operationValue = new FormFieldMetadataValueObject(dateToISOFormat(value), null, securityLevel);
160+
operationValue = new FormFieldMetadataValueObject(dateToISOFormat(value), null, securityLevel);
156161
} else {
157162
operationValue = new FormFieldMetadataValueObject(dateToISOFormat(value));
158163
}
159164
} else if (value instanceof VocabularyEntry) {
160-
operationValue = this.prepareAuthorityValue(value);
165+
operationValue = new FormFieldMetadataValueObject(value.value, null, value.securityLevel, value.authority);
161166
} else if (value instanceof FormFieldLanguageValueObject) {
162167
operationValue = new FormFieldMetadataValueObject(value.value, value.language, securityLevel);
163168
} else if (value.hasOwnProperty('authority')) {
@@ -170,11 +175,10 @@ export class JsonPatchOperationsBuilder {
170175
Object.keys(value)
171176
.forEach((key) => {
172177
if (typeof value[key] === 'object') {
173-
if (securityLevel != null) {
174-
operationValue[key] = this.prepareObjectValue(value[key], securityLevel);
178+
if (isNotEmpty(securityLevel)) {
179+
operationValue[key] = this.prepareObjectValue(value[key], securityLevel);
175180
} else {
176-
operationValue[key] = this.prepareObjectValue(value[key]);
177-
181+
operationValue[key] = this.prepareObjectValue(value[key]);
178182
}
179183
} else {
180184
operationValue[key] = value[key];
@@ -184,14 +188,4 @@ export class JsonPatchOperationsBuilder {
184188
return operationValue;
185189
}
186190

187-
protected prepareAuthorityValue(value: any): FormFieldMetadataValueObject {
188-
let operationValue: FormFieldMetadataValueObject;
189-
if (isNotEmpty(value.authority)) {
190-
operationValue = new FormFieldMetadataValueObject(value.value, value.language, value.securityLevel, value.authority);
191-
} else {
192-
operationValue = new FormFieldMetadataValueObject(value.value, value.language, value.securityLevel,);
193-
}
194-
return operationValue;
195-
}
196-
197191
}

0 commit comments

Comments
 (0)