Skip to content

Commit

Permalink
Merge pull request #104 from asc-csa/bugfixes
Browse files Browse the repository at this point in the history
Bugfixes
  • Loading branch information
nfee006 authored Apr 26, 2021
2 parents 7e9a50b + 005abd8 commit ac038b7
Show file tree
Hide file tree
Showing 7 changed files with 277 additions and 219 deletions.
75 changes: 46 additions & 29 deletions alouette.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,38 +104,48 @@ def interpolate_index(self, **kwargs):

scripts = ASSET_PATH.joinpath("scripts.js").resolve()

# external_stylesheets = ['https://wet-boew.github.io/themes-dist/GCWeb/assets/favicon.ico',
# 'https://use.fontawesome.com/releases/v5.8.1/css/all.css',
# 'https://wet-boew.github.io/themes-dist/GCWeb/css/theme.min.css',
# 'https://wet-boew.github.io/themes-dist/GCWeb/wet-boew/css/noscript.min.css'] # Link to external CSS
external_stylesheets = [
'https://canada.ca/etc/designs/canada/wet-boew/css/wet-boew.min.css',
'https://canada.ca/etc/designs/canada/wet-boew/css/theme.min.css',
'https://use.fontawesome.com/releases/v5.8.1/css/all.css'
# 'assets/gc_theme_cdn/assets/favicon.ico',
# 'https://use.fontawesome.com/releases/v5.8.1/css/all.css',
# 'assets/gc_theme_cdn/css/theme.min.css',
# 'https://wet-boew.github.io/themes-dist/GCWeb/wet-boew/css/noscript.min.css'
] # Link to external CSS

external_scripts = [
# 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.js',
# 'https://wet-boew.github.io/themes-dist/GCWeb/wet-boew/js/wet-boew.min.js',
# 'assets/gc_theme_cdn/js/theme.min.js',
# 'https://cdn.plot.ly/plotly-locale-de-latest.js',
'//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js',
'https://canada.ca/etc/designs/canada/wet-boew/js/wet-boew.min.js',
'https://canada.ca/etc/designs/canada/wet-boew/js/theme.min.js',
'assets/scripts.js'


]

# external_stylesheets = [
# # 'assets/gc_theme/GCWeb/assets/favicon.ico',
# # 'https://wet-boew.github.io/themes-dist/GCWeb/GCWeb/assets/favicon.ico',
# 'https://use.fontawesome.com/releases/v5.8.1/css/all.css',
# # 'assets/gc_theme/GCWeb/css/theme.min.css',
# 'https://wet-boew.github.io/themes-dist/GCWeb/GCWeb/css/theme.min.css',
# 'assets/custom.css'
# # 'assets/gc_theme/wet-boew/css/noscript.min.css',
# # 'https://www.canada.ca/etc/designs/canada/cdts/gcweb/v4_0_30/cdts/compiled/wet-en.js'
# ] # Link to external CSS

external_stylesheets = [
# 'https://wet-boew.github.io/themes-dist/GCWeb/GCWeb/assets/favicon.ico',
'https://use.fontawesome.com/releases/v5.8.1/css/all.css',
'https://wet-boew.github.io/themes-dist/GCWeb/GCWeb/css/theme.min.css',
'assets/custom.css'
# 'assets/gc_theme/wet-boew/css/noscript.min.css',
# 'https://www.canada.ca/etc/designs/canada/cdts/gcweb/v4_0_30/cdts/compiled/wet-en.js'
] # Link to external CSS

external_scripts = [
'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.js',
'https://wet-boew.github.io/themes-dist/GCWeb/wet-boew/js/i18n/en.min.js',
'https://cdn.plot.ly/plotly-locale-de-latest.js',
'https://wet-boew.github.io/themes-dist/GCWeb/wet-boew/js/deps/jquery.magnific-popup.min.js',
'https://wet-boew.github.io/themes-dist/GCWeb/GCWeb/js/theme.min.js',
'assets/scripts.js',
# 'https://www.canada.ca/etc/designs/canada/cdts/gcweb/v4_0_30/cdts/compiled/wet-en.js',
# 'https://www.canada.ca/etc/designs/canada/cdts/gcweb/v4_0_30/cdts/compiled/soyutils.js'
]
# external_scripts = [
# 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.js',
# 'https://wet-boew.github.io/themes-dist/GCWeb/wet-boew/js/i18n/en.min.js',
# 'https://cdn.plot.ly/plotly-locale-de-latest.js',
# 'https://wet-boew.github.io/themes-dist/GCWeb/wet-boew/js/deps/jquery.magnific-popup.min.js',
# 'https://wet-boew.github.io/themes-dist/GCWeb/GCWeb/js/theme.min.js',
# 'assets/scripts.js',
# # 'https://www.canada.ca/etc/designs/canada/cdts/gcweb/v4_0_30/cdts/compiled/wet-en.js',
# # 'https://www.canada.ca/etc/designs/canada/cdts/gcweb/v4_0_30/cdts/compiled/soyutils.js'
# ]

