Skip to content

Commit

Permalink
Fix switching gtt disabled/enabled projects issues map rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
sanak committed May 14, 2024
1 parent e088ff3 commit 0a53c62
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 7 additions & 0 deletions app/helpers/gtt_map_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ def map_tag(map: nil, layers: map&.layers,
window.createGttClient(target);
contentObserver();
}, { once: true });
var target = document.getElementById('#{uid}');
if (
document.readyState === 'complete'
&& !target.hasChildNodes()
) {
window.createGttClient(target);
}
}
document.addEventListener('DOMContentLoaded', function(){
var target = document.getElementById('#{uid}');
Expand Down
8 changes: 3 additions & 5 deletions test/system/issues_map_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ class IssuesMapTest < ApplicationSystemTestCase

# Select gtt enabled project again
page.find('#issue_project_id').select('eCookbook')
## FIXME: Should replace to commented out assertions below
assert_selector('div.ol-map')
# assert_selector('div.ol-map') do
# assert_selector('canvas')
# end
assert_selector('div.ol-map') do
assert_selector('canvas')
end
end
end

0 comments on commit 0a53c62

Please sign in to comment.