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

bump major #1907

Merged
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
24 changes: 5 additions & 19 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# Copyright (C) 2021 CERN.
#
# Copyright (C) 2024 Graz University of Technology.
# Invenio-RDM-Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.

Expand All @@ -14,22 +15,7 @@ on:

jobs:
build-n-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel babel
- name: Build package
run: |
python setup.py compile_catalog sdist bdist_wheel
- name: Publish
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_token }}
uses: inveniosoftware/workflows/.github/workflows/pypi-publish.yml@master
secrets: inherit
with:
babel-compile-catalog: true
82 changes: 0 additions & 82 deletions .github/workflows/tests-feature.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# Copyright (C) 2020-2024 CERN.
# Copyright (C) 2020 Northwestern University.
# Copyright (C) 2024 Graz University of Technology.
#
# Invenio-RDM-Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
Expand All @@ -10,11 +11,14 @@ name: CI

on:
push:
branches: master
branches:
- master
- "feature/*"
pull_request:
branches:
- master
- "maint-**"
- "feature/*"
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 3 * * 6"
Expand Down
9 changes: 8 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2019-2024 CERN.
Copyright (C) 2019-2024 Northwestern University.
Copyright (C) 2024 KTH Royal Institute of Technology.

Copyright (C) 2024 Graz University of Technology.

Invenio-RDM-Records is free software; you can redistribute it and/or
modify it under the terms of the MIT License; see LICENSE file for more
Expand All @@ -12,6 +12,13 @@
Changes
=======

Version 17.0.0.dev1 (released 2024-12-16)

- fix: flask-sqlalchemy.pagination >= 3.0.0
- comp: make compatible to flask-sqlalchemy>=3.1
- setup: change to reusable workflows
- setup: bump major dependencies

Version v16.4.1 (released 2024-12-11)

- mappings: add missing `identifiers` to community orgs
Expand Down
2 changes: 1 addition & 1 deletion invenio_rdm_records/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@

from .ext import InvenioRDMRecords

__version__ = "16.4.1"
__version__ = "17.0.0.dev1"

__all__ = ("__version__", "InvenioRDMRecords")
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@ export class RDMDepositApiClient extends DepositApiClient {
);
return new DepositApiClientResponse(data, errors);
} catch (error) {
const errorData = error.response.data;
let errorData = error.response.data;
const errors = this.recordSerializer.deserializeErrors(
error.response.data.errors || []
);
// this is to serialize raised error from the backend on publish
if (errors) errorData = errors;
throw new DepositApiClientResponse({}, errorData);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import {
DepositFormSubmitContext,
} from "../../api/DepositFormSubmitContext";
import { DRAFT_PUBLISH_STARTED } from "../../state/types";
import { scrollTop } from "../../utils";
import { DRAFT_PUBLISH_FAILED_WITH_VALIDATION_ERRORS } from "../../state/types";

class PublishButtonComponent extends Component {
state = { isConfirmModalOpen: false };
Expand All @@ -30,14 +32,36 @@ class PublishButtonComponent extends Component {

handlePublish = (event, handleSubmit, publishWithoutCommunity) => {
const { setSubmitContext } = this.context;

setSubmitContext(
publishWithoutCommunity
? DepositFormSubmitActions.PUBLISH_WITHOUT_COMMUNITY
: DepositFormSubmitActions.PUBLISH
);
handleSubmit(event);
this.closeConfirmModal();
const { formik, raiseDOINeededButNotReserved, isDOIRequired } = this.props;
const noINeedOne = formik?.values?.noINeedOne;
// Check for explicit DOI reservation via the "GET DOI button" only when DOI is
// optional in the instance's settings. If it is required, backend will automatically
// mint one even if it was not explicitly reserved
const shouldCheckForExplicitDOIReservation =
isDOIRequired !== undefined && // isDOIRequired is undefined when no value was provided from Invenio-app-rdm
!isDOIRequired &&
noINeedOne &&
Object.keys(formik?.values?.pids).length === 0;
if (shouldCheckForExplicitDOIReservation) {
const errors = {
pids: {
doi: i18next.t("DOI is needed. Please click on the button to reserve it."),
},
};
formik.setErrors(errors);
raiseDOINeededButNotReserved(formik?.values, errors);
this.closeConfirmModal();
} else {
setSubmitContext(
publishWithoutCommunity
? DepositFormSubmitActions.PUBLISH_WITHOUT_COMMUNITY
: DepositFormSubmitActions.PUBLISH
);
handleSubmit(event);
this.closeConfirmModal();
}
// scroll top to show the global error
scrollTop();
};

isDisabled = (values, isSubmitting, filesState) => {
Expand Down Expand Up @@ -67,6 +91,7 @@ class PublishButtonComponent extends Component {
publishWithoutCommunity,
formik,
publishModalExtraContent,
raiseDOINeededButNotReserved,
...ui
} = this.props;
const { isConfirmModalOpen } = this.state;
Expand Down Expand Up @@ -139,6 +164,8 @@ PublishButtonComponent.propTypes = {
formik: PropTypes.object.isRequired,
publishModalExtraContent: PropTypes.string,
filesState: PropTypes.object,
raiseDOINeededButNotReserved: PropTypes.func.isRequired,
isDOIRequired: PropTypes.bool,
};

PublishButtonComponent.defaultProps = {
Expand All @@ -147,15 +174,22 @@ PublishButtonComponent.defaultProps = {
actionState: undefined,
publishModalExtraContent: undefined,
filesState: undefined,
isDOIRequired: undefined,
};

const mapStateToProps = (state) => ({
actionState: state.deposit.actionState,
publishModalExtraContent: state.deposit.config.publish_modal_extra,
filesState: state.files,
isDOIRequired: state.deposit.config.is_doi_required,
});

export const PublishButton = connect(
mapStateToProps,
null
)(connectFormik(PublishButtonComponent));
export const PublishButton = connect(mapStateToProps, (dispatch) => {
return {
raiseDOINeededButNotReserved: (data, errors) =>
dispatch({
type: DRAFT_PUBLISH_FAILED_WITH_VALIDATION_ERRORS,
payload: { data: data, errors: errors },
}),
};
})(connectFormik(PublishButtonComponent));
Loading
Loading