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

[Feat - EditPage, ImagesModal] Highlight selected image #124

Merged
merged 9 commits into from
Feb 19, 2020

Conversation

kwajiehao
Copy link
Contributor

@kwajiehao kwajiehao commented Dec 26, 2019

Overview

This PR accomplishes the following:

Previously in EditPage, when selecting an image in ImagesModal, the image would be selected on click. Now, users have to click on the image first and then click on the select button.

Still considering: I'm wondering if we should keep ImagesModal as a PureComponent or if we should delegate the selectedImage state to ImagesModal and make it a functional component. Thoughts?

Before

Screen Shot 2019-12-26 at 3 13 55 PM

After

Screen Shot 2019-12-26 at 3 11 46 PM

Currently in the ImagesModal or Images tab, if you click on Add New Image and select a file, then
click exit on the ImageSettingsModal, you will not be able to select that image again - the file
reader simply doesn't pop up. By clearing the target value on click, the onChange event will be
triggered, whereas before, it does not get triggered since there is no change in target value
This commit changes the flow for image selection in EditPage. Instead of selecting the image on
click, when a user clicks on an image in the ImagesModal, the image is first highlighted and the
image must be selected using a Select button on the top right side
Copy link
Contributor

@prestonlimlianjie prestonlimlianjie left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@prestonlimlianjie prestonlimlianjie left a comment

Choose a reason for hiding this comment

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

Does this PR solve #125?

@kwajiehao kwajiehao merged commit 4f86a1f into staging Feb 19, 2020
@kwajiehao kwajiehao deleted the feat/highlight-selected-image branch February 19, 2020 09:13
kwajiehao added a commit that referenced this pull request Mar 23, 2021
Thanks to PR #124 on the backend isomerpages/isomercms-backend#124,
we can simplify the file-moving logic in `OverviewCard` since `OverviewCard` is
now used only for unlinked pages in the workspace (it is also
used for Resource Category display, but these do not have any move file
functionality).

This allows us to remove all the complex logic associated with file-moving
and replace it with a single API call to the new file moving
endpoint. This also allows us to delete the now-unused util function
`saveFileAndRetrieveUrl`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants