@crowdin/app-project-module 0.63.2 → 0.65.0

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.
@@ -5,12 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const express_1 = __importDefault(require("express"));
7
7
  const terminus_1 = require("@godaddy/terminus");
8
+ const job_1 = require("../modules/integration/util/job");
8
9
  express_1.default.application.baseListen = express_1.default.application.listen;
9
10
  express_1.default.application.listen = function (...args) {
10
- const [port, callback] = args;
11
- const server = this.baseListen.call(this, port);
11
+ const [config, callback] = args;
12
+ const server = this.baseListen.call(this, config.port);
12
13
  if (callback) {
13
14
  callback();
15
+ (0, job_1.reRunInProgressJobs)(config);
14
16
  }
15
17
  (0, terminus_1.createTerminus)(server, {
16
18
  timeout: Infinity,
@@ -418,7 +418,11 @@
418
418
  .then(checkResponse)
419
419
  .then((res) => {
420
420
  project = res;
421
- const languagesSorted = project.targetLanguages.sort((a, b) => a.name.localeCompare(b.name));
421
+ const languagesSorted = project.targetLanguages.map(language => ({
422
+ sourceLanguageId: res.sourceLanguage.editorCode,
423
+ projectEditorLink: res.projectEditorLink,
424
+ ...language,
425
+ })).sort((a, b) => a.name.localeCompare(b.name));
422
426
 
423
427
  if (project.inContext && config?.inContext) {
424
428
  languagesSorted.push({...project.inContextPseudoLanguage, inContext: true});
@@ -1143,6 +1147,10 @@
1143
1147
  modal.innerHTML = getUserErrorDetail(item);
1144
1148
  };
1145
1149
 
1150
+ const formatDate = (field, index, item) => {
1151
+ return item.formattedDate;
1152
+ }
1153
+
1146
1154
  table.setTableConfig && table.setTableConfig({
1147
1155
  defaultSortingColumn: "createdAt",
1148
1156
  defaultSortingDir: "desc",
@@ -1152,6 +1160,7 @@
1152
1160
  name: "Date",
1153
1161
  isSortable: true,
1154
1162
  clickFn: clickRow,
1163
+ formatFn: formatDate,
1155
1164
  },
1156
1165
  {
1157
1166
  field: "action",
@@ -1199,7 +1208,7 @@
1199
1208
  } else {
1200
1209
  html += `<tr><td>Message</td><td>${sanitizeHTML(error.message)}</td></tr>`;
1201
1210
  }
1202
- html += `<tr><td>Date/time</td><td>${sanitizeHTML(error.createdAt)}</td></tr>`;
1211
+ html += `<tr><td>Date/time</td><td>${sanitizeHTML(error.formattedDate)}</td></tr>`;
1203
1212
 
1204
1213
  if (data.requestParams) {
1205
1214
  html += `<tr><td>Method</td><td>${sanitizeHTML(data.requestParams.method)}</td></tr>`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.63.2",
3
+ "version": "0.65.0",
4
4
  "description": "Module that generates for you all common endpoints for serving standalone Crowdin App",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",