Skip to content

Commit 305be9d

Browse files
committed
Merge remote-tracking branch 'origin/main' into cache-bust-dynamic-configuration_contribute-main
2 parents 316e29b + 993c89a commit 305be9d

File tree

349 files changed

+87059
-8102
lines changed

Some content is hidden

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

349 files changed

+87059
-8102
lines changed

.eslintrc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
"error",
7171
{
7272
"allow": [
73-
"log",
7473
"warn",
7574
"dir",
7675
"timeLog",

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123

124124
# Login to our Docker registry, so that we can access private Docker images using "docker compose" below.
125125
- name: Login to ${{ env.DOCKER_REGISTRY }}
126-
uses: docker/login-action@v3
126+
uses: docker/login-action@v4
127127
with:
128128
registry: ${{ env.DOCKER_REGISTRY }}
129129
username: ${{ github.repository_owner }}

config/config.example.yml

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ form:
167167
validatorMap:
168168
required: required
169169
regex: pattern
170+
# If true it enables the button "Duplicate" inside inline form groups.
171+
# The button will give the possibility to duplicate the whole form section copying the metadata values as well.
172+
showInlineGroupDuplicateButton: false
170173

171174
# Notification settings
172175
notifications:
@@ -205,6 +208,10 @@ submission:
205208
# default configuration
206209
- name: default
207210
style: ''
211+
# Icons that should remain visible even when no authority value is present for the metadata field.
212+
# This is useful for fields where you want to display an icon regardless of whether the value has an authority link.
213+
# Example: ['fas fa-user'] will show the user icon for author fields even without authority data.
214+
iconsVisibleWithNoAuthority: ['fas fa-user']
208215
authority:
209216
confidence:
210217
# NOTE: example of configuration
@@ -383,6 +390,8 @@ communityList:
383390
pageSize: 20
384391

385392
homePage:
393+
# Whether to show the top footer section or not
394+
showTopFooter: false
386395
recentSubmissions:
387396
# The number of item showing in recent submission components
388397
pageSize: 5
@@ -399,6 +408,20 @@ homePage:
399408
item:
400409
edit:
401410
undoTimeout: 10000 # 10 seconds
411+
# Defines the security levels available for metadata fields.
412+
# Each level maps to a numeric value stored on the metadata field in the backend and controls visibility of that field based on the user's role.
413+
# Levels are displayed as toggle buttons in the metadata edit UI.
414+
security:
415+
levels:
416+
- value: 0 # Public — visible to everyone
417+
icon: fa fa-globe
418+
color: green
419+
- value: 1 # Registered users — visible to authenticated users only
420+
icon: fa fa-key
421+
color: orange
422+
- value: 2 # Administrators only — restricted to admin users
423+
icon: fa fa-lock
424+
color: red
402425
# Show the item access status label in items lists
403426
showAccessStatuses: false
404427
bitstream:
@@ -413,7 +436,6 @@ item:
413436
# Metdadata list to be displayed for entities without a specific configuration
414437
fallbackMetdataList:
415438
- dc.description.abstract
416-
- dc.description.note
417439
# Configuration for each entity type
418440
entityDataConfig:
419441
- entityType: Person
@@ -433,6 +455,8 @@ item:
433455
iconPosition: IdentifierSubtypesIconPositionEnum.LEFT
434456
link: https://ror.org
435457

458+
# Enable authority based relations in item page
459+
showAuthorityRelations: false
436460
# Community Page Config
437461
community:
438462
# Default tab to be shown when browsing a Community. Valid values are: comcols, search, or browse_<field>
@@ -710,6 +734,28 @@ layout:
710734
default:
711735
icon: fas fa-project-diagram
712736
style: text-success
737+
# If true the download link in item page will be rendered as an advanced attachment, the view can be then configured with the layout.advancedAttachmentRendering config
738+
showDownloadLinkAsAttachment: false
739+
# Configuration for advanced attachment rendering in item pages. This controls how files are displayed when showDownloadLinkAsAttachment is enabled.
740+
# Defines which metadata/attributes to display for bitstream attachments.
741+
advancedAttachmentRendering:
742+
# Metadata and attributes to display for each attachment
743+
metadata:
744+
- name: dc.title
745+
type: metadata
746+
truncatable: false
747+
- name: dc.type
748+
type: metadata
749+
truncatable: false
750+
- name: dc.description
751+
type: metadata
752+
truncatable: true
753+
- name: size
754+
type: attribute
755+
- name: format
756+
type: attribute
757+
- name: checksum
758+
type: attribute
713759

714760
# Configuration for customization of search results
715761
searchResults:
@@ -740,3 +786,22 @@ searchResults:
740786
followAuthorityMetadataValuesLimit: 5
741787

742788

789+
# Configuration of social links using AddToAny plugin
790+
addToAnyPlugin:
791+
# This is enabled flag
792+
socialNetworksEnabled: false
793+
# If you want to self-host check https://www.addtoany.com/buttons/customize/host_cache
794+
scriptUrl: "https://static.addtoany.com/menu/page.js"
795+
# Check available integrations, visit https://www.addtoany.com/buttons/for/website
796+
# 1. Click "Choose Services", select integrations, then click Done
797+
# 2. Get Button Code
798+
# 3. You will get a HTML e.g. <a class="a2a_button_facebook"></a> where "facebook" is part you want to include in list
799+
buttons:
800+
- facebook
801+
- twitter
802+
- linkedin
803+
- email
804+
- copy_link
805+
showPlusButton: true
806+
showCounters: true
807+
title: DSpace demo

cypress.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ export default defineConfig({
3737
DSPACE_TEST_SUBMIT_USER_UUID: '914955b1-cf2e-4884-8af7-a166aa24cf73',
3838
DSPACE_TEST_SUBMIT_USER_PASSWORD: 'dspace',
3939
// Administrator users group
40-
DSPACE_ADMINISTRATOR_GROUP: 'e59f5659-bff9-451e-b28f-439e7bd467e4'
40+
DSPACE_ADMINISTRATOR_GROUP: 'e59f5659-bff9-451e-b28f-439e7bd467e4',
41+
//Collection to send and test workflow item
42+
DSPACE_TEST_SUBMIT_WORKFLOW_COLLECTION_NAME: '1-step Workflow collection',
4143
},
4244
e2e: {
4345
// Setup our plugins for e2e tests

cypress/e2e/my-dspace.cy.ts

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,151 @@ describe('My DSpace page', () => {
131131
testA11y('ds-submission-import-external');
132132
});
133133

134+
it('should let you filter to only archived items', () => {
135+
cy.visit('/mydspace');
136+
137+
//To wait filter be ready
138+
cy.intercept({
139+
method: 'GET',
140+
url: '/server/api/discover/facets/namedresourcetype**',
141+
}).as('facetNamedResourceType');
142+
143+
//This page is restricted, so we will be shown the login form. Fill it in and submit it
144+
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
145+
146+
//Wait for the page to display
147+
cy.wait('@facetNamedResourceType');
148+
149+
//Open all filters
150+
cy.get('.filter-toggle').click({ multiple: true });
151+
152+
//The authority filter should be visible.
153+
cy.get('ds-search-authority-filter').scrollIntoView().should('be.visible');
154+
155+
//Intercept the request to filter and the request of filter.
156+
cy.intercept({
157+
method: 'GET',
158+
url: '/server/api/discover/search/objects**',
159+
}).as('filterByItem');
160+
161+
//Apply the filter to the “archived” items.
162+
cy.get('ds-search-authority-filter a[href*="f.namedresourcetype=item,authority"]').find('input[type="checkbox"]').click();
163+
164+
//Wait for the response.
165+
cy.wait('@filterByItem');
166+
167+
//Check that we have at least one item and that they all have the archived badge.
168+
cy.get('ds-item-search-result-list-element-submission').should('exist');
169+
cy.get('ds-item-search-result-list-element-submission')
170+
.each(($item) => {
171+
cy.wrap($item)
172+
.find('.badge-archived')
173+
.should('exist');
174+
});
175+
});
176+
177+
//This test also generate an item to validate workflow task section
178+
it('should upload a file via drag & drop, display it in the UI and submit the item', () => {
179+
const fileName = 'example.pdf';
180+
const currentYear = new Date().getFullYear();
181+
182+
cy.visit('/mydspace');
183+
184+
//This page is restricted, so we will be shown the login form. Fill it in and submit it
185+
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
186+
187+
//Wait for the page to display
188+
cy.get('ds-my-dspace-page').should('be.visible');
189+
190+
//Select the uploader and perform the drag-and-drop action.
191+
cy.get('ds-uploader .well').selectFile(`cypress/fixtures/${fileName}`, { action: 'drag-drop' });
192+
193+
//Validate that the file appears in the UI
194+
cy.get('ds-uploader .filename').should('exist').and('contain.text', fileName);
195+
196+
//Validate that there is now exactly 1 file in the queue
197+
cy.get('ds-uploader .upload-item-top').should('have.length', 1);
198+
199+
// This should display the <ds-collection-dropdown> (popup window)
200+
cy.get('ds-collection-dropdown').should('be.visible');
201+
202+
// Type in a known Collection name in the search box
203+
cy.get('ds-collection-dropdown input[type="search"]').type(Cypress.env('DSPACE_TEST_SUBMIT_WORKFLOW_COLLECTION_NAME'));
204+
205+
// Click on the button matching that known Collection name
206+
cy.get('ds-collection-dropdown li[title="'.concat(Cypress.env('DSPACE_TEST_SUBMIT_WORKFLOW_COLLECTION_NAME')).concat('"]')).click();
207+
208+
// New URL should include /workspaceitems, as we've started a new submission
209+
cy.url().should('include', '/workspaceitems');
210+
211+
//Fill required fields
212+
cy.get('#dc_title').type('Workflow test item');
213+
cy.get('#dc_date_issued_year').type(currentYear.toString());
214+
cy.get('input[name="dc.type"]').click();
215+
cy.get('.dropdown-menu').should('be.visible').contains('button', 'Other').click();
216+
cy.get('#granted').check();
217+
218+
//Press deposit button
219+
cy.get('button[data-test="deposit"]').click();
220+
221+
//validate that URL is /mydspace
222+
cy.url().should('include', '/mydspace');
223+
224+
});
225+
226+
it('should let you take task from workflow', () => {
227+
cy.visit('/mydspace');
228+
229+
//This page is restricted, so we will be shown the login form. Fill it in and submit it
230+
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
231+
232+
//Wait for the page to display
233+
cy.get('ds-my-dspace-page').should('be.visible');
234+
235+
//And wait to list is ready
236+
cy.get('[data-test="objects"]').should('be.visible');
237+
238+
//Intercept to await backend response
239+
cy.intercept({
240+
method: 'GET',
241+
url: '/server/api/discover/search/objects**',
242+
}).as('workflowSearch');
243+
244+
//Change view to see workflow tasks
245+
cy.get('ds-search-switch-configuration select option[data-test="workflow"]')
246+
.should('exist')
247+
.invoke('attr', 'value')
248+
.then(value => {
249+
cy.get('ds-search-switch-configuration select').select(value);
250+
});
251+
252+
//Await backend search response
253+
cy.wait('@workflowSearch');
254+
255+
//Validate URL
256+
cy.url().should('include', 'configuration=workflow');
257+
258+
//Wait to render the list and at leat one item
259+
cy.get('[data-test="list-object"]').should('have.length.greaterThan', 0);
260+
cy.get('[data-test="claim-button"]').should('exist');
261+
262+
//Check that we have at least one item in worflow search, the item have claim-button and can click in it.
263+
cy.get('[data-test="list-object"]')
264+
.then(($items) => {
265+
const itemWithClaim = [...$items].find(item =>
266+
item.querySelector('[data-test="claim-button"]'),
267+
);
268+
cy.wrap(itemWithClaim).should('exist');
269+
cy.wrap(itemWithClaim).as('selectedItem');
270+
cy.wrap(itemWithClaim).within(() => {
271+
cy.get('ds-pool-task-actions').should('exist');
272+
cy.get('[data-test="claim-button"]').click();
273+
});
274+
});
275+
276+
//Finally, when you click the ‘Claim’ button, the actions for the selected item change
277+
cy.get('@selectedItem').within(() => {
278+
cy.get('ds-claimed-task-actions').should('exist');
279+
});
280+
});
134281
});

cypress/fixtures/example.pdf

18.4 KB
Binary file not shown.

cypress/plugins/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = (on, config) => {
1313
// Define "log" and "table" tasks, used for logging accessibility errors during CI
1414
// Borrowed from https://github.com/component-driven/cypress-axe#in-cypress-plugins-file
1515
log(message: string) {
16-
console.log(message);
16+
console.info(message);
1717
return null;
1818
},
1919
table(message: string) {

0 commit comments

Comments
 (0)