Skip to content

Commit 2128fe4

Browse files
committed
This is the **RTM** (_Release To Manufacturing_) Version 4.0.1 ready for a production environment.
If updating from a previous version, please follow the instruction available in the [Update ](https://github.com/CSOIreland/PxStat/wiki/Update) Wiki page. ### Issues for Milestone `4.0.1` * [Enhancements](https://github.com/CSOIreland/PxStat/issues?q=is%3Aissue+milestone%3A%224.0.1+RTM%22+label%3Aenhancement+label%3Areleased) * [Bugs](https://github.com/CSOIreland/PxStat/issues?q=is%3Aissue+milestone%3A%224.0.1+RTM%22+label%3Abug+label%3Areleased)
1 parent 6fd6415 commit 2128fe4

File tree

2,701 files changed

+2556336
-1650
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,701 files changed

+2556336
-1650
lines changed

client/config/config.json

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,23 @@
127127
"experimental": "https://domain.extension/path"
128128
}
129129
},
130+
"map": {
131+
"baseMap": {
132+
"leaflet": [
133+
{
134+
"url": "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
135+
"options": {
136+
"attribution": "&copy; <a target=\"_blank\" href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a>"
137+
}
138+
}
139+
],
140+
"esri": [
141+
{
142+
"url": "https://tiles.arcgis.com/tiles/uWTLlTypaM5QTKd2/arcgis/rest/services/Basemap%20Public/MapServer"
143+
}
144+
]
145+
}
146+
},
130147
"build": {
131148
"threshold": {
132149
"soft": 1000000
@@ -151,7 +168,7 @@
151168
}
152169
},
153170
"analytic": {
154-
"dateRangePicker": 29
171+
"dateRangePicker": 7
155172
}
156173
},
157174
"plugin": {
@@ -258,6 +275,49 @@
258275
}
259276
}
260277
}
278+
},
279+
"firebase": {
280+
"enabled": false,
281+
"config": {
282+
"apiKey": "",
283+
"authDomain": "",
284+
"projectId": "",
285+
"storageBucket": "",
286+
"messagingSenderId": "",
287+
"appId": ""
288+
},
289+
"signInProvider": {
290+
"providers": {
291+
"google": true,
292+
"facebook": true,
293+
"gitHub": true,
294+
"twitter": true
295+
}
296+
}
297+
},
298+
"leaflet": {
299+
"colourScale": [
300+
{
301+
"value": "red",
302+
"name": "red"
303+
},
304+
{
305+
"value": "yellow",
306+
"name": "yellow"
307+
},
308+
{
309+
"value": "blue",
310+
"name": "blue"
311+
},
312+
{
313+
"value": "darkorange",
314+
"name": "orange"
315+
},
316+
{
317+
"value": "darkviolet",
318+
"name": "violet"
319+
}
320+
]
261321
}
262322
}
263323
}

client/css/app.media.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,10 @@ Application - Media
2323
min-width: 100% !important;
2424
max-width: 100% !important;
2525
}
26+
.modal-backdrop.show {
27+
opacity: 0;
28+
}
29+
#return-to-top {
30+
display: none;
31+
}
2632
}

client/entity/analytic/index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@
6969
<div class="bg-default border-right col-4 p-2 text-right" label="m2m"></div>
7070
<div name="analytic-sum-m2m" class="col-8 p-2"></div>
7171
</div>
72+
<div class="border-top border-right border-left row mx-0">
73+
<div class="bg-default border-right col-4 p-2 text-right" label="widgets"></div>
74+
<div name="analytic-sum-widgets" class="col-8 p-2"></div>
75+
</div>
7276
<div class="border-top border-right border-left row mx-0">
7377
<div class="bg-default border-right col-4 p-2 text-right" label="users"></div>
7478
<div name="analytic-sum-users" class="col-8 p-2"></div>
@@ -92,6 +96,7 @@
9296
<th label="date-published"></th>
9397
<th label="bots"></th>
9498
<th label="m2m"></th>
99+
<th label="widgets"></th>
95100
<th label="users"></th>
96101
<th label="total"></th>
97102
</tr>

