Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/custom fields #27

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app_data/vocabularies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ subjects:
# TODO: Uncomment this if you want to have all affiliations with ROR identifiers.
# affiliations:
# pid-type: aff
# data-file: vocabularies/affiliations_ror.yaml
# data-file: vocabularies/affiliations_ror.yaml
resourcetypes:
pid-type: rsrct
data-file: vocabularies/resource_types.yaml
116 changes: 116 additions & 0 deletions app_data/vocabularies/resource_types.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# These are 11 MEx entity types
# https://github.com/robert-koch-institut/mex-model/tree/main/mex/model/entities
# they replace the Datacite 4.3 resource types
# https://github.com/inveniosoftware/invenio-rdm-records/blob/master/invenio_rdm_records/fixtures/data/vocabularies/resource_types.yaml
# For more information:
# https://inveniordm.docs.cern.ch/customize/vocabularies/resource_types/
- id: variable
icon: code
title:
en: Variable
props:
type: variable
subtype: ""
tags:
- depositable
- linkable
- id: resource
icon: code
title:
en: Resource
props:
type: resource
subtype: ""
tags:
- depositable
- linkable
- id: activity
icon: code
title:
en: Activity
props:
type: activity
subtype: ""
tags:
- depositable
- linkable
- id: accessplatform
icon: code
title:
en: Access platform
props:
type: accessplatform
subtype: ""
tags:
- depositable
- linkable
- id: distribution
icon: code
title:
en: Distribution
props:
type: distribution
subtype: ""
tags:
- depositable
- linkable
- id: organizationalunit
icon: code
title:
en: Organizational unit
props:
type: organizationalunit
subtype: ""
tags:
- depositable
- linkable
- id: contactpoint
icon: code
title:
en: Contact point
props:
type: contactpoint
subtype: ""
tags:
- depositable
- linkable
- id: person
icon: code
title:
en: Person
props:
type: person
subtype: ""
tags:
- depositable
- linkable
- id: variablegroup
icon: code
title:
en: Variable group
props:
type: variablegroup
subtype: ""
tags:
- depositable
- linkable
- id: bibliographicresource
icon: code
title:
en: Bibliographic resource
props:
type: bibliographicresource
subtype: ""
tags:
- depositable
- linkable
- id: organization
icon: code
title:
en: Organization
props:
type: organization
subtype: ""
tags:
- depositable
- linkable
23 changes: 11 additions & 12 deletions site/mex_invenio/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
from datetime import datetime
from invenio_i18n import lazy_gettext as _

from mex_invenio.custom_fields.custom_fields import RDM_NAMESPACES, RDM_CUSTOM_FIELDS, RDM_CUSTOM_FIELDS_UI


def _(x): # needed to avoid start time failure with lazy strings
return x


# Flask
# =====
# See https://flask.palletsprojects.com/en/1.1.x/config/
Expand All @@ -26,22 +30,20 @@ def _(x): # needed to avoid start time failure with lazy strings
# SECURITY WARNING: keep the secret key used in production secret!
# Do not commit it to a source code repository.
# TODO: Set
SECRET_KEY="CHANGE_ME"
SECRET_KEY = "CHANGE_ME"

# Since HAProxy and Nginx route all requests no matter the host header
# provided, the allowed hosts variable is set to localhost. In production it
# should be set to the correct host and it is strongly recommended to only
# route correct hosts to the application.
APP_ALLOWED_HOSTS = ['0.0.0.0', 'localhost', '127.0.0.1']


# Flask-SQLAlchemy
# ================
# See https://flask-sqlalchemy.palletsprojects.com/en/2.x/config/

# TODO: Set
SQLALCHEMY_DATABASE_URI="postgresql+psycopg2://mex-invenio:mex-invenio@localhost/mex-invenio"

SQLALCHEMY_DATABASE_URI = "postgresql+psycopg2://mex-invenio:mex-invenio@localhost/mex-invenio"

# Invenio-App
# ===========
Expand All @@ -51,9 +53,9 @@ def _(x): # needed to avoid start time failure with lazy strings
'content_security_policy': {
'default-src': [
"'self'",
'data:', # for fonts
'data:', # for fonts
"'unsafe-inline'", # for inline scripts and styles
"blob:", # for pdf preview
"blob:", # for pdf preview
# Add your own policies here (e.g. analytics)
],
},
Expand All @@ -72,7 +74,6 @@ def _(x): # needed to avoid start time failure with lazy strings
'strict_transport_security_preload': False,
}


# Flask-Babel
# ===========
# See https://python-babel.github.io/flask-babel/#configuration
Expand All @@ -82,7 +83,6 @@ def _(x): # needed to avoid start time failure with lazy strings
# Default time zone
BABEL_DEFAULT_TIMEZONE = 'Europe/Zurich'


# Invenio-I18N
# ============
# See https://invenio-i18n.readthedocs.io/en/latest/configuration.html
Expand All @@ -93,7 +93,6 @@ def _(x): # needed to avoid start time failure with lazy strings
# ('tr', _('Turkish')),
]


# Invenio-Theme
# =============
# See https://invenio-theme.readthedocs.io/en/latest/configuration.html
Expand All @@ -105,7 +104,6 @@ def _(x): # needed to avoid start time failure with lazy strings
# Header logo
THEME_LOGO = 'images/invenio-rdm.svg'


# Invenio-App-RDM
# ===============
# See https://github.com/inveniosoftware/invenio-app-rdm/blob/master/invenio_app_rdm/config.py
Expand Down Expand Up @@ -133,7 +131,7 @@ def _(x): # needed to avoid start time failure with lazy strings
"publisher": "mex-invenio",
}

APP_RDM_DEPOSIT_FORM_AUTOCOMPLETE_NAMES = 'search' # "search_only" or "off"
APP_RDM_DEPOSIT_FORM_AUTOCOMPLETE_NAMES = 'search' # "search_only" or "off"

# Invenio-Records-Resources
# =========================
Expand Down Expand Up @@ -166,7 +164,7 @@ def _(x): # needed to avoid start time failure with lazy strings
SECURITY_RECOVERABLE = True # local login: allow users to reset the password
SECURITY_CHANGEABLE = True # local login: allow users to change psw
SECURITY_CONFIRMABLE = True # local login: users can confirm e-mail address
SECURITY_LOGIN_WITHOUT_CONFIRMATION = False # require users to confirm email before being able to login
SECURITY_LOGIN_WITHOUT_CONFIRMATION = False # require users to confirm email before being able to login

# Invenio-OAuthclient
# -------------------
Expand All @@ -175,6 +173,7 @@ def _(x): # needed to avoid start time failure with lazy strings
OAUTHCLIENT_REMOTE_APPS = {} # configure external login providers

from invenio_oauthclient.views.client import auto_redirect_login

ACCOUNTS_LOGIN_VIEW_FUNCTION = auto_redirect_login # autoredirect to external login if enabled
OAUTHCLIENT_AUTO_REDIRECT_TO_EXTERNAL_LOGIN = False # autoredirect to external login

Expand Down
Empty file.
Loading
Loading