@saltcorn/server 1.1.1-beta.0 → 1.1.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,6 +55,8 @@ user verification is enabled.
55
55
 
56
56
  **Startup**: run this whenever this saltcorn process initializes. 
57
57
 
58
+ **AppChange**: the application build (views, pages, triggers etc.) changed
59
+
58
60
  ## Other events
59
61
 
60
62
  **Never**: this trigger is never run on its own. However triggers that are marked as never
package/locales/en.json CHANGED
@@ -1520,7 +1520,13 @@
1520
1520
  "OK": "OK",
1521
1521
  "Step settings": "Step settings",
1522
1522
  "Action settings": "Action settings",
1523
+ "Keystore file is not applied for debug builds.": "Keystore file is not applied for debug builds.",
1523
1524
  "Workflow": "Workflow",
1524
1525
  "Previous runs": "Previous runs",
1525
- "The workflow the user will be interacting with.": "The workflow the user will be interacting with."
1526
+ "The workflow the user will be interacting with.": "The workflow the user will be interacting with.",
1527
+ "Delete old workflow runs with status after days": "Delete old workflow runs with status after days",
1528
+ "Finished": "Finished",
1529
+ "Error": "Error",
1530
+ "Waiting": "Waiting",
1531
+ "Running": "Running"
1526
1532
  }
package/locales/pl.json CHANGED
@@ -1508,5 +1508,20 @@
1508
1508
  "Workflow runs": "Przepływ pracy jest uruchomiony",
1509
1509
  "Workflow run": "Uruchomienie przepływu pracy",
1510
1510
  "Share to enabled": "Udostępnij włączone",
1511
- "Enable the share to feature": "Włącz udostępnianie funkcji"
1511
+ "Enable the share to feature": "Włącz udostępnianie funkcji",
1512
+ "Allocate new row": "Przydziel nowy wiersz",
1513
+ "If the view is run without existing row, allocate a new row on load. Defaults must be set on all required fields.": "Jeśli widok jest uruchamiany bez istniejącego wiersza, przydziel nowy wiersz podczas ładowania. Domyślne wartości muszą być ustawione na wszystkich wymaganych polach.",
1514
+ "Step traces": "Ślady kroków",
1515
+ "Please enter a version in the format 'x.y.z' (e.g. 0.0.1 with numbers from 0 to 999) or leave it empty.": "Wprowadź wersję w formacie 'x.y.z' (np. 0.0.1 z liczbami od 0 do 999) lub pozostaw puste.",
1516
+ "Delete unchanged": "Usuń bez zmian",
1517
+ "Delete allocated row if there are no changes.": "Usuń przydzielony wiersz, jeśli nie wprowadzono żadnych zmian.",
1518
+ "Triggers on table": "Wyzwalacze na tabeli",
1519
+ "Please provide the keystore alias and password for the android build.": "Podaj alias i hasło do keystore dla kompilacji Android.",
1520
+ "Submit": "Prześlij",
1521
+ "OK": "OK",
1522
+ "Step settings": "Ustawienia kroku",
1523
+ "Action settings": "Ustawienia akcji",
1524
+ "Workflow": "Przepływ pracy",
1525
+ "Previous runs": "Poprzednie uruchomienia",
1526
+ "The workflow the user will be interacting with.": "Przepływ pracy, z którym użytkownik będzie wchodził w interakcję."
1512
1527
  }
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@saltcorn/server",
3
- "version": "1.1.1-beta.0",
3
+ "version": "1.1.1-beta.2",
4
4
  "description": "Server app for Saltcorn, open-source no-code platform",
5
5
  "homepage": "https://saltcorn.com",
6
6
  "main": "index.js",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
9
  "@aws-sdk/client-s3": "^3.451.0",
10
- "@saltcorn/base-plugin": "1.1.1-beta.0",
11
- "@saltcorn/builder": "1.1.1-beta.0",
12
- "@saltcorn/data": "1.1.1-beta.0",
13
- "@saltcorn/admin-models": "1.1.1-beta.0",
14
- "@saltcorn/filemanager": "1.1.1-beta.0",
15
- "@saltcorn/markup": "1.1.1-beta.0",
16
- "@saltcorn/plugins-loader": "1.1.1-beta.0",
17
- "@saltcorn/sbadmin2": "1.1.1-beta.0",
10
+ "@saltcorn/base-plugin": "1.1.1-beta.2",
11
+ "@saltcorn/builder": "1.1.1-beta.2",
12
+ "@saltcorn/data": "1.1.1-beta.2",
13
+ "@saltcorn/admin-models": "1.1.1-beta.2",
14
+ "@saltcorn/filemanager": "1.1.1-beta.2",
15
+ "@saltcorn/markup": "1.1.1-beta.2",
16
+ "@saltcorn/plugins-loader": "1.1.1-beta.2",
17
+ "@saltcorn/sbadmin2": "1.1.1-beta.2",
18
18
  "@socket.io/cluster-adapter": "^0.2.1",
19
19
  "@socket.io/sticky": "^1.0.1",
20
20
  "adm-zip": "0.5.10",
@@ -65,7 +65,7 @@ function updateQueryStringParameters(uri1, kvs) {
65
65
  return uri;
66
66
  }
67
67
 
68
- function removeQueryStringParameter(uri1, key) {
68
+ function removeQueryStringParameter(uri1, key, value) {
69
69
  let hash = "";
70
70
  let uri = uri1;
71
71
  if (uri && uri.includes("#")) {
@@ -73,8 +73,12 @@ function removeQueryStringParameter(uri1, key) {
73
73
  hash = "#" + uris[1];
74
74
  uri = uris[0];
75
75
  }
76
-
77
- var re = new RegExp("([?&])" + key + "=.*?(&|$)", "gi");
76
+ let re;
77
+ if (value) {
78
+ re = new RegExp("([?&])" + key + "=" + value + "?(&|$)", "gi");
79
+ } else {
80
+ re = new RegExp("([?&])" + key + "=.*?(&|$)", "gi");
81
+ }
78
82
  if (uri.match(re)) {
79
83
  uri = uri.replace(re, "$1" + "$2");
80
84
  }
@@ -84,6 +88,28 @@ function removeQueryStringParameter(uri1, key) {
84
88
  return uri + hash;
85
89
  }
86
90
 
91
+ function addQueryStringParameter(uri1, key, value) {
92
+ let hash = "";
93
+ let uri = uri1;
94
+ if (uri && uri.includes("#")) {
95
+ let uris = uri1.split("#");
96
+ hash = "#" + uris[1];
97
+ uri = uris[0];
98
+ }
99
+ var re = new RegExp("([?&])" + key + "=" + value + "?(&|$)", "gi");
100
+ if (uri.match(re)) return uri1;
101
+
102
+ var separator = uri.indexOf("?") !== -1 ? "&" : "?";
103
+ if (Array.isArray(value))
104
+ return (
105
+ uri +
106
+ separator +
107
+ value.map((val) => key + "=" + encodeURIComponent(val)).join("&") +
108
+ hash
109
+ );
110
+ else return uri + separator + key + "=" + encodeURIComponent(value) + hash;
111
+ }
112
+
87
113
  function select_id(id, e) {
88
114
  pjax_to(updateQueryStringParameter(get_current_state_url(e), "id", id), e);
89
115
  }
@@ -96,10 +122,10 @@ function check_state_field(that, e) {
96
122
  const checked = that.checked;
97
123
  const name = that.name;
98
124
  const value = encodeURIComponent(that.value);
99
- var separator = get_current_state_url(e).indexOf("?") !== -1 ? "&" : "?";
100
125
  let dest;
101
- if (checked) dest = get_current_state_url(e) + `${separator}${name}=${value}`;
102
- else dest = get_current_state_url(e).replace(`${name}=${value}`, "");
126
+ if (checked)
127
+ dest = addQueryStringParameter(get_current_state_url(e), name, value);
128
+ else dest = removeQueryStringParameter(get_current_state_url(e), name, value);
103
129
  pjax_to(dest.replace("&&", "&").replace("?&", "?"), e);
104
130
  }
105
131
 
@@ -591,7 +617,7 @@ function updateViewPreview() {
591
617
  function ajaxSubmitForm(e, force_no_reload, event) {
592
618
  var form = $(e).closest("form");
593
619
  var url = form.attr("action");
594
- if(event) event.preventDefault();
620
+ if (event) event.preventDefault();
595
621
  $.ajax(url, {
596
622
  type: "POST",
597
623
  headers: {
@@ -606,10 +632,10 @@ function ajaxSubmitForm(e, force_no_reload, event) {
606
632
  "data-on-close-reload-view"
607
633
  );
608
634
  $("#scmodal").modal("hide");
609
- if (!force_no_reload && on_close_reload_view) {
635
+ if (on_close_reload_view) {
610
636
  const viewE = $(`[data-sc-embed-viewname="${on_close_reload_view}"]`);
611
637
  if (viewE.length) reload_embedded_view(on_close_reload_view);
612
- else location.reload();
638
+ else if (!force_no_reload) location.reload();
613
639
  } else if (!force_no_reload && !no_reload) location.reload();
614
640
  else common_done(res, form.attr("data-viewname"));
615
641
  },
@@ -859,10 +885,16 @@ function builderMenuChanged(e) {
859
885
  });
860
886
  }
861
887
 
862
- function poll_mobile_build_finished(outDirName, pollCount, orginalBtnHtml) {
888
+ function poll_mobile_build_finished(
889
+ outDirName,
890
+ buildDir,
891
+ mode,
892
+ pollCount,
893
+ orginalBtnHtml
894
+ ) {
863
895
  $.ajax("/admin/build-mobile-app/finished", {
864
896
  type: "GET",
865
- data: { build_dir: outDirName },
897
+ data: { out_dir_name: outDirName, mode: mode },
866
898
  success: function (res) {
867
899
  if (!res.finished) {
868
900
  if (pollCount >= 100) {
@@ -873,14 +905,45 @@ function poll_mobile_build_finished(outDirName, pollCount, orginalBtnHtml) {
873
905
  });
874
906
  } else {
875
907
  setTimeout(() => {
876
- poll_mobile_build_finished(outDirName, ++pollCount, orginalBtnHtml);
908
+ poll_mobile_build_finished(
909
+ outDirName,
910
+ buildDir,
911
+ mode,
912
+ ++pollCount,
913
+ orginalBtnHtml
914
+ );
877
915
  }, 5000);
878
916
  }
879
917
  } else {
880
918
  href_to(
881
- `build-mobile-app/result?build_dir_name=${encodeURIComponent(
919
+ `/admin/build-mobile-app/result?out_dir_name=${encodeURIComponent(
882
920
  outDirName
883
- )}`
921
+ )}&build_dir=${encodeURIComponent(buildDir)}&mode=${mode}`
922
+ );
923
+ }
924
+ },
925
+ });
926
+ }
927
+
928
+ function finish_mobile_app(button, outDirName, buildDir) {
929
+ $.ajax("/admin/build-mobile-app/finish", {
930
+ type: "POST",
931
+ headers: {
932
+ "CSRF-Token": _sc_globalCsrf,
933
+ },
934
+ data: { out_dir_name: outDirName, build_dir: buildDir },
935
+ success: function (data) {
936
+ if (data.success) {
937
+ notifyAlert("Finishing the app, please wait.", true);
938
+ for (const msg of data.msgs || []) notifyAlert(msg);
939
+ const orginalBtnHtml = $("#finishMobileAppBtnId").html();
940
+ press_store_button(button);
941
+ poll_mobile_build_finished(
942
+ outDirName,
943
+ buildDir,
944
+ "finish",
945
+ 0,
946
+ orginalBtnHtml
884
947
  );
885
948
  }
886
949
  },
@@ -938,11 +1001,18 @@ function build_mobile_app(button) {
938
1001
  ajax_post("/admin/build-mobile-app", {
939
1002
  data: params,
940
1003
  success: (data) => {
941
- if (data.build_dir_name) {
942
- handleMessages();
1004
+ if (data.out_dir_name && data.build_dir) {
1005
+ notifyAlert("Building the app, please wait.", true);
1006
+ for (const msg of data.msgs || []) notifyAlert(msg);
943
1007
  const orginalBtnHtml = $("#buildMobileAppBtnId").html();
944
1008
  press_store_button(button);
945
- poll_mobile_build_finished(data.build_dir_name, 0, orginalBtnHtml);
1009
+ poll_mobile_build_finished(
1010
+ data.out_dir_name,
1011
+ data.build_dir,
1012
+ data.mode,
1013
+ 0,
1014
+ orginalBtnHtml
1015
+ );
946
1016
  }
947
1017
  },
948
1018
  });