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

Fix: When user changing display timezone than some widgets show no data #18448

Conversation

yrudman
Copy link
Contributor

@yrudman yrudman commented Feb 12, 2019

Issue: user's timezone is part of filter when searching for widget's content. So, when use changing display timezone than data disappears from widgets.

Fix: if widget's content for specific timezone not found than try to find content without specifying timezone

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1676584

@miq-bot add-label bug, reporting

BEFORE:
before

AFTER:
after

@yrudman yrudman force-pushed the remove-timezone-filter-if-widget-content-not-found branch from 866da88 to b8e2557 Compare February 12, 2019 20:41
@yrudman
Copy link
Contributor Author

yrudman commented Feb 13, 2019

@miq-bot add-label hammer/yes

@yrudman yrudman force-pushed the remove-timezone-filter-if-widget-content-not-found branch 2 times, most recently from 93a9cc2 to b80ece6 Compare February 13, 2019 15:49
@yrudman yrudman changed the title [WIP] When user changing display timezone than some widgets show no data When user changing display timezone than some widgets show no data Feb 13, 2019
@yrudman
Copy link
Contributor Author

yrudman commented Feb 13, 2019

\cc @gtanzillo @jrafanie

@miq-bot miq-bot removed the wip label Feb 13, 2019
@yrudman yrudman force-pushed the remove-timezone-filter-if-widget-content-not-found branch 2 times, most recently from f30be94 to 2870643 Compare February 15, 2019 14:35
@yrudman
Copy link
Contributor Author

yrudman commented Feb 18, 2019

@jrafanie could you review

app/models/miq_widget.rb Outdated Show resolved Hide resolved
Copy link
Member

@jrafanie jrafanie left a comment

Choose a reason for hiding this comment

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

LGTM once the comments above are reviewed and possibly fixed.

@yrudman yrudman changed the title When user changing display timezone than some widgets show no data [WIP] When user changing display timezone than some widgets show no data Feb 18, 2019
@miq-bot miq-bot added the wip label Feb 18, 2019
@yrudman yrudman force-pushed the remove-timezone-filter-if-widget-content-not-found branch 2 times, most recently from fad5dbc to 281c8f5 Compare February 19, 2019 14:22
@yrudman yrudman changed the title [WIP] When user changing display timezone than some widgets show no data When user changing display timezone than some widgets show no data Feb 19, 2019
@miq-bot miq-bot removed the wip label Feb 19, 2019
contents ||= miq_widget_contents.find_by(conditions)

if contents.nil?
_log.warn("No contents found for Widget: `#{title}` Group: #{user.current_group.description} in Timezone '#{timezone}'. Attempting to get widget's contents from any Timezone ...")
Copy link
Member

Choose a reason for hiding this comment

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

I believe you want to use single quotes ', not backticks `

Copy link
Member

@jrafanie jrafanie left a comment

Choose a reason for hiding this comment

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

Looks good, just a very minor fix to the log line above.

…w Timezone was not generated yet and some widgets on dasgboard does not show any data since Timezone is present in condition. Fix: if contents with respect to Timezone not found than try to search for widgets content without Timezone filter.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1676584
…Timezone not found than remove Timezone from search and try to find contents again without specifying timezone
@yrudman yrudman force-pushed the remove-timezone-filter-if-widget-content-not-found branch from 281c8f5 to 80373b6 Compare February 20, 2019 14:37
@miq-bot
Copy link
Member

miq-bot commented Feb 20, 2019

Checked commits yrudman/manageiq@1cc4672~...80373b6 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. ⭐

@jrafanie jrafanie merged commit d6776df into ManageIQ:master Feb 20, 2019
@jrafanie jrafanie added this to the Sprint 106 Ending Mar 4, 2019 milestone Feb 20, 2019
@yrudman yrudman changed the title When user changing display timezone than some widgets show no data Fix: When user changing display timezone than some widgets show no data Feb 20, 2019
@yrudman yrudman deleted the remove-timezone-filter-if-widget-content-not-found branch February 20, 2019 16:12
simaishi pushed a commit that referenced this pull request Apr 23, 2019
…et-content-not-found

When user changing display timezone than some widgets show no data

(cherry picked from commit d6776df)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1702480
@simaishi
Copy link
Contributor

Hammer backport details:

$ git log -1
commit f62d833fdfb5d864c208f0255054e676b0e85182
Author: Joe Rafaniello <jrafanie@users.noreply.github.com>
Date:   Wed Feb 20 09:59:48 2019 -0500

    Merge pull request #18448 from yrudman/remove-timezone-filter-if-widget-content-not-found
    
    When user changing display timezone than some widgets show no data
    
    (cherry picked from commit d6776dffb39768382bdc3106e6dfd0b33627c8a7)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1702480

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants