Skip to content

Conversation

@cirosantilli
Copy link
Contributor

There was a lot of code duplication here.

There is also a third copy which has diverged more and which we should DRY out as well: the new MR form. It probably has the best visual style of the three and should be the one to copy. Opened an issue for that at: https://github.com/gitlabhq/gitlabhq/issues/7679 so we won't forget.

The issue edit and new were already factored.

Minor visible changes:

  • "Issue is parsed with GFM" message changed to: "Parsed with GFM". Shorter, DRYer, and it is obvious that we are talking about the description that corresponds to the textarea above.

I cannot see any other behavior / UI changes.

Non-visible changes:

  • title input element:
    • remove rows attribute. Does nothing on input type="text".
    • remove class "pad" from the merge request form. Not used anywhere in the app.

TODO in future merge requests: DRY those forms even further on the points they diverged more:

  • errors
  • labels
  • submit

Found using https://github.com/UncleGene/flay-haml

@TeatroIO
Copy link

TeatroIO commented Sep 3, 2014

I've prepared a stage. Click to open.

Copy link
Member

Choose a reason for hiding this comment

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

@cirosantilli Is this PR still WIP?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Razer6 ah sorry, I was considering to factor this out as it duplicates model information, but in the end decided not too. We should be using https://github.com/plataformatec/simple_form, it can factor this, and much more.

Copy link
Member

Choose a reason for hiding this comment

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

@cirosantilli Sounds interesting. @randx What are thoughts a bout it? I ❤️ refactoring because it removes so much duplicated code!

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this refactoring makes sense

@cirosantilli cirosantilli force-pushed the factor-new-issue-edit-mr branch from 08e6f9b to 788033a Compare September 4, 2014 07:16
@dzaporozhets
Copy link
Contributor

@cirosantilli it is ready for merge right?

@cirosantilli
Copy link
Contributor Author

@randx Yes, we factor the 255 on another PR.

dzaporozhets added a commit that referenced this pull request Sep 4, 2014
@dzaporozhets dzaporozhets merged commit bd00233 into gitlabhq:master Sep 4, 2014
@cirosantilli cirosantilli deleted the factor-new-issue-edit-mr branch September 4, 2014 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants