-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
feat: Add Hours, Minutes, Seconds fields while taking input as idleTimeLimit #33708
base: develop
Are you sure you want to change the base?
feat: Add Hours, Minutes, Seconds fields while taking input as idleTimeLimit #33708
Conversation
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: 4137e43 The changes in this PR will be included in the next version bump. This PR includes changesets to release 35 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Hello @dougfabris , |
Hey @thepiyush-303 thanks for your contribution :) But taking a closer look at it, it concerns me that we would need to have 3 redundant settings, I think that if we want to follow the approach of having 3 input fields, we could convert their respective values to seconds and just store that, wdyt? |
I understand your concern about having redundant settings. Converting the input values to seconds and storing that sounds like a more efficient approach. However, I’ve encountered a couple of issues while implementing this. Firstly, when I change the field values and save them, they revert to the default values when I navigate back to edit them again. Additionally, I'm running into an "invalid params" error when I attempt to save the values. This appears to be due to the extra fields not being recognized by the form. |
I am not a frontend dev, but I don't think there is a need to store the value the same way the user put in, for example: the user inserts 61 minutes, we convert it to 3660 seconds and whenever we load the page we display the value as 1 hour and 1 minute. it does not sound like a complicated algorithm The invalid fields error is probably because the backend is not expecting those new fields you are sending |
Thanks for your input! The issue is that the user needs to provide input in hours, minutes, and seconds. Once they enter the values, if they want to see the changes in the fields, the backend would indeed need to support that. That’s why I chose the approach in the PR. If I'm misunderstanding something, please let me know! |
That is what I mean, the backend should not support multiple settings because we should not have multiple settings. |
Got it, thanks for the clarification! Should I leave this issue as is, or is there anything else you'd like me to address? |
I mean, if you have the time I think it would be a cool addition to do it in the client |
but since you mentioned that having multiple settings might not be approved by other collaborators, I'm hesitant to continue with this approach. If it’s a significant enhancement, I’d be happy to explore it further if it aligns with the team's direction. |
What I mean by that is, we have user preferences that we store in the database, I don't think those inputs should be mapped to actual values in the database, I think it would be interesting to convert their values to seconds and keep storing seconds. |
@Gustrb |
Hey @thepiyush-303 did you update the PR? also, thanks for your dedication |
@@ -27,14 +30,19 @@ const PreferencesUserPresenceSection = () => { | |||
</FieldRow> | |||
</Field> | |||
<Field> | |||
<FieldLabel htmlFor={idleTimeLimit}>{t('Idle_Time_Limit')}</FieldLabel> | |||
<FieldLabel htmlFor={idleTimeLimitH}>{t('Idle_Time_Limit')}</FieldLabel> |
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.
don't you have access to a OnChange callback or smth?
so you can update idleTimeLimit without needing to have 3 separate settings
apps/meteor/client/views/account/preferences/useAccountPreferencesValues.ts
Outdated
Show resolved
Hide resolved
As per your suggestion, I'm working on the second approach to resolve this issue, but I'm currently stuck on a particular challenge. When I modify the seconds, minutes, and hours fields, I'm able to convert and store these values as a total in seconds. If you'd like more details, I'm happy to raise a new PR for further clarification. |
…iyush-303/Rocket.Chat into addingFeatureInUserPresence
Hello @Gustrb ,
Additionally, I have added a new file. Could you please advise on the appropriate location for this file? Finally, could you suggest any changes needed to ensure that my code adheres to Rocket's coding standards? |
Proposed changes (including videos or screenshots)
Before
After
Issue(s)
#33566