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

[GH-66] Improve date format selection UI. Fixes #66 #86

Closed
wants to merge 14 commits into from

Conversation

sanjaydemansol
Copy link
Contributor

@sanjaydemansol sanjaydemansol commented Aug 27, 2021

Summary

Now, Hashtag of Agenda Items has two parts:

  • Prefix
  • Date Format (Dropdown of predefined items)
    Screenshot_76

Testing notes

  • Open agenda settings for the channel and enter desired prefix and choose date format.
  • Create new agenda item in that group.(/agenda queue Task 1)

Output after chosen format:
Screenshot_77

Ticket Link

Fixes #66
Fixes #91

@codecov
Copy link

codecov bot commented Aug 27, 2021

Codecov Report

Merging #86 (e407281) into master (bc0e65d) will increase coverage by 0.55%.
The diff coverage is 100.00%.

@@            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              
Impacted Files Coverage Δ
server/meeting.go 42.16% <100.00%> (+2.16%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc0e65d...e407281. Read the comment docs.

@mickmister
Copy link
Contributor

@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.

@mickmister mickmister linked an issue Aug 27, 2021 that may be closed by this pull request
@hanzei hanzei added the 2: Dev Review Requires review by a core committer label Aug 27, 2021
@jfrerich jfrerich requested a review from mickmister August 31, 2021 14:38
@jfrerich jfrerich added the 3: QA Review Requires review by a QA tester label Aug 31, 2021
Copy link
Contributor

@maisnamrajusingh maisnamrajusingh left a 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

@dipak-demansol
Copy link

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.
#agenda is : Sep_14 1) Task 1
#agenda is : Sep_14 3) task 2
#agenda is : Sep_14 3) Task 3

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
System 6:37 PM(Only visible to you)
Error calculating hashtags. Check the meeting settings for this channel.

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.

@sanjaydemansol
Copy link
Contributor Author

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.
#agenda is : Sep_14 1) Task 1
#agenda is : Sep_14 3) task 2
#agenda is : Sep_14 3) Task 3

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
System 6:37 PM(Only visible to you)
Error calculating hashtags. Check the meeting settings for this channel.

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,
Issue 1: Maybe you are testing functionality expected from #88 in this PR, kindly use code from #88 to test this functionality.
issue 2: Its intended for backwards compatibility.
issue3: Its out of scope for this PR.

@dipak-demansol
Copy link

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.
#agenda is : Sep_14 1) Task 1
#agenda is : Sep_14 3) task 2
#agenda is : Sep_14 3) Task 3
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
System 6:37 PM(Only visible to you)
Error calculating hashtags. Check the meeting settings for this channel.
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,
Issue 1: Maybe you are testing functionality expected from #88 in this PR, kindly use code from #88 to test this functionality.
issue 2: Its intended for backwards compatibility.
issue3: Its out of scope for this PR.

@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.

@dipak-demansol dipak-demansol added QA Review Done PR has been approved by QA and removed 3: QA Review Requires review by a QA tester labels Sep 23, 2021
@mickmister
Copy link
Contributor

@DHaussermann This PR has been marked by @dipak-demansol as QA Review Done, but I'm concerned about the UX of this feature.

@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.

@mickmister
Copy link
Contributor

@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.

Copy link
Contributor

@mickmister mickmister left a 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
Copy link
Contributor

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?

Copy link
Contributor Author

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:
Screenshot_1
ref
2/5, our plugin should be database agnostic but not sure if I should include these changes in this PR.
@mickmister

Copy link
Contributor

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?

Copy link
Contributor Author

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'}}
Copy link
Contributor

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

Copy link
Contributor Author

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'}}>
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Comment on lines 32 to 34
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 }}
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Comment on lines 44 to 54
handleHashtagChange = (e) => {
this.setState({
hashtag: e.target.value,
hashtagPrefix: e.target.value,
});
}

handleDateFormat = (event) => {
this.setState({
dateFormat: event.target.value,
});
};
Copy link
Contributor

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?

Copy link
Contributor Author

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/>
Copy link
Contributor

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/>?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

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',
Copy link
Contributor

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?

Copy link
Contributor Author

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',
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Comment on lines 157 to 161
<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>
Copy link
Contributor

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?

Copy link
Contributor Author

@sanjaydemansol sanjaydemansol Oct 5, 2021

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"), " ", "_"),
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mickmister mickmister requested a review from hanzei October 1, 2021 20:27
@mickmister
Copy link
Contributor

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.
#agenda is : Sep_14 1) Task 1
#agenda is : Sep_14 3) task 2
#agenda is : Sep_14 3) Task 3
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
System 6:37 PM(Only visible to you)
Error calculating hashtags. Check the meeting settings for this channel.
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.

Issue 2: Its intended for backwards compatibility

@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.

Issue3: Its out of scope for this PR.

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:

image

@dipak-demansol
Copy link

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.
#agenda is : Sep_14 1) Task 1
#agenda is : Sep_14 3) task 2
#agenda is : Sep_14 3) Task 3
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
System 6:37 PM(Only visible to you)
Error calculating hashtags. Check the meeting settings for this channel.
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.

Issue 2: Its intended for backwards compatibility

@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.

Issue3: Its out of scope for this PR.

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:

image

@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.

Copy link
Contributor

@hanzei hanzei left a 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
Copy link
Contributor

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?

@jfrerich jfrerich removed their request for review February 10, 2022 18:02
@hanzei hanzei removed the Awaiting Submitter Action Blocked on the author label Feb 15, 2022
@mattermod
Copy link
Contributor

This PR has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

/cc @aspleenic

@guna-demansol
Copy link

Screen.Recording.2022-03-15.at.12.41.48.PM.mov

Please review

@mickmister
Copy link
Contributor

/update-branch

@mattermod
Copy link
Contributor

We don't have permissions to update this PR, please contact the submitter to apply the update.

@mickmister
Copy link
Contributor

@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!

@mickmister
Copy link
Contributor

mickmister commented Apr 27, 2022

@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 - to _, but I'm not entirely sure what all it affects at the moment, which is why I'm bringing this up.

@mickmister
Copy link
Contributor

Once a build is available, I will upload the build to a cloud server for UX to test

@mickmister mickmister removed their request for review August 4, 2022 15:20
@hanzei
Copy link
Contributor

hanzei commented Feb 21, 2023

/update-branch

@mattermost-build
Copy link

We don't have permissions to update this PR, please contact the submitter to apply the update.

@hanzei hanzei added Lifecycle/3:orphaned and removed 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester Lifecycle/1:stale labels Feb 21, 2023
@hanzei hanzei removed this from the v0.3.0 milestone Feb 21, 2023
@hanzei hanzei closed this Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet