-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
settings: add tooltip to clarify invalid Jitsi URL #27594
Conversation
Thanks! However, you need to implement a tooltip that is exactly as specified in the issue description. Also, please update your commit message to match the commit style guidelines? |
Hi @alya! So you mean that the tooltip should have the text "Cannot save invalid Jitsi server URL."? |
Yes, that's why that phrase was used in the issue. I don't see a problem with the translation. If it was an intentional change, note that you checked off this item in the PR checklist without implementing it. The PR checklist is there for a good reason, as not following it wastes time and requires more review round-trips. ;)
|
475ed46
to
26f6639
Compare
We have now solved the issue and updated the tests so it includes "Jitsi". Thank you for the tip about the checklist, will look more carefully in the future. It is now ready for review. |
Your PR is not ready for review, as you have not addressed half of my feedback:
|
Hi, so sorry we missed that part but now it should be updated according to the guidelines now :) |
Thanks! @sayamsamal could you please review this one? I have not tested it. |
@@ -1,7 +1,7 @@ | |||
{{#unless show_only_indicator}} | |||
<div class="save-button-controls hide"> | |||
<div class="inline-block subsection-changes-save"> | |||
<button class="save-discard-widget-button button primary save-button" data-status="save"> | |||
<button class="save-discard-widget-button button primary save-button" data-status="save" id="save-discard-widget-id"> |
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.
Let's not add an extra ID when we can use the preexisting .save-button
class for the same purpose,
web/src/tippyjs.js
Outdated
onShow(instance) { | ||
const $elem = $(instance.reference); | ||
if ($($elem).find("#save-discard-widget-id").is(":disabled")) { | ||
const content = $t({defaultMessage: "Cannot save invalid Jitsi server URL"}); |
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.
Since the issue description asks for a period .
at the end of the line, let's include that.
tools/lib/capitalization.py
Outdated
@@ -161,14 +162,17 @@ | |||
SPLIT_BOUNDARY = "?.!" # Used to split string into sentences. | |||
SPLIT_BOUNDARY_REGEX = re.compile(rf"[{SPLIT_BOUNDARY}]") | |||
|
|||
# Regexes which check capitalization in sentences. |
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 comment is repeated twice, please recheck your code for simple errors as such to make it easier for the reviewers.
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.
Also, the only change that should have been part of this commit in the current file is the addition of Jitsi in the ignored phrases. If you want to do additional cleanup, please include it as an additional commit with a commit message that explains those changes.
tools/lib/capitalization.py
Outdated
# Checks if an upper case character exists | ||
r"^[A-Z][a-z]+[\sa-z0-9]+[A-Z]", | ||
# after a lower case character when the first character is in upper case. |
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.
Both the comments are actually part of a single comment.
Thank you @peterssonlinn and @angelicaferlin. I have left you some feedback which should be rather quick to fix and will make the code a bit cleaner. That being said, the PR does work as intended and you have approached it in the right way, so good job on that. |
Also please provide the Commit title
Commit message
Co-authored-by: Angelica Ferlin <angelica.ferlin@gmail.com> |
Thank you for the feedback and the kind words! We have now updated the PR with your suggestions :) |
4896f80
to
f4985ef
Compare
Hi @timabbott and @alya, I and Angelica would really appreciate some answers to the question that we have posted regarding how we can proceed. Could you please answer and give us some guidance? |
@sahil839 can you review this one? I'm not at all caught up on it. |
297e48d
to
601e5ae
Compare
This commit moves the function initialize_disable_btn_hint_popover from stream_ui_updates.js to settings_components.js due to circular dependencies. Co-authored-by: Angelica Ferlin <angelica.ferlin@gmail.com>
const $button_wrapper = $subsection_elem.find(".subsection-changes-save"); | ||
const is_tippy = $button_wrapper.get(0)._tippy; | ||
if (disable_save_btn) { | ||
if (!is_tippy) { |
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 need this is_tippy
condition? I don't think we do this check at other places.
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.
We added a clarifying comment that explains why we need this. In short, we need to check that there is not already a tippy in place since this function runs every time a letter is entered in the URL box.
web/src/settings_components.js
Outdated
$t({defaultMessage: "Cannot save invalid Jitsi server URL."}), | ||
); | ||
$button_wrapper.get(0)._tippy.setProps({ | ||
placement: "top", |
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.
To do this in a better way, we can pass opts
object to initialize_disable_btn_hint_popover
and then update the code there to be something like -
const tippy_opts = {
animation: false,
hideOnClick: false,
placement: "bottom",
...opts,
};
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.
We updated to your suggestion
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 updating the PR. Posted a couple of comments, looks good otherwise.
This commit adds a tooltip in organization settings, when the save button is disabled due to invalid Jitsi URL. Fixes zulip#27511. Co-authored-by: Angelica Ferlin <angelica.ferlin@gmail.com>
@sahil839 we have updated the PR according to your suggestions. Thanks for the fast feedback. Let us know if there is anything else that needs to be updated. :) |
@@ -681,22 +681,40 @@ function enable_or_disable_save_button($subsection_elem) { | |||
disable_save_btn = should_disable_save_button_for_time_limit_settings(time_limit_settings); | |||
} else if ($subsection_elem.attr("id") === "org-other-settings") { | |||
disable_save_btn = should_disable_save_button_for_jitsi_server_url_setting(); | |||
const $button_wrapper = $subsection_elem.find(".subsection-changes-save"); | |||
const is_tippy = $button_wrapper.get(0)._tippy; |
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.
A better variable name here might be tippy
or tippy_instance
since it is not a boolean and is actually a tippy instance.
Also, would be good to update this to be $button_wrapper[0]._tippy
just so that we have it consistent with other places in the codebase.
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.
Looks good otherwise. Will mark it ready for "integration review" once these changes are done
@peterssonlinn Do you plan to address @sahil839 's feedback above, or should we take over and finish this PR? |
Heads up @peterssonlinn, we just merged some commits that conflict with the changes you made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the |
Closing in favor of #29386, thanks for your effort on this @peterssonlinn and @angelicaferlin! |
Added tooltip to clearify why save button is disabled when invalid Jitsi URL.
Co-authored-by: Angelica Ferlin angelica.ferlin@gmail.com
Fixes #27511.
Screenshots and screen captures:
Gif belows shows the new tooltip.
Self-review checklist
(variable names, code reuse, readability, etc.).
Communicate decisions, questions, and potential concerns.
Individual commits are ready for review (see commit discipline).
Completed manual review and testing of the following: