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

Fix file info of new uploaded file not being persisted after edit #8244

Merged
merged 3 commits into from Oct 14, 2020

Conversation

henrych4
Copy link
Contributor

@henrych4 henrych4 commented Oct 8, 2020

Description of what you did:

fix #8097

dispatch an action to update file info after edited a new uploaded file.

Signed-off-by: henrych4 <singyinhenry@gmail.com>
@codecov
Copy link

codecov bot commented Oct 8, 2020

Codecov Report

Merging #8244 into master will increase coverage by 0.02%.
The diff coverage is 72.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8244      +/-   ##
==========================================
+ Coverage   33.04%   33.06%   +0.02%     
==========================================
  Files        1219     1219              
  Lines       13573    13582       +9     
  Branches     1348     1350       +2     
==========================================
+ Hits         4485     4491       +6     
- Misses       8206     8208       +2     
- Partials      882      883       +1     
Flag Coverage Δ
#front 24.72% <62.50%> (+0.02%) ⬆️
#unit 54.15% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...-admin/admin/src/containers/HomePage/SocialLink.js 100.00% <ø> (ø)
...trapi-admin/admin/src/containers/HomePage/index.js 62.50% <ø> (ø)
...-manager/admin/src/components/InputUID/InputUID.js 0.00% <0.00%> (ø)
...ent-manager/admin/src/components/InputUID/index.js 0.00% <ø> (ø)
.../containers/InputModalStepper/InputModalStepper.js 0.00% <0.00%> (ø)
.../src/containers/InputModalStepperProvider/index.js 0.00% <ø> (ø)
...-users-permissions/admin/src/translations/index.js 0.00% <0.00%> (ø)
...kages/strapi-admin/admin/src/translations/index.js 100.00% <100.00%> (ø)
...rc/containers/InputModalStepperProvider/reducer.js 64.40% <100.00%> (+1.90%) ⬆️
...ages/strapi/lib/services/entity-validator/index.js 55.17% <100.00%> (+1.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 10443df...4fb193f. Read the comment docs.

Copy link
Contributor

@soupette soupette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @henrych4!

Can you just add a small test for the reducer's new case?

@@ -145,6 +145,12 @@ const reducer = (state, action) =>
draftState.selectedFiles = draftState.selectedFiles.filter(file => file && file.id);
break;
}
case 'ON_SUBMIT_EDIT_NEW_FILE': {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the related test for this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test added.

@henrych4 henrych4 requested a review from a team as a code owner October 12, 2020 14:13
Signed-off-by: henrych4 <singyinhenry@gmail.com>
Copy link
Contributor

@soupette soupette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thanks a lot for your contribution.

@soupette soupette added source: core:upload Source is core/upload package issue: bug Issue reporting a bug labels Oct 14, 2020
@alexandrebodin alexandrebodin added this to the 3.2.4 milestone Oct 14, 2020
@alexandrebodin alexandrebodin merged commit ed71cc2 into strapi:master Oct 14, 2020
@lauriejim
Copy link
Contributor

This pull request has been mentioned on Strapi Community. There might be relevant details there:

https://forum.strapi.io/t/new-release-strapi-v3-2-4-security-fix/509/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug source: core:upload Source is core/upload package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

strapi-provider-upload: file values (name, alt, caption) are not persisted when uploading from a component
4 participants