Skip to content

Commit

Permalink
Merge pull request #20 from bibudem/calypso-dspace
Browse files Browse the repository at this point in the history
branche calypso-dspace
  • Loading branch information
nimabehforouz authored Apr 2, 2024
2 parents bcac154 + ae16ad5 commit bfdfb85
Show file tree
Hide file tree
Showing 2,872 changed files with 72,547 additions and 45,420 deletions.
72 changes: 55 additions & 17 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"eslint-plugin-deprecation",
"unused-imports",
"eslint-plugin-lodash",
"eslint-plugin-jsonc"
"eslint-plugin-jsonc",
"eslint-plugin-rxjs",
"eslint-plugin-simple-import-sort",
"eslint-plugin-import-newlines"
],
"overrides": [
{
Expand All @@ -27,17 +30,29 @@
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
"plugin:@angular-eslint/template/process-inline-templates",
"plugin:rxjs/recommended"
],
"rules": {
"indent": [
"error",
2,
{
"SwitchCase": 1
}
],
"max-classes-per-file": [
"error",
1
],
"comma-dangle": [
"off",
"error",
"always-multiline"
],
"object-curly-spacing": [
"error",
"always"
],
"eol-last": [
"error",
"always"
Expand Down Expand Up @@ -104,15 +119,13 @@
"allowTernary": true
}
],
"prefer-const": "off", // todo: re-enable & fix errors (more strict than it used to be in TSLint)
"prefer-const": "error",
"no-case-declarations": "error",
"no-extra-boolean-cast": "error",
"prefer-spread": "off",
"no-underscore-dangle": "off",

// todo: disabled rules from eslint:recommended, consider re-enabling & fixing
"no-prototype-builtins": "off",
"no-useless-escape": "off",
"no-case-declarations": "off",
"no-extra-boolean-cast": "off",

"@angular-eslint/directive-selector": [
"error",
Expand All @@ -139,7 +152,6 @@
}
],
"@angular-eslint/no-attribute-decorator": "error",
"@angular-eslint/no-forward-ref": "error",
"@angular-eslint/no-output-native": "warn",
"@angular-eslint/no-output-on-prefix": "warn",
"@angular-eslint/no-conflicting-lifecycle": "warn",
Expand Down Expand Up @@ -183,7 +195,7 @@
],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
"@typescript-eslint/ban-types": "warn", // todo: deal with {} type issues & re-enable
"@typescript-eslint/ban-types": "error",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-misused-promises": "warn",
"@typescript-eslint/restrict-plus-operands": "warn",
Expand All @@ -203,14 +215,45 @@

"deprecation/deprecation": "warn",

"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"import/order": "off",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"import/no-deprecated": "warn",
"import/no-namespace": "error",
"import-newlines/enforce": [
"error",
{
"items": 1,
"semi": true,
"forceSingleLine": true
}
],

"unused-imports/no-unused-imports": "error",
"lodash/import-scope": [
"error",
"method"
]
],

"rxjs/no-nested-subscribe": "off" // todo: go over _all_ cases
}
},
{
"files": [
"*.spec.ts"
],
"parserOptions": {
"project": [
"./tsconfig.json",
"./cypress/tsconfig.json"
],
"createDefaultProgram": true
},
"rules": {
"prefer-const": "off"
}
},
{
Expand All @@ -219,12 +262,7 @@
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {
// todo: re-enable & fix errors
"@angular-eslint/template/no-negated-async": "off",
"@angular-eslint/template/eqeqeq": "off"
}
]
},
{
"files": [
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ jobs:
restore-keys: ${{ runner.os }}-yarn-

- name: Install Yarn dependencies
run: yarn install --frozen-lockfile
#run: yarn install --frozen-lockfile
run: yarn install

- name: Run lint
run: yarn run lint --quiet
Expand Down
64 changes: 63 additions & 1 deletion config/config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ submission:
# NOTE: after how many time (milliseconds) submission is saved automatically
# eg. timer: 5 * (1000 * 60); // 5 minutes
timer: 0
# Always show the duplicate detection section if enabled, even if there are no potential duplicates detected
# (a message will be displayed to indicate no matches were found)
duplicateDetection:
alwaysShowSection: false
icons:
metadata:
# NOTE: example of configuration
Expand Down Expand Up @@ -427,9 +431,67 @@ comcolSelectionSort:


# Search settings
search:
search:
# Settings to enable/disable or configure advanced search filters.
advancedFilters:
enabled: false
# List of filters to enable in "Advanced Search" dropdown
filter: [ 'title', 'author', 'subject', 'entityType' ]


# Notify metrics
# Configuration for Notify Admin Dashboard for metrics visualization
notifyMetrics:
# Configuration for received messages
- title: 'admin-notify-dashboard.received-ldn'
boxes:
- color: '#B8DAFF'
title: 'admin-notify-dashboard.NOTIFY.incoming.accepted'
config: 'NOTIFY.incoming.accepted'
description: 'admin-notify-dashboard.NOTIFY.incoming.accepted.description'
- color: '#D4EDDA'
title: 'admin-notify-dashboard.NOTIFY.incoming.processed'
config: 'NOTIFY.incoming.processed'
description: 'admin-notify-dashboard.NOTIFY.incoming.processed.description'
- color: '#FDBBC7'
title: 'admin-notify-dashboard.NOTIFY.incoming.failure'
config: 'NOTIFY.incoming.failure'
description: 'admin-notify-dashboard.NOTIFY.incoming.failure.description'
- color: '#FDBBC7'
title: 'admin-notify-dashboard.NOTIFY.incoming.untrusted'
config: 'NOTIFY.incoming.untrusted'
description: 'admin-notify-dashboard.NOTIFY.incoming.untrusted.description'
- color: '#43515F'
title: 'admin-notify-dashboard.NOTIFY.incoming.involvedItems'
textColor: '#fff'
config: 'NOTIFY.incoming.involvedItems'
description: 'admin-notify-dashboard.NOTIFY.incoming.involvedItems.description'
# Configuration for outgoing messages
- title: 'admin-notify-dashboard.generated-ldn'
boxes:
- color: '#B8DAFF'
title: 'admin-notify-dashboard.NOTIFY.outgoing.queued'
config: 'NOTIFY.outgoing.queued'
description: 'admin-notify-dashboard.NOTIFY.outgoing.queued.description'
- color: '#FDEEBB'
title: 'admin-notify-dashboard.NOTIFY.outgoing.queued_for_retry'
config: 'NOTIFY.outgoing.queued_for_retry'
description: 'admin-notify-dashboard.NOTIFY.outgoing.queued_for_retry.description'
- color: '#FDBBC7'
title: 'admin-notify-dashboard.NOTIFY.outgoing.failure'
config: 'NOTIFY.outgoing.failure'
description: 'admin-notify-dashboard.NOTIFY.outgoing.failure.description'
- color: '#43515F'
title: 'admin-notify-dashboard.NOTIFY.outgoing.involvedItems'
textColor: '#fff'
config: 'NOTIFY.outgoing.involvedItems'
description: 'admin-notify-dashboard.NOTIFY.outgoing.involvedItems.description'
- color: '#D4EDDA'
title: 'admin-notify-dashboard.NOTIFY.outgoing.delivered'
config: 'NOTIFY.outgoing.delivered'
description: 'admin-notify-dashboard.NOTIFY.outgoing.delivered.description'





38 changes: 19 additions & 19 deletions cypress/e2e/admin-sidebar.cy.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { Options } from 'cypress-axe';
import { testA11y } from 'cypress/support/utils';
import { Options } from 'cypress-axe';

describe('Admin Sidebar', () => {
beforeEach(() => {
// Must login as an Admin for sidebar to appear
cy.visit('/login');
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
});
beforeEach(() => {
// Must login as an Admin for sidebar to appear
cy.visit('/login');
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
});

it('should be pinnable and pass accessibility tests', () => {
// Pin the sidebar open
cy.get('#sidebar-collapse-toggle').click();
it('should be pinnable and pass accessibility tests', () => {
// Pin the sidebar open
cy.get('#sidebar-collapse-toggle').click();

// Click on every expandable section to open all menus
cy.get('ds-expandable-admin-sidebar-section').click({multiple: true});
// Click on every expandable section to open all menus
cy.get('ds-expandable-admin-sidebar-section').click({ multiple: true });

// Analyze <ds-admin-sidebar> for accessibility
testA11y('ds-admin-sidebar',
// Analyze <ds-admin-sidebar> for accessibility
testA11y('ds-admin-sidebar',
{
rules: {
// Currently all expandable sections have nested interactive elements
// See https://github.com/DSpace/dspace-angular/issues/2178
'nested-interactive': { enabled: false },
}
rules: {
// Currently all expandable sections have nested interactive elements
// See https://github.com/DSpace/dspace-angular/issues/2178
'nested-interactive': { enabled: false },
},
} as Options);
});
});
});
16 changes: 8 additions & 8 deletions cypress/e2e/breadcrumbs.cy.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { testA11y } from 'cypress/support/utils';

describe('Breadcrumbs', () => {
it('should pass accessibility tests', () => {
// Visit an Item, as those have more breadcrumbs
cy.visit('/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));
it('should pass accessibility tests', () => {
// Visit an Item, as those have more breadcrumbs
cy.visit('/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));

// Wait for breadcrumbs to be visible
cy.get('ds-breadcrumbs').should('be.visible');
// Wait for breadcrumbs to be visible
cy.get('ds-breadcrumbs').should('be.visible');

// Analyze <ds-breadcrumbs> for accessibility
testA11y('ds-breadcrumbs');
});
// Analyze <ds-breadcrumbs> for accessibility
testA11y('ds-breadcrumbs');
});
});
14 changes: 7 additions & 7 deletions cypress/e2e/browse-by-author.cy.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { testA11y } from 'cypress/support/utils';

describe('Browse By Author', () => {
it('should pass accessibility tests', () => {
cy.visit('/browse/author');
it('should pass accessibility tests', () => {
cy.visit('/browse/author');

// Wait for <ds-browse-by-metadata-page> to be visible
cy.get('ds-browse-by-metadata').should('be.visible');
// Wait for <ds-browse-by-metadata-page> to be visible
cy.get('ds-browse-by-metadata').should('be.visible');

// Analyze <ds-browse-by-metadata-page> for accessibility
testA11y('ds-browse-by-metadata');
});
// Analyze <ds-browse-by-metadata-page> for accessibility
testA11y('ds-browse-by-metadata');
});
});
14 changes: 7 additions & 7 deletions cypress/e2e/browse-by-dateissued.cy.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { testA11y } from 'cypress/support/utils';

describe('Browse By Date Issued', () => {
it('should pass accessibility tests', () => {
cy.visit('/browse/dateissued');
it('should pass accessibility tests', () => {
cy.visit('/browse/dateissued');

// Wait for <ds-browse-by-date-page> to be visible
cy.get('ds-browse-by-date').should('be.visible');
// Wait for <ds-browse-by-date-page> to be visible
cy.get('ds-browse-by-date').should('be.visible');

// Analyze <ds-browse-by-date-page> for accessibility
testA11y('ds-browse-by-date');
});
// Analyze <ds-browse-by-date-page> for accessibility
testA11y('ds-browse-by-date');
});
});
14 changes: 7 additions & 7 deletions cypress/e2e/browse-by-subject.cy.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { testA11y } from 'cypress/support/utils';

describe('Browse By Subject', () => {
it('should pass accessibility tests', () => {
cy.visit('/browse/subject');
it('should pass accessibility tests', () => {
cy.visit('/browse/subject');

// Wait for <ds-browse-by-metadata-page> to be visible
cy.get('ds-browse-by-metadata').should('be.visible');
// Wait for <ds-browse-by-metadata-page> to be visible
cy.get('ds-browse-by-metadata').should('be.visible');

// Analyze <ds-browse-by-metadata-page> for accessibility
testA11y('ds-browse-by-metadata');
});
// Analyze <ds-browse-by-metadata-page> for accessibility
testA11y('ds-browse-by-metadata');
});
});
14 changes: 7 additions & 7 deletions cypress/e2e/browse-by-title.cy.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { testA11y } from 'cypress/support/utils';

describe('Browse By Title', () => {
it('should pass accessibility tests', () => {
cy.visit('/browse/title');
it('should pass accessibility tests', () => {
cy.visit('/browse/title');

// Wait for <ds-browse-by-title-page> to be visible
cy.get('ds-browse-by-title').should('be.visible');
// Wait for <ds-browse-by-title-page> to be visible
cy.get('ds-browse-by-title').should('be.visible');

// Analyze <ds-browse-by-title-page> for accessibility
testA11y('ds-browse-by-title');
});
// Analyze <ds-browse-by-title-page> for accessibility
testA11y('ds-browse-by-title');
});
});
Loading

0 comments on commit bfdfb85

Please sign in to comment.