Skip to content

Commit

Permalink
### Enhancements:
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzobruni committed Jan 22, 2020
1 parent feaf5eb commit 1a02b86
Show file tree
Hide file tree
Showing 64 changed files with 381 additions and 8,891 deletions.
2 changes: 1 addition & 1 deletion client/css/app.library.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ label.mandatory:before, span.mandatory:before {
margin: 0 auto;
}

.modal-full .modal-content {
.modal-full>.modal-content {
min-height: 100vh;
}

Expand Down
4 changes: 2 additions & 2 deletions client/entity/build/create/js/create.dimension.library.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ app.build.create.dimension.periodsManualValid = true;
*/
app.build.create.dimension.ajax.readFormat = function () {
api.ajax.jsonrpc.request(
app.config.url.api.private,
app.config.url.api.public,
"PxStat.System.Settings.Format_API.Read",
{
"LngIsoCode": null,
Expand Down Expand Up @@ -1544,7 +1544,7 @@ app.build.create.dimension.callback.useClassification = function (variables) {
app.build.create.dimension.callback.downloadClassification = function (variables) {
var fileData = [];
$.each(variables, function (i, row) {
fileData.push({ [C_APP_CSV_CODE]: row.VrbCode, C_APP_CSV_VALUE: row.VrbValue });
fileData.push({ [C_APP_CSV_CODE]: row.VrbCode, [C_APP_CSV_VALUE]: row.VrbValue });
});
var mimeType = "text/plain";
var pom = document.createElement('a');
Expand Down
9 changes: 6 additions & 3 deletions client/entity/build/create/js/create.import.library.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,14 @@ app.build.create.import.callback.read.drawProperties = function () {

//get and set the copyright code
var cprCode = defaultData.extension.copyright.code;
//make unselected by default
$("#build-create-initiate-setup [name=copyright-code]").val("select");

//if valid copyright, select this
$("#build-create-initiate-setup [name=copyright-code] > option").each(function () {
if (this.value == cprCode) {
$(this).attr("selected", "selected");
}
else {
$(this).removeAttr("selected");
}
});

//get and set the official flag
Expand All @@ -242,5 +242,8 @@ app.build.create.import.callback.read.drawProperties = function () {
$(this).prop("checked", false);
}
});

//always check default language
$("[name=lng-group][value=" + app.config.language.iso.code + "]").prop("checked", true);
}

14 changes: 4 additions & 10 deletions client/entity/build/create/js/create.initiate.library.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ app.build.create.initiate.ajax.matrixLookup = function () {
// Change app.config.language.iso.code to the selected one
api.ajax.jsonrpc.request(app.config.url.api.private,
"PxStat.Data.Matrix_API.ReadCodeList",
{
LngIsoCode: app.label.language.iso.code
},
null,
"app.build.create.initiate.callback.matrixLookup");
};

Expand Down Expand Up @@ -70,12 +68,7 @@ app.build.create.initiate.callback.drawMatrix = function (data) {
var localOptions = {
data: data,
columns: [
{
data: null,
render: function (_data, _type, row) {
return app.library.html.tooltip(row.MtrCode, row.MtrTitle);
}
},
{ data: "MtrCode" }
],
drawCallback: function (settings) {
app.build.create.initiate.drawCallbackDrawMatrix();
Expand Down Expand Up @@ -257,7 +250,8 @@ app.build.create.initiate.callback.readCopyright = function (response) {
$("#build-create-initiate-setup").find("[name=copyright-code]").append($("<option>", {
"text": app.label.static["select-uppercase"],
"disabled": "disabled",
"selected": "selected"
"selected": "selected",
"value": "select"
}));

$.each(data, function (key, value) {
Expand Down
4 changes: 2 additions & 2 deletions client/entity/build/update/js/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $(document).ready(function () {
//Bind the preview button
$("#build-update-upload-file").find("[name=file-data-view]").once("click", function () {
if (app.build.update.upload.file.content.source.size > app.config.upload.threshold.soft) {
api.modal.confirm(app.library.html.parseDynamicLabel("confirm-file", [app.library.utility.formatNumber(Math.ceil(app.build.update.upload.file.content.source.size / 1024)) + " KB"]),
api.modal.confirm(app.library.html.parseDynamicLabel("confirm-preview", [app.library.utility.formatNumber(Math.ceil(app.build.update.upload.file.content.source.size / 1024)) + " KB"]),
app.build.update.upload.previewSource)
}
else {
Expand Down Expand Up @@ -100,7 +100,7 @@ $(document).ready(function () {
//bind data preview button
$("#build-update-matrix-data").find("[name=preview-data]").once("click", function () {
if (app.build.update.upload.file.content.data.size > app.config.upload.threshold.soft) {
api.modal.confirm(app.library.html.parseDynamicLabel("confirm-file", [app.library.utility.formatNumber(Math.ceil(app.build.update.upload.file.content.data.size / 1024)) + " KB"]),
api.modal.confirm(app.library.html.parseDynamicLabel("confirm-preview", [app.library.utility.formatNumber(Math.ceil(app.build.update.upload.file.content.data.size / 1024)) + " KB"]),
app.build.update.callback.previewData)
}
else {
Expand Down
2 changes: 1 addition & 1 deletion client/entity/build/update/js/update.library.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ app.build.update.callback.readCopyright = function (response) {
*/
app.build.update.ajax.readFormat = function () {
api.ajax.jsonrpc.request(
app.config.url.api.private,
app.config.url.api.public,
"PxStat.System.Settings.Format_API.Read",
{
"LngIsoCode": null,
Expand Down
24 changes: 15 additions & 9 deletions client/entity/build/update/js/update.upload.library.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ app.build.update.upload.ajax.matrixLookup = function () {
// Change app.config.language.iso.code to the selected one
api.ajax.jsonrpc.request(app.config.url.api.private,
"PxStat.Data.Matrix_API.ReadCodeList",
{
LngIsoCode: app.label.language.iso.code
},
null,
"app.build.update.upload.callback.matrixLookup");
};

Expand Down Expand Up @@ -92,12 +90,7 @@ app.build.update.upload.callback.drawMatrix = function (data) {
var localOptions = {
data: data,
columns: [
{
data: null,
render: function (_data, _type, row) {
return app.library.html.tooltip(row.MtrCode, row.MtrTitle);
}
},
{ data: "MtrCode" },
],
drawCallback: function (settings) {
app.build.update.upload.callback.drawCallbackDrawMatrix();
Expand Down Expand Up @@ -705,6 +698,19 @@ app.build.update.upload.callback.readInput = function (response) {
else if (response.data !== undefined) {
app.build.update.ajax.response = response.data;
$("#build-update-upload-file").find("[name=upload-error-card]").hide();


//check that we have default language in the response
var languages = [];
$(app.build.update.ajax.response).each(function (key, value) {
var data = JSONstat(value);
languages.push(data.extension.language.code);
});

if (jQuery.inArray(app.config.language.iso.code, languages) == -1) {
api.modal.error(app.library.html.parseDynamicLabel("update-source-invalid-language", [app.config.language.iso.name]));
return;
}
app.build.update.upload.drawProperties();
}
else api.modal.exception(app.label.static["api-ajax-exception"]);
Expand Down
2 changes: 1 addition & 1 deletion client/entity/build/upload/js/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $(document).ready(function () {
$("#build-upload-container").find("[name=upload-btn-preview]").once("click", function () {
if (app.build.upload.file.size > app.config.upload.threshold.soft) {
var fileSizeKB = app.library.utility.formatNumber(Math.ceil(app.build.upload.file.size / 1024)) + " KB";
api.modal.confirm(app.library.html.parseDynamicLabel("confirm-file", [fileSizeKB]), app.build.upload.preview);
api.modal.confirm(app.library.html.parseDynamicLabel("confirm-preview", [fileSizeKB]), app.build.upload.preview);
}
else {
// Preview file content
Expand Down
2 changes: 1 addition & 1 deletion client/entity/build/upload/js/upload.panel.library.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ app.build.upload_panel.format.callback = {};
*/
app.build.upload_panel.format.ajax.read = function () {
api.ajax.jsonrpc.request(
app.config.url.api.private,
app.config.url.api.public,
"PxStat.System.Settings.Format_API.Read",
{
"FrmDirection": C_APP_TS_FORMAT_DIRECTION_UPLOAD
Expand Down
2 changes: 1 addition & 1 deletion client/entity/configuration/format/js/format.library.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ app.format.callback = {};
*/
app.format.ajax.read = function () {
api.ajax.jsonrpc.request(
app.config.url.api.private,
app.config.url.api.public,
"PxStat.System.Settings.Format_API.Read",
{ LngIsoCode: null },
"app.format.callback.read"
Expand Down
68 changes: 68 additions & 0 deletions client/entity/data/index.dataset.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,74 @@

</div>


<!-- Modal - Confirm-->
<div id="data-dataview-confirm-soft" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header bg-warning">
<h5 class="modal-title text-light" label="confirm"></h5>
<button name="cancel" type="button" class="close text-light">&times;</button>
</div>
<div class="modal-body">
<p></p>
</div>
<div class="modal-footer">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-4 text-left my-2">
<button name="cancel" type="button" class="btn btn-neutral">
<i class="far fa-times-circle"></i> <span label="cancel"></span>
</button>
</div>
<div class="col-xs-12 col-sm-8 text-right my-2">
<button name="data-download-results" type="button" class="btn btn-tertiary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-download"></i> <span label="download-results"></span>
</button>
<div name="download-select-dataset" class="dropdown-menu" aria-labelledby="data-download-results"></div>
<button id="modal-button-confirm-data" type="button" class="btn btn-warning text-light">
<i class="far fa-check-circle"></i> <span label="confirm"></span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

<div id="data-dataview-confirm-hard" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-info">
<h5 class="modal-title text-light" label="information"></h5>
<button type="button" name="cancel" class="close text-light">&times;</button>
</div>
<div class="modal-body">
<p></p>
</div>
<div class="modal-footer">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-4 text-left my-2">
<button type="button" name="cancel" class="btn btn-neutral">
<i class="far fa-times-circle"></i> <span label="close"></span>
</button>
</div>
<div class="col-xs-12 col-sm-8 text-right my-2">
<button name="data-download-results" type="button" class="btn btn-tertiary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-download"></i> <span label="download-results"></span>
</button>
<div name="download-select-dataset" class="dropdown-menu" aria-labelledby="data-download-results"></div>

</div>
</div>
</div>
</div>
</div>
</div>
</div>

<!-- Template: Region 1-->
<div id="data-dataset-templates" style="display: none">
<div name="matrix-selection" class="row mx-0">
Expand Down
2 changes: 1 addition & 1 deletion client/entity/data/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="data-search-row" class="row mx-0 mt-2">
<div id="data-search-row-desktop" class="row mx-0 mt-2">
</div>
<div id="data-metadata-row" class="row mx-0 mt-0">
</div>
Expand Down
32 changes: 17 additions & 15 deletions client/entity/data/index.search.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
<div id="data-search-input" class="col-sm-12 my-2">
<div class="input-group input-group-lg">
<input type="text" name="search-input" class="form-control p-4" placeholder="" aria-label="Search for data" aria-describedby="Search for data" autocomplete="off">
<div class="input-group-append">
<button name="data-search-input-button" class="btn btn-neutral" type="button">
<i class="fas fa-search"></i> <span label="search"></span>
</button>
<div name="search-input-group-holder" class="col-sm-12 my-2"></div>

<div id="data-search-templates" style="display:none">

<div name="search-input-group">
<div class="input-group input-group-lg">
<input type="text" name="search-input" class="form-control p-4" placeholder="" aria-label="Search for data" aria-describedby="Search for data" autocomplete="off">
<div class="input-group-append">
<button name="data-search-input-button" class="btn btn-neutral" type="button">
<i class="fas fa-search"></i> <span label="search"></span>
</button>
</div>
</div>
</div>
<div class="col-sm-12 mt-4 px-0" name="no-search-results" style="display: none;">
<div class="card border-warning">
<div class="card-body font-weight-bold">
<span label="no-data-found"></span></div>
<div class="col-sm-12 mt-4 px-0" name="no-search-results" style="display: none;">
<div class="card border-warning">
<div class="card-body font-weight-bold">
<span label="no-data-found"></span></div>
</div>
</div>
</div>
</div>

<div id="data-search-templates" style="display:none">

<!-- Template: data-search-navigation-->
<div name="navigation" class="col p-2">
Expand Down
9 changes: 9 additions & 0 deletions client/entity/data/js/data.dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,13 @@ $(document).ready(function () {
$("#data-dataset-row").find("[name=back-to-select-results] button").once("click", function () {
app.data.dataset.callback.back();
});

//cannot use default modal cancel button as this causes parent modal in releases view data to close behind also
$("#data-dataview-confirm-soft").find("[name=cancel]").once("click", function () {
$("#data-dataview-confirm-soft").modal("hide");
});

$("#data-dataview-confirm-hard").find("[name=cancel]").once("click", function () {
$("#data-dataview-confirm-hard").modal("hide");
});
});
Loading

0 comments on commit 1a02b86

Please sign in to comment.