-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Use "New section" as placeholder, empty title as the hidden/builtin title #15581
Conversation
@oliverguenther |
3a9c3e8
to
f0a3ddd
Compare
Good catch. Indeed this should be changed to make it consistent |
f0a3ddd
to
134b567
Compare
Generated by 🚫 Danger |
f61ede5
to
0672230
Compare
Additional changes since your review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not seem to work as expected: it should not allow creating a section without a title. Yet it does.
Also there are some strange things: in MeetingSectionsController
, the meeting section is initially created with title "New section", but this one is not shown in the returned HTML.
It's because in modules/meeting/app/forms/meeting_sections/title.rb
, the title is not used if it is the default title. Why not just use the given value?
When saving, it then accepts the empty value, contrary to the text comment in create contract.
The check in create contract is not run. To ensure the title is present this check should also be done in the update contract of meeting section.
# We allow an empty title to mark an untitled/implicit section | ||
# but users should not be able to create it with an empty title | ||
validates :title, presence: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check should be replicated in the UpdateContract
to prevent users from emptying the section title.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous issue is fixed: when trying to create a section with a blank title, it now displays "Title can't be blank"
I saw 3 other issues, one of which is intentional:
- "+ Add" button turning blank
- section existing with empty title when reloading the page
- incorrect place holder text when editing an existing section having an empty title
"+ Add" button turning blank
Not sure why, but when adding a new section, a new work package or a new agenda item, the green "+ Add" button at the bottom of the page is turning blank.
Is it because it is in a disabled state?
Section existing with empty title when reloading the page
steps:
- click "+ Add" > click "Section"
=> a section is added, prompting for a title - reload the page
=> the section is there, with an empty title
This is the one Oliver explained me that it is kinda intentional, as the section is already created when it is prompting for a title.
I'm just putting it here for acknowledgement.
Incorrect place holder text when editing an existing section having an empty title
Steps:
- Add a section with a proper name
- Edit the first section name (the one being displayed as "Untitled section")
- Actual: the placeholder is "Title"
- Expected: the placeholder should be "New section"
@cbliard thank you for your remarks: Towards No 1: Indeed, the disabled state looks not correctly styled - I try to figure out what is causing this Towards No 2: Yes, this is intentional Towards No 3: Fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good now
@cbliard towards No 1 again: I create a bug for that |
https://community.openproject.org/work_packages/55111