Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

add delete cover feature to edit community form #4535

Merged

Conversation

ThomasRoest
Copy link
Contributor

Status

  • [] WIP
  • Ready for review
  • Needs testing

Deploy after merge (delete what needn't be deployed)

  • api
  • hyperion (frontend)

Closes #4385

This is what I've got so far.
covertest pull request

@spectrum-bot
Copy link

spectrum-bot bot commented Jan 10, 2019

Warnings
⚠️

These modified files do not have Flow enabled:

  • src/components/editForm/style.js

Generated by 🚫 dangerJS

@ThomasRoest
Copy link
Contributor Author

@brianlovin any comments on this?

@brianlovin
Copy link
Contributor

brianlovin commented Jan 17, 2019

@ThomasRoest sorry for the slow review - just pulled everything and this works great! Just one question below about the code and then we can ship this.

@@ -301,6 +311,13 @@ class EditForm extends React.Component<Props, State> {
<SectionTitle>Community Settings</SectionTitle>
<Form onSubmit={this.save}>
<ImageInputWrapper>
{coverPhoto && !/default_images/.test(coverPhoto) && (
Copy link
Contributor

Choose a reason for hiding this comment

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

I've never seen this !/default_images/.test(coverPhoto) syntax before - could you point me to where I can learn what's going on here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a regex method to check if there's a default image or custom (user uploaded image) and to show or hide the delete (X) button.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you!

@ThomasRoest
Copy link
Contributor Author

I've added the same feature to the create community form
image 2019-01-17 at 2 05 09 pm

Copy link
Contributor

@mxstbr mxstbr left a comment

Choose a reason for hiding this comment

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

This looks amazing, thank you so much @ThomasRoest!!! 💯 💯 💯

@mxstbr mxstbr merged commit 3381ad0 into withspectrum:alpha Jan 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants