Skip to content

Commit

Permalink
projects: create custom resource for HEP-VS
Browse files Browse the repository at this point in the history
* Creates a custom projects resource for HEP-VS.
* Adds an utility function to check if user's organisation has a custom resource.
* Enables datepickers for `startDate` and `endDate` fields.
* Closes #454.

Co-Authored-by: Sébastien Délèze <sebastien.deleze@rero.ch>
  • Loading branch information
Sébastien Délèze committed Mar 17, 2021
1 parent 3f679f8 commit 97809a5
Show file tree
Hide file tree
Showing 15 changed files with 1,181 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ target/
sonar/modules/documents/jsonschemas/documents/document-v1.0.0.json
sonar/modules/deposits/jsonschemas/deposits/deposit-v1.0.0.json
sonar/resources/projects/jsonschemas/projects/project-v1.0.0.json
sonar/dedicated/*/*/jsonschemas/*/*/*-v1.0.0.json

# Generated JSON files
data/backups/
Expand Down
1 change: 1 addition & 0 deletions scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ section "Compile JSON schemas" "info"
invenio utils compile-json ./sonar/modules/documents/jsonschemas/documents/document-v1.0.0_src.json -o ./sonar/modules/documents/jsonschemas/documents/document-v1.0.0.json
invenio utils compile-json ./sonar/modules/deposits/jsonschemas/deposits/deposit-v1.0.0_src.json -o ./sonar/modules/deposits/jsonschemas/deposits/deposit-v1.0.0.json
invenio utils compile-json ./sonar/resources/projects/jsonschemas/projects/project-v1.0.0_src.json -o ./sonar/resources/projects/jsonschemas/projects/project-v1.0.0.json
invenio utils compile-json ./sonar/dedicated/hepvs/projects/jsonschemas/hepvs/projects/project-v1.0.0_src.json -o ./sonar/dedicated/hepvs/projects/jsonschemas/hepvs/projects/project-v1.0.0.json

# Compile translations catalogs
section "Compile translations catalogs" "info"
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
'users = sonar.modules.users.jsonschemas',
'deposits = sonar.modules.deposits.jsonschemas',
'projects = sonar.resources.projects.jsonschemas',
'projects_hepvs = sonar.dedicated.hepvs.projects.jsonschemas',
'common = sonar.common.jsonschemas'
],
'invenio_search.mappings': [
Expand Down
9 changes: 7 additions & 2 deletions sonar/config_sonar.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

"""Specific configuration SONAR."""


SONAR_APP_API_URL = 'https://localhost:5000/api/'

SONAR_APP_ANGULAR_URL = 'https://localhost:5000/manage/'
Expand Down Expand Up @@ -66,10 +65,16 @@
]
"""List of extensions for which files can be previewed."""


SONAR_APP_WEBDAV_HEG_HOST = 'https://share.rero.ch/HEG'
SONAR_APP_WEBDAV_HEG_USER = None
SONAR_APP_WEBDAV_HEG_PASSWORD = None
"""Connection data to webdav for HEG."""

SONAR_APP_HEG_DATA_DIRECTORY = './data/heg'

SONAR_APP_ORGANISATION_CONFIG = {
'hepvs': {
'projects': True
}
}
# Custom resources for organisations
18 changes: 18 additions & 0 deletions sonar/dedicated/hepvs/projects/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
#
# Swiss Open Access Repository
# Copyright (C) 2021 RERO
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""RERO specific project resource."""
18 changes: 18 additions & 0 deletions sonar/dedicated/hepvs/projects/jsonschemas/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
#
# Swiss Open Access Repository
# Copyright (C) 2021 RERO
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""JSONSchema directory for projects."""
Loading

0 comments on commit 97809a5

Please sign in to comment.