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

Change: confirm button text to create motion #3528

Merged
merged 4 commits into from
Jul 1, 2022

Conversation

Julianahlk
Copy link
Contributor

@Julianahlk Julianahlk commented Jun 22, 2022

Description

This PR is for changing the Confirm button text to Create Motion when creating a motion.

New stuff ✨

  • Updated text for the confirm button for all forms that create motions. Example:

Screen Shot 2022-06-24 at 4 48 35 PM

Screen Shot 2022-06-24 at 4 48 46 PM

Changes 🏗

  • The button text will need to change back to Confirm if the action is forced.
  • If the extension Governance ( Reputation Weight ) is disabled the button should show the text confirm.

Example:

Screen Shot 2022-06-24 at 4 54 19 PM

Screen Shot 2022-06-24 at 4 54 32 PM

(Resolves | Contributes to) #3503

@CLAassistant
Copy link

CLAassistant commented Jun 22, 2022

CLA assistant check
All committers have signed the CLA.

@Julianahlk Julianahlk self-assigned this Jun 22, 2022
@Julianahlk Julianahlk marked this pull request as ready for review June 24, 2022 15:38
@arrenv
Copy link
Member

arrenv commented Jun 27, 2022

@Julianahlk To request a review from everyone, you can use the JoinColony/frontend team option.

65a0ed13-0611-4b2f-bdf8-de25b0aa8c9e.=

Copy link
Member

@arrenv arrenv left a comment

Choose a reason for hiding this comment

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

Works great, nice one @Julianahlk!! Congrats on your first PR 🥇

@Julianahlk
Copy link
Contributor Author

Thanks @arrenv I will use that tag next time. Happy it works as intended. Thanks for reviewing it!

Copy link
Contributor

@chinins chinins left a comment

Choose a reason for hiding this comment

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

Great work for your first PR. There are 2 things to correct:

  • I think that you forgot the NetworkContractUpgradeDialog
  • In the create motion version of the button the text is not centred as per below. It's a tricky thing to notice and I paid attention because I had to update the button styles in another PR to fix this.

Screenshot 2022-06-27 at 12 08 03

Copy link
Collaborator

@willm30 willm30 left a comment

Choose a reason for hiding this comment

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

Nice PR! I presume the dialogs that have not been changed (e.g. ManageWhitelistDialogForm (Manage Address Book)) haven't been changed because they don't require a motion to be submitted? Or is every dialog supposed to have this "Create Motion" text?

@Julianahlk
Copy link
Contributor Author

Julianahlk commented Jun 27, 2022

@chinins Oh I nice, thanks for catching that one I missed.
I will center the text. That's something I didn't check because I thought the button would re-size automatically. Thanks for reviewing!

@rdig
Copy link
Member

rdig commented Jun 27, 2022

Nice PR! I presume the dialogs that have not been changed (e.g. ManageWhitelistDialogForm (Manage Address Book)) haven't been changed because they don't require a motion to be submitted? Or is every dialog supposed to have this "Create Motion" text?

You are correct, the "missing" dialogs do not create a Motion, as they are basically cheating behind the scene and do not call a contract function, in the same way as the others do

@rdig
Copy link
Member

rdig commented Jun 27, 2022

@Julianahlk

I will center the text. That's something I didn't check because I thought the button would re-size automatically. Thanks for reviewing!

For this you'll have to add local styles that overwrite the Button component's default styles. Have a look at other examples and you'll catch on

Copy link
Member

@rdig rdig left a comment

Choose a reason for hiding this comment

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

Other than what Olga found, I'm good with this.

I'm pre-approving, but do please address Olga's concerns before merging

@Julianahlk
Copy link
Contributor Author

Julianahlk commented Jun 28, 2022

For this you'll have to add local styles that overwrite the Button component's default styles. Have a look at other examples and you'll catch on.

On it @rdig ! Thank you for the brief explanation.

@Julianahlk
Copy link
Contributor Author

Julianahlk commented Jun 28, 2022

@chinins @rdig

I switched the width property to be minWidth so the Create Motion/Confirm button could expand to fit any future size text (localized text). I am not sure if this what you were looking for but I think it is more future proof as the buttons can handle longer text if necessary. Let me know what you think.

rdig
rdig previously requested changes Jun 28, 2022
Copy link
Member

@rdig rdig left a comment

Choose a reason for hiding this comment

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

Good, but I'd prefer your change be done inside CSS, rather then JS (components)

Also, you have a bad merge in your branch
Screenshot from 2022-06-29 01-23-16

If you were attempting to update the branch, you did it the wrong way around, as we use git rebase for that.

Let me know if you need help restoring your branch

loading={isSubmitting}
disabled={!isValid || inputDisabled}
style={{ width: styles.wideButton }}
style={{ minWidth: styles.wideButton }}
Copy link
Member

Choose a reason for hiding this comment

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

We usually prefer to add this via css styles not via JS.

You can do the same, by overwriting the button min-width in the styles file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rdig So my goal was to remove the width style and replace it with minWidth. Are you saying that having the width style in the tsx file wasnt the best way to do it to begin with?

Copy link
Member

Choose a reason for hiding this comment

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

Exactly. But now that I'm thinking more about this, in order to expedite this PR, leave it like it is for now.

Let's just fix your branch tommorow, then you can merge it

Comment on lines 72 to 78
{isUserReputationLoading ? (
<SpinnerLoader
appearance={{
theme: 'grey',
size: 'small',
}}
/>
Copy link
Member

Choose a reason for hiding this comment

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

How did this changes end up in here ? These are not related to your branch.

Did you cherry-pick them from somewhere? If so, why ?

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 looks like there are these commits from @arrenv earlier today that ended up in my branch, 0f5a455
I think this is the cause of these changes.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, some rebase / merge screwed up your branch. We'll fix it tommorow.

@Julianahlk
Copy link
Contributor Author

Julianahlk commented Jun 28, 2022

@rdig Regarding the bad merge. Im not sure why this happened this time because I did try to use, git pull --rebase origin master. It seems like it was a merge of my own branch into my branch. I could use help restoring this.

@rdig rdig dismissed their stale review June 28, 2022 23:28

More or less fine as it is.

@Julianahlk Julianahlk force-pushed the feature/3503-create-motion-button branch from 7363973 to 6b07a18 Compare June 29, 2022 11:07
@Julianahlk
Copy link
Contributor Author

@chinins I implemented the changes you suggested and solved my merge conflicts with Raul yesterday. Can you please take a look at this PR again whenever you have a chance? Thank you!

Copy link
Contributor

@chinins chinins left a comment

Choose a reason for hiding this comment

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

All good - nice work!

@Julianahlk
Copy link
Contributor Author

All good - nice work!

Thank you!

@Julianahlk Julianahlk force-pushed the feature/3503-create-motion-button branch from d9d01ce to f3ec627 Compare June 30, 2022 21:08
@rdig rdig force-pushed the feature/3503-create-motion-button branch from f3ec627 to 0baa98a Compare July 1, 2022 08:25
@Julianahlk Julianahlk merged commit 4a75bee into master Jul 1, 2022
@Julianahlk Julianahlk deleted the feature/3503-create-motion-button branch July 1, 2022 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants