diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/utils.js b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/utils.js index 25044682..7f909295 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/utils.js +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/utils.js @@ -9,20 +9,24 @@ export const edtfDateFormatOptions = [ { value: "yyyy-mm-dd", text: i18next.t("Year, month and date") }, ]; +const getPaddedYearString = (dateObj) => { + const year = dateObj.getFullYear(); + return _padStart(`${year}`, 4, "0"); +}; export const allEmptyStrings = (arr) => arr.every((element) => element === ""); export const serializeDate = (dateObj, dateEdtfFormat) => { if (dateObj === null) return ""; - if (dateEdtfFormat === "yyyy") return `${dateObj.getFullYear()}`; + if (dateEdtfFormat === "yyyy") return getPaddedYearString(dateObj); if (dateEdtfFormat === "yyyy-mm") - return `${dateObj.getFullYear()}-${_padStart( + return `${getPaddedYearString(dateObj)}-${_padStart( dateObj.getMonth() + 1, 2, "0" )}`; if (dateEdtfFormat === "yyyy-mm-dd") - return `${dateObj.getFullYear()}-${_padStart( + return `${getPaddedYearString(dateObj)}-${_padStart( dateObj.getMonth() + 1, 2, "0" diff --git a/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/elements/header.overrides b/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/elements/header.overrides new file mode 100644 index 00000000..35edbc7c --- /dev/null +++ b/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/elements/header.overrides @@ -0,0 +1,3 @@ +.ui.header { + word-break: break-word; +} diff --git a/oarepo_ui/views.py b/oarepo_ui/views.py index ddf43f85..2354aa30 100644 --- a/oarepo_ui/views.py +++ b/oarepo_ui/views.py @@ -1,11 +1,18 @@ from flask import Blueprint from invenio_base.utils import obj_or_import_string +from flask_menu import current_menu def create_blueprint(app): blueprint = Blueprint("oarepo_ui", __name__, template_folder="templates") blueprint.app_context_processor(lambda: ({"current_app": app})) + # hide the /admin (maximum recursion depth exceeded menu) + @blueprint.before_app_first_request + def init_menu(): + admin_menu = current_menu.submenu("settings.admin") + admin_menu.hide() + def add_jinja_filters(state): app = state.app ext = app.extensions["oarepo_ui"] diff --git a/setup.cfg b/setup.cfg index 3ff57a1e..06abe68e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = oarepo-ui -version = 5.2.25 +version = 5.2.26 description = UI module for invenio 3.5+ long_description = file: README.md long_description_content_type = text/markdown