def get_config_dict():
config = configparser.RawConfigParser()
Expand Down Expand Up @@ -567,9 +577,6 @@ def build_filtering():
# marks=year_dict
# ),
html.Div([
html.Label(
htmlFor='date_picker_range'
),
dcc.DatePickerRange(
id='date_picker_range',
min_date_allowed=dt.datetime(1962, 9, 29),
Expand Down Expand Up @@ -614,7 +621,13 @@ def build_filtering():
),
html.Div(children=html.P(id="ground_station_selection"),className="wb-inv")]),
html.Div([
dbc.Alert(color="secondary", id="pos_alert", is_open=False, fade=False, style={"margin-top":"0.5em"}),
dbc.Alert(
color="secondary",
id="pos_alert",
is_open=False,
fade=False,
style={"margin-top":"0.5em"}
),
]),

],
Expand Down Expand Up @@ -2059,6 +2072,8 @@ def make_viz_map(start_date, end_date, stat_selection, var_selection, lat_min, l
Output("Graph_description-2", "children"),
Output("stat-selection-text", "children"),
Output("stat-y-axis-text", "children"),
Output("date_picker_range", "start_date_placeholder_text"),
Output("date_picker_range", "end_date_placeholder_text"),
Output("ground_station_list", "options"),
Output("x_axis_selection_1", "options"),
Output("y_axis_selection_1", "options"),
Expand Down Expand Up @@ -2101,6 +2116,8 @@ def translate_static(x):
_("Map showing either minimum frequency or maximum depth values at each ground station. Each station is represented by a circle, the size of which depends on either the mean or median values of the variables selected. Explore the data by selecting different variables in the drop-down menu on the right."),
_("Select statistic:"),
_("Select plotted value:"),
_("Select start date"),
_("Select end date"),
[ # Ground_station_options
{'label': _('Resolute Bay, No. W. Territories'), 'value': 'Resolute Bay, No. W. Territories'},
{'label': _('Blossom Point, Maryland'), 'value': 'Blossom Point, Maryland'},
Expand Down
2 changes: 0 additions & 2 deletions assets/compiled.css
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,6 @@ input[type="button"] {
font-size: 13px;
}


}
.button:hover,
button:hover,
input[type="submit"]:hover,
Expand Down
19 changes: 19 additions & 0 deletions assets/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ const expected_canvas_count = 8;
$(document).ready(function(){
var canvas_check = setInterval(checkForCanvases, 3000);

var css_fixer = setInterval(removeBaddCss, 3500);

var ariaFixes = setInterval(function(){
var dropdowns = $('.Select-input input');
dropdowns.removeAttr('aria-owns');
$('.Select-input').attr('role', 'option');
}, 3000);

// Callback function to execute when mutations are observed
const callback = function(mutationsList, observer) {
// Use traditional 'for loops' for IE 11
Expand All @@ -17,6 +25,17 @@ $(document).ready(function(){
}
};

function removeBaddCss(){
$("head").find('style').each(function () {
// console.log('removing css');
html = $(this).html();
if(html.match(/border-color:\s*transparent\s*inherit\s*transparent\s*transparent\s*!important/gm)){
$(this).html( html.replace(/border-color:\s*transparent\s*inherit\s*transparent\s*transparent\s*!important/gm,"") );
}
});

}

// Create an observer instance linked to the callback function
const observer = new MutationObserver(callback);

Expand Down
18 changes: 18 additions & 0 deletions header_footer.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,14 @@
'''

gc_header_en = '''
<div class='global-header'>
<nav>
<ul id="wb-tphp" class="wb-init wb-disable-inited">
<li class="wb-slc"><a class="wb-sl" href="#react-entry-point">Skip to main content</a></li>
<!-- <li class="wb-slc"><a class="wb-sl" href="#wb-info">Skip to "About government"</a></li>
<li class="wb-slc"><a class="wb-sl" href="?wbdisable=true" rel="alternate">Switch to basic HTML version</a></li> -->
</ul>
</nav>
<header>
<div id="wb-bnr" class="container">
<div class="row">
Expand Down Expand Up @@ -509,6 +517,7 @@
'''+ gc_breadcrumb_en +'''
</header>
</div>
'''

gc_header_en_old ='''
Expand Down Expand Up @@ -1012,6 +1021,14 @@
'''

gc_header_fr = '''
<div class='global-header'>
<nav>
<ul id="wb-tphp" class="wb-init wb-disable-inited">
<li class="wb-slc"><a class="wb-sl" href="#react-entry-point">Passer au contenu principal</a></li>
<!--<li class="wb-slc"><a class="wb-sl" href="#wb-info">Passer à « Au sujet du gouvernement »</a></li>
<li class="wb-slc"><a class="wb-sl" href="?wbdisable=true" rel="alternate">Passer à la version HTML simplifiée</a></li>-->
</ul>
</nav>
<header>
<div id="wb-bnr" class="container">
<div class="row">
Expand Down Expand Up @@ -1096,6 +1113,7 @@
</header>
</div>
'''

gc_header_fr_old = '''
Expand Down
Binary file modified translations/fr/LC_MESSAGES/messages.mo
Binary file not shown.
Loading

0 comments on commit ac038b7

Please sign in to comment.