client/entity/analytic/js/analytic.library.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ app.analytic.callback.readAnalytics = function (data) {
272272
},
273273
{ data: "NltBot" },
274274
{ data: "NltM2m" },
275+
{ data: "NltWidget" },
275276
{ data: "NltUser" },
276277
{ data: "Total" }
277278
],
@@ -293,6 +294,7 @@ app.analytic.callback.readAnalytics = function (data) {
293294
});
294295
}
295296
var totalBot = 0;
297+
var totalWidgets = 0;
296298
var totalM2M = 0;
297299
var totalUsers = 0;
298300
$("#summary-card").find("[name=analytic-sum-bots]").text(function () {
@@ -301,6 +303,12 @@ app.analytic.callback.readAnalytics = function (data) {
301303
});
302304
return app.library.utility.formatNumber(totalBot)
303305
});
306+
$("#summary-card").find("[name=analytic-sum-widgets]").text(function () {
307+
$.each(data, function (index, value) {
308+
totalWidgets = totalWidgets + value.NltWidget;
309+
});
310+
return app.library.utility.formatNumber(totalWidgets)
311+
});
304312
$("#summary-card").find("[name=analytic-sum-m2m]").text(function () {
305313
$.each(data, function (index, value) {
306314
totalM2M = totalM2M + value.NltM2m;
@@ -874,6 +882,11 @@ app.analytic.callback.readTimeline = function (data, selector) {
874882
data: [],
875883
fill: false
876884
};
885+
var widgets = {
886+
label: app.label.static["widgets"],
887+
data: [],
888+
fill: false
889+
};
877890
var users = {
878891
label: app.label.static["users"],
879892
data: [],
@@ -888,12 +901,12 @@ app.analytic.callback.readTimeline = function (data, selector) {
888901
$.each(data, function (key, el) {
889902
bots.data.push(el.NltBot);
890903
M2M.data.push(el.NltM2m);
904+
widgets.data.push(el.NltWidget);
891905
users.data.push(el.NltUser);
892906
total.data.push(el.Total);
893907
localConfig.data.labels.push(el.date ? moment(el.date).format(app.config.mask.date.display) : "");
894908
});
895-
localConfig.data.datasets = [bots, M2M, users, total];
896-
909+
localConfig.data.datasets = [bots, M2M, widgets, users, total];
897910
var config = $.extend(true, {}, app.config.plugin.chartJs.chart, localConfig);
898911
new Chart($(selector).find("[name=dates-line-chart-canvas]"), config);
899912
};

client/entity/build/create/index.dimension.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
<div class="card-header" id="build-create-elimination-map-heading-one">
2020
<h2 class="mb-0">
2121
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#build-create-elimination-map-collapse-elimination" aria-expanded="true" aria-controls="build-create-elimination-map-collapse-elimination">
22-
<span label="elimination"></span> <i name="elimination-popover" class="fas fa-info-circle" data-toggle="popover" data-placement="right" tabindex="0" data-trigger="hover"></i>
22+
<span label="elimination"></span>
23+
<i data-toggle="popover" class="fas fa-info-circle fa-lg text-info pl-2" data-placement="top" data-trigger="hover" label-popover="elimination-explanation" style="cursor: help;"></i>
2324
</button>
2425
</h2>
2526
</div>
@@ -46,7 +47,8 @@ <h2 class="mb-0">
4647
<div class="card-header" id="build-create-elimination-map-heading-two">
4748
<h2 class="mb-0">
4849
<button name="map-accordion-button" class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse" data-target="#build-create-elimination-map-collapse-map" aria-expanded="false" aria-controls="build-create-elimination-map-collapse-map">
49-
<span label="map"></span> <i name="map-popover" class="fas fa-info-circle" data-toggle="popover" data-placement="right" tabindex="0" data-trigger="hover"></i>
50+
<span label="map"></span>
51+
<i data-toggle="popover" class="fas fa-info-circle fa-lg text-info pl-2" data-placement="top" data-trigger="hover" label-popover="map-explanation" style="cursor: help;"></i>
5052
<i name="warning-icon" data-toggle="tooltip" class="fas fa-exclamation-triangle text-danger" style="display: none;"></i>
5153
</button>
5254
</h2>
@@ -179,6 +181,10 @@ <h5 class="mb-0">
179181
<i class="fas fa-trash-alt"></i>
180182
<span label="delete-statistics"></span>
181183
</button>
184+
<button name="download-statistic" class="btn btn-primary text-light">
185+
<i class="fas fa-file-download"></i>
186+
<span label="download-csv"></span>
187+
</button>
182188
</div>
183189
<div class="col-xs-12 col-sm-8 text-right my-2">
184190
<button name="add-statistics" class="btn btn-primary text-light">

client/entity/build/create/js/create.dimension.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,6 @@ $(document).ready(function () {
107107
//Bind the period upload reset button
108108
$("#build-create-upload-periods").find("[name=upload-reset]").once("click", app.build.create.dimension.resetPeriodUpload);
109109

110-
111-
$("#build-create-matrix-dimensions").find("[name=elimination-popover]").popover({
112-
"content": app.label.static["elimination-explanation"],
113-
"html": true
114-
});
115-
116-
$("#build-create-matrix-dimensions").find("[name=map-popover]").popover({
117-
"content": app.label.static["map-explanation"],
118-
"html": true
119-
});
120-
121110
$("#build-create-matrix-dimensions").find("[name=warning-icon]").tooltip({
122111
"title": app.label.static["invalid-geojson-in-px-file"],
123112
})

client/entity/build/create/js/create.dimension.library.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,8 @@ app.build.create.dimension.drawTabs = function () {
283283
);
284284
});
285285

286+
$("#build-create-dimension-accordion-" + value.LngIsoCode).find("[name=download-statistic]").once("click", app.build.create.dimension.downloadStatistic);
287+
286288
$("#build-create-dimension-accordion-" + value.LngIsoCode).find("[name=delete-classifications]").once("click", function () {
287289
api.modal.confirm(
288290
app.library.html.parseDynamicLabel("confirm-delete-classifications", [$("#build-create-matrix-dimensions").find("[name=nav-lng-tab-item].active").attr("lng-iso-name")]),
@@ -1058,6 +1060,31 @@ app.build.create.dimension.deleteAllClassifications = function () {
10581060
app.build.create.dimension.drawClassifications(lngIsoCode);
10591061
};
10601062

1063+
app.build.create.dimension.downloadStatistic = function () {
1064+
var statistic = null;
1065+
var lngIsoCode = $("#build-create-matrix-dimensions").find("[name=nav-lng-tab-item].active").attr("lng-iso-code");
1066+
$.each(app.build.create.initiate.data.Dimension, function (index, dimension) {
1067+
if (dimension.LngIsoCode == lngIsoCode) { //find the data based on the LngIsoCode
1068+
statistic = dimension.Statistic;
1069+
return;
1070+
};
1071+
});
1072+
var fileData = [];
1073+
1074+
if (statistic.length) {
1075+
$.each(statistic, function (index, value) {
1076+
fileData.push({ [C_APP_CSV_CODE]: value.SttCode, [C_APP_CSV_VALUE]: value.SttValue, [C_APP_CSV_UNIT]: value.SttUnit, [C_APP_CSV_DECIMAL]: value.SttDecimal });
1077+
});
1078+
}
1079+
else {
1080+
//create blank template for statistic
1081+
fileData.push({ [C_APP_CSV_CODE]: "", [C_APP_CSV_VALUE]: "", [C_APP_CSV_UNIT]: "", [C_APP_CSV_DECIMAL]: "" });
1082+
}
1083+
// Download the file
1084+
app.library.utility.download(app.build.create.initiate.data.MtrCode + "_" + C_APP_CSV_STATISTIC + "_" + lngIsoCode, Papa.unparse(fileData), C_APP_EXTENSION_CSV, C_APP_MIMETYPE_CSV);
1085+
1086+
};
1087+
10611088
//Add criteria to search for a classification.
10621089
app.build.create.dimension.searchClassifications = function () {
10631090
// Click event search-classifications-modal-search-input

client/entity/build/import/js/import.library.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ app.build.import.drawCallbackimportHistory = function () {
546546
//view user info
547547
$("#build-import-history table").find("[name=user-name]").once("click", function (e) {
548548
e.preventDefault();
549-
app.library.user.modal.read({ CcnUsername: $(this).attr("idn") });
549+
app.library.user.modal.ajax.read({ CcnUsername: $(this).attr("idn") });
550550
});
551551

552552
}

client/entity/build/update/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@
119119
<div class="card-header" id="build-update-elimination-map-heading-one">
120120
<h2 class="mb-0">
121121
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#build-update-elimination-map-collapse-elimination" aria-expanded="true" aria-controls="build-update-elimination-map-collapse-elimination">
122-
<span label="elimination"></span> <i name="elimination-popover" class="fas fa-info-circle" data-toggle="popover" data-placement="right" tabindex="0" data-trigger="hover"></i>
122+
<span label="elimination"></span>
123+
<i data-toggle="popover" class="fas fa-info-circle fa-lg text-info pl-2" data-placement="top" data-trigger="hover" label-popover="elimination-explanation" style="cursor: help;"></i>
123124
</button>
124125
</h2>
125126
</div>
@@ -146,7 +147,8 @@ <h2 class="mb-0">
146147
<div class="card-header" id="build-update-elimination-map-heading-two">
147148
<h2 class="mb-0">
148149
<button name="map-accordion-button" class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse" data-target="#build-update-elimination-map-collapse-map" aria-expanded="false" aria-controls="build-update-elimination-map-collapse-map">
149-
<span label="map"></span> <i name="map-popover" class="fas fa-info-circle" data-toggle="popover" data-placement="right" tabindex="0" data-trigger="hover"></i>
150+
<span label="map"></span>
151+
<i data-toggle="popover" class="fas fa-info-circle fa-lg text-info pl-2" data-placement="top" data-trigger="hover" label-popover="map-explanation" style="cursor: help;"></i>
150152
<i name="warning-icon" data-toggle="tooltip" class="fas fa-exclamation-triangle text-danger" style="display: none;"></i>
151153
</button>
152154
</h2>

client/entity/build/update/js/update.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,6 @@ $(document).ready(function () {
142142
offstyle: "warning",
143143
width: C_APP_TOGGLE_LENGTH
144144
});
145-
146-
$("#build-update-matrix-dimensions").find("[name=elimination-popover]").popover({
147-
"content": app.label.static["elimination-explanation"],
148-
"html": true
149-
});
150-
151-
//
152-
153145
//run bootstrap toggle to show/hide toggle button
154146
bsBreakpoints.toggle(bsBreakpoints.getCurrentBreakpoint());
155147
// Translate labels language (Last to run)

0 commit comments

Comments
 (0)