-
Notifications
You must be signed in to change notification settings - Fork 21
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
[GH-66] Improve date format selection UI. Fixes #66 #86
Conversation
Codecov Report
@@ Coverage Diff @@
## master #86 +/- ##
==========================================
+ Coverage 24.56% 25.12% +0.55%
==========================================
Files 7 7
Lines 403 406 +3
==========================================
+ Hits 99 102 +3
Misses 287 287
Partials 17 17
Continue to review full report at Codecov.
|
@sanjaydemansol Please make sure "Fixes #66" is in the description of the PR when it is submitted. Otherwise, the issue and PR will not be linked. |
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.
LGTM - @mickmister Might be best if you took a look at this first before reviewing #12 and #47
Co-authored-by: Jason Frerich <[email protected]>
Co-authored-by: Jason Frerich <[email protected]>
Co-authored-by: Jason Frerich <[email protected]>
Tested and failed issue 1 :- after creating 3 agenda i deleted 2nd agenda then i create 4th agenda then again 3rd number assign to the 4th agenda so task 2 & task 3 agenda number is same. issue 2 :- in the summary i can see the validation as "You may use underscore_. Other special characters including - , not allowed." but i created agenda using those special character as "#agenda is : !@#$%^&*()_+=?><:"{}2021_9_14 8) test message". issue 3 :- there should be a validation if user click on the save button without selecting the "Meeting Day", because currently without selecting the meeting day if user create the agenda then user is getting this error as improvement :- it would be great if you add colour to the date same as agenda colour so it will be easy to read the date. |
Hi @dipak-demansol, welcome to the Mattermost community, |
@sanjaydemansol ok, so as per this PR, I'm able to Create agenda using the different Date Format and also able to update the Prefix so i can say Its Pass. |
@DHaussermann This PR has been marked by @dipak-demansol as @matthewbirtch Can you or another designer take a look at this and the linked issue #66 to see if this is going in the right direction UX-wise? The goal of this addition is to give the user some guidance (really a fixed set of options) on creating an agenda hashtag format, rather than having them learn the rules of the agenda hashtag formatting. |
@sanjaydemansol What is the purpose of moving away from using dashes, and using underscores instead? At the moment, I think creating agenda hashtags with dashes is more common. |
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.
Thanks for the updates on the PR @sanjaydemansol 👍 I've left some requests and questions on the code
HashtagFormat string `json:"hashtagFormat"` // Default: {ChannelName}-Jan02 | ||
HashtagFormat string `json:"hashtagFormat"` // Default: {ChannelName}-Jan-2 |
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.
Why did the default change here?
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.
Hashtags with -
were returning no results for me, after some digging found out:
ref
2/5, our plugin should be database agnostic but not sure if I should include these changes in this PR.
@mickmister
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.
I'm not able to reproduce this issue using postgress using #foo-02
. Is there anything more specific case that causes issues?
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.
Case was same, but issue appeared randomly.
name='format' | ||
value={this.state.dateFormat} | ||
onChange={this.handleDateFormat} | ||
style={{height: '35px', border: '1px solid #ced4da'}} |
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.
Can this be done using an scss
file rather than using style
directly? If you have questions on this, please ask on the Mattermost community server
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.
Sure, will move all css to scss.
href='https://godoc.org/time#pkg-constants' | ||
>{'Go time package.'}</a> | ||
{' Embed a date by surrounding what January 2, 2006 would look like with double curly braces, i.e. {{Jan02}}'} | ||
<div style={{display: 'flex'}}> |
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.
What does setting this value do in this case? It doesn't look like there are any alignItems
, justifyContent
, etc. rules being applied in the element's children.
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.
Actually, this expands items to fill available free space or shrinks them to prevent overflow.
const splitResult = this.props.meeting.hashtagFormat.split('{{');// we know, date Format is preceded by {{ | ||
const hashtagPrefix = splitResult[0]; | ||
const dateFormat = splitResult[1].substring(0, splitResult[1].length - 2); // remove trailing }} |
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.
Can we trust that this.props.meeting.hashtagFormat
is a correctly formatted string? i.e. it has {{
and }}
Also if it's an existing agenda setting that is made before this PR, do we know that dateFormat
will be equal to one of the available options?
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.
For the new ones, yes. Since we are assigning value from controlled values.
no, if any unknown value is there. 1st value from the list is used.
handleHashtagChange = (e) => { | ||
this.setState({ | ||
hashtag: e.target.value, | ||
hashtagPrefix: e.target.value, | ||
}); | ||
} | ||
|
||
handleDateFormat = (event) => { | ||
this.setState({ | ||
dateFormat: event.target.value, | ||
}); | ||
}; |
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.
Can we be consistent and use e
in both of these cases, instead of using event
here?
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.
sure, will do that.
style={{padding: '5px'}} | ||
> | ||
<label className='control-label'>{'Date Format'}</label> | ||
<br/> |
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.
Are we able to accomplish this with css instead of using <br/>
?
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.
sure
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.
@mickmister removed <br/>
tag and there was no affect on design.
weekdays: [1], | ||
dateFormat: '1-2', |
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.
What does 1-2
mean?
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.
Great catch, seems like I missed this while separating commits, will fix this.
@@ -17,8 +17,9 @@ export default class MeetingSettingsModal extends React.PureComponent { | |||
super(props); | |||
|
|||
this.state = { | |||
hashtag: '{{Jan02}}', | |||
hashtagPrefix: 'Prefix', |
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.
Do we have a way for the user to define their own date format that is used, like the feature currently works?
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.
no, as per issue. IMO it is end goal to limit that.
<option value='Jan 2'>{'month_day'}</option> | ||
<option value='2 Jan'>{'day_month'}</option> | ||
<option value='1 2'>{'month_day'}</option> | ||
<option value='2 1'>{'day_month'}</option> | ||
<option value='2006 1 2'>{'year_month_day'}</option> |
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.
Why do the values have spaces instead of underscores?
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.
because underscore has special significance for go time
package, which we use. Hence we have this workaround for swapping _
with
.
}}, | ||
want: "#QA-" + assertNextWeekdayDate(time.Monday, true).Format("January 02 2006"), | ||
want: "#QA_" + strings.ReplaceAll(assertNextWeekdayDate(time.Monday, true).Format("January 02 2006"), " ", "_"), |
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 seems like a big drive of certain changes involve avoiding dashes and using underscores instead, which is an opinionated approach that is not backwards compatible with existing agenda settings. Why is this change required?
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.
@sanjaydemansol Can you explain the considerations that have been made for backwards compatibility? What compatibility issues are taken into account in the PR? @sanjaydemansol @dipak-demansol Can you please provide test cases for testing the backwards compatibility. Then the test cases can be documented and @sanjaydemansol can write appropriate unit tests for the different cases.
If it is a serious issue captured that is out of scope for the PR, please make sure that either the person that found the bug or the person that pointed out that it's out of scope creates a ticket to make sure the issue is fixed. @sanjaydemansol If you would like @dipak-demansol to create it (maybe he has more context of the full problem), you can ask him to create it, otherwise you can ask someone else, or you can create the ticket. The main point is to make it so the bug doesn't fall through the cracks. You can use GitHub's "Reference in new issue" feature that allows you to easily copy a PR comment into a new issue: |
@mickmister hi, Thanks for the reply, i will test this PR again, If the issue regenerate again then i will report it and if its out of scope then i create new issue. also i will add the test cases. |
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.
What is the impact on existing agenda setting using -
in there hashtag?
HashtagFormat string `json:"hashtagFormat"` // Default: {ChannelName}-Jan02 | ||
HashtagFormat string `json:"hashtagFormat"` // Default: {ChannelName}-Jan-2 |
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.
I'm not able to reproduce this issue using postgress using #foo-02
. Is there anything more specific case that causes issues?
This PR has been automatically labelled "stale" because it hasn't had recent activity. /cc @aspleenic |
Screen.Recording.2022-03-15.at.12.41.48.PM.movPlease review |
/update-branch |
We don't have permissions to update this PR, please contact the submitter to apply the update. |
@guna-demansol Do you mind pushing another commit to trigger CI to create a build for this? CircleCI deletes them after one month. Thank you! |
@DHaussermann This will require regression testing on existing agenda settings, to make sure upgrading to this version of the plugin doesn't break existing settings, especially agenda settings that use dashes, as there is some string replacement going on in the PR |
Once a build is available, I will upload the build to a cloud server for UX to test |
/update-branch |
We don't have permissions to update this PR, please contact the submitter to apply the update. |
Summary
Now, Hashtag of Agenda Items has two parts:
Testing notes
/agenda queue Task 1
)Output after chosen format:
Ticket Link
Fixes #66
Fixes #91