@crowdin/app-project-module 0.53.0 → 0.53.1
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.
- package/out/modules/integration/handlers/integration-data.js +1 -0
- package/out/modules/integration/types.d.ts +9 -1
- package/out/modules/integration/util/cron.js +2 -2
- package/out/util/handlebars.js +1 -1
- package/out/views/login.handlebars +118 -72
- package/out/views/main.handlebars +18 -0
- package/package.json +1 -1
|
@@ -38,6 +38,7 @@ function handle(integration) {
|
|
|
38
38
|
crowdinId: req.crowdinContext.crowdinId,
|
|
39
39
|
clientId: req.crowdinContext.clientId,
|
|
40
40
|
});
|
|
41
|
+
res.send({ data: [], message: (e === null || e === void 0 ? void 0 : e.message) || e });
|
|
41
42
|
throw e;
|
|
42
43
|
}
|
|
43
44
|
req.logInfo(`Integration data response ${JSON.stringify(files, null, 2)}`);
|
|
@@ -287,7 +287,7 @@ export interface FormField {
|
|
|
287
287
|
helpText?: string;
|
|
288
288
|
helpTextHtml?: string;
|
|
289
289
|
label: string;
|
|
290
|
-
type?: 'text' | 'password' | 'checkbox' | 'select' | 'textarea' | 'file';
|
|
290
|
+
type?: 'text' | 'password' | 'checkbox' | 'select' | 'textarea' | 'file' | 'notice';
|
|
291
291
|
defaultValue?: any;
|
|
292
292
|
/**
|
|
293
293
|
* only for select
|
|
@@ -312,6 +312,14 @@ export interface FormField {
|
|
|
312
312
|
* field dependency settings
|
|
313
313
|
*/
|
|
314
314
|
dependencySettings?: string;
|
|
315
|
+
/**
|
|
316
|
+
* only for notice type
|
|
317
|
+
*/
|
|
318
|
+
noticeType?: string;
|
|
319
|
+
/**
|
|
320
|
+
* only for notice type
|
|
321
|
+
*/
|
|
322
|
+
noIcon?: boolean;
|
|
315
323
|
}
|
|
316
324
|
type NoticeType = 'info' | 'warning' | 'danger' | 'success' | 'error' | 'dataLostWarning';
|
|
317
325
|
export interface IntegrationCredentials {
|
|
@@ -215,7 +215,7 @@ function filesCron({ config, integration, period, }) {
|
|
|
215
215
|
}
|
|
216
216
|
catch (e) {
|
|
217
217
|
(0, logger_1.logError)(e, context);
|
|
218
|
-
|
|
218
|
+
continue;
|
|
219
219
|
}
|
|
220
220
|
if (Object.keys(newFiles).length) {
|
|
221
221
|
yield (0, storage_1.getStorage)().updateSyncSettings(JSON.stringify(Object.assign(Object.assign({}, files), newFiles)), syncSettings.integrationId, syncSettings.crowdinId, 'schedule', syncSettings.provider);
|
|
@@ -256,7 +256,7 @@ function filesCron({ config, integration, period, }) {
|
|
|
256
256
|
}
|
|
257
257
|
catch (e) {
|
|
258
258
|
(0, logger_1.logError)(e, context);
|
|
259
|
-
|
|
259
|
+
continue;
|
|
260
260
|
}
|
|
261
261
|
if (Object.keys(newFiles).length) {
|
|
262
262
|
const newSyncSettingsFields = allIntFiles.map((file) => (Object.assign(Object.assign({}, file), { schedule: true, sync: false })));
|
package/out/util/handlebars.js
CHANGED
|
@@ -22,7 +22,7 @@ exports.engine = (0, express_handlebars_1.default)({
|
|
|
22
22
|
return options.inverse(this);
|
|
23
23
|
},
|
|
24
24
|
in: function (a, b, options) {
|
|
25
|
-
if (a.toString().includes(b.toString())) {
|
|
25
|
+
if (a !== undefined && a !== null && b !== undefined && b !== null && a.toString().includes(b.toString())) {
|
|
26
26
|
return options.fn(this);
|
|
27
27
|
}
|
|
28
28
|
return options.inverse(this);
|
|
@@ -11,24 +11,28 @@
|
|
|
11
11
|
<div class="inputs">
|
|
12
12
|
{{#each loginFields}}
|
|
13
13
|
{{#if key}}
|
|
14
|
-
{{#
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
14
|
+
{{#in "checkbox select textarea file notice" type}}
|
|
15
|
+
{{#ifeq type "checkbox"}}
|
|
16
|
+
<crowdin-checkbox
|
|
17
|
+
id="{{key}}"
|
|
18
|
+
label="{{label}}"
|
|
19
|
+
value="false"
|
|
20
|
+
use-switch
|
|
21
|
+
{{#if helpText}}
|
|
22
|
+
help-text="{{helpText}}"
|
|
23
|
+
{{/if}}
|
|
24
|
+
{{#if helpTextHtml}}
|
|
25
|
+
help-text-html="{{helpTextHtml}}"
|
|
26
|
+
{{/if}}
|
|
27
|
+
{{#ifeq defaultValue true}}
|
|
28
|
+
checked="{{defaultValue}}"
|
|
29
|
+
{{/ifeq}}
|
|
30
|
+
{{#if dependencySettings}}
|
|
31
|
+
data-dependency="{{dependencySettings}}"
|
|
32
|
+
{{/if}}
|
|
33
|
+
>
|
|
34
|
+
</crowdin-checkbox>
|
|
35
|
+
{{/ifeq}}
|
|
32
36
|
{{#ifeq type "select"}}
|
|
33
37
|
<crowdin-select
|
|
34
38
|
{{#if isMulti}}
|
|
@@ -46,72 +50,114 @@
|
|
|
46
50
|
{{#if helpTextHtml}}
|
|
47
51
|
help-text-html="{{helpTextHtml}}"
|
|
48
52
|
{{/if}}
|
|
53
|
+
{{#if dependencySettings}}
|
|
54
|
+
data-dependency="{{dependencySettings}}"
|
|
55
|
+
{{/if}}
|
|
49
56
|
>
|
|
50
57
|
{{#each options}}
|
|
51
58
|
<option {{#ifeq ../defaultValue value}} selected {{/ifeq}} value="{{value}}">{{label}}</option>
|
|
52
59
|
{{/each}}
|
|
53
60
|
</crowdin-select>
|
|
54
|
-
{{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
{{#
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
{{
|
|
98
|
-
{{
|
|
99
|
-
|
|
61
|
+
{{/ifeq}}
|
|
62
|
+
{{#ifeq type "textarea"}}
|
|
63
|
+
<crowdin-textarea
|
|
64
|
+
id="{{key}}"
|
|
65
|
+
label="{{label}}"
|
|
66
|
+
{{#if helpText}}
|
|
67
|
+
help-text="{{helpText}}"
|
|
68
|
+
{{/if}}
|
|
69
|
+
{{#if helpTextHtml}}
|
|
70
|
+
help-text-html="{{helpTextHtml}}"
|
|
71
|
+
{{/if}}
|
|
72
|
+
{{#if dependencySettings}}
|
|
73
|
+
data-dependency="{{dependencySettings}}"
|
|
74
|
+
{{/if}}
|
|
75
|
+
value="{{#if defaultValue}}{{defaultValue}}{{/if}}">
|
|
76
|
+
</crowdin-textarea>
|
|
77
|
+
{{/ifeq}}
|
|
78
|
+
{{#ifeq type "notice"}}
|
|
79
|
+
<crowdin-alert
|
|
80
|
+
{{#if noticeType}}
|
|
81
|
+
type="{{noticeType}}"
|
|
82
|
+
{{/if}}
|
|
83
|
+
{{#if label}}
|
|
84
|
+
title="{{label}}"
|
|
85
|
+
{{/if}}
|
|
86
|
+
{{#if noIcon}}
|
|
87
|
+
no-icon="{{noIcon}}"
|
|
88
|
+
{{/if}}
|
|
89
|
+
{{#if dependencySettings}}
|
|
90
|
+
data-dependency="{{dependencySettings}}"
|
|
91
|
+
{{/if}}
|
|
92
|
+
>
|
|
93
|
+
{{{helpText}}}
|
|
94
|
+
</crowdin-alert>
|
|
95
|
+
{{/ifeq}}
|
|
96
|
+
{{#ifeq type "file"}}
|
|
97
|
+
<div class="file-field">
|
|
98
|
+
{{#if helpText}}<div class="help-text">{{helpText}}</div>{{/if}}
|
|
99
|
+
{{#if helpTextHtml}}<div class="help-text">{{helpTextHtml}}</div>{{/if}}
|
|
100
|
+
<div class="upload">
|
|
101
|
+
<crowdin-button outlined onclick="uploadFiles('{{key}}');">{{label}}</crowdin-button>
|
|
102
|
+
<textarea hidden id="{{key}}"></textarea>
|
|
103
|
+
<input
|
|
104
|
+
id="store_{{key}}"
|
|
105
|
+
data-id="{{key}}"
|
|
106
|
+
{{#if accept}}
|
|
107
|
+
accept="{{accept}}"
|
|
100
108
|
{{/if}}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
109
|
+
onchange="readFileData(event)"
|
|
110
|
+
hidden
|
|
111
|
+
type="{{type}}"
|
|
112
|
+
>
|
|
113
|
+
<div class="uploaded-file"><i>No file</i></div>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
105
116
|
{{/ifeq}}
|
|
106
|
-
{{
|
|
117
|
+
{{else}}
|
|
118
|
+
<crowdin-input
|
|
119
|
+
id="{{key}}"
|
|
120
|
+
label="{{label}}"
|
|
121
|
+
{{#if helpText}}
|
|
122
|
+
help-text="{{helpText}}"
|
|
123
|
+
{{/if}}
|
|
124
|
+
{{#if helpTextHtml}}
|
|
125
|
+
help-text-html="{{helpTextHtml}}"
|
|
126
|
+
{{/if}}
|
|
127
|
+
{{#if type}}
|
|
128
|
+
type="{{type}}"
|
|
129
|
+
{{/if}}
|
|
130
|
+
{{#if dependencySettings}}
|
|
131
|
+
data-dependency="{{dependencySettings}}"
|
|
132
|
+
{{/if}}
|
|
133
|
+
value="{{#if defaultValue}}{{defaultValue}}{{/if}}">
|
|
134
|
+
</crowdin-input>
|
|
135
|
+
{{/in}}
|
|
107
136
|
{{else}}
|
|
108
137
|
{{#if labelHtml}}
|
|
109
|
-
<crowdin-p
|
|
138
|
+
<crowdin-p
|
|
139
|
+
{{#if dependencySettings}}
|
|
140
|
+
data-dependency="{{dependencySettings}}"
|
|
141
|
+
{{/if}}
|
|
142
|
+
>
|
|
143
|
+
{{{labelHtml}}}
|
|
144
|
+
</crowdin-p>
|
|
110
145
|
{{else}}
|
|
111
|
-
<crowdin-p
|
|
146
|
+
<crowdin-p
|
|
147
|
+
{{#if dependencySettings}}
|
|
148
|
+
data-dependency="{{dependencySettings}}"
|
|
149
|
+
{{/if}}
|
|
150
|
+
>
|
|
151
|
+
{{label}}
|
|
152
|
+
</crowdin-p>
|
|
112
153
|
{{/if}}
|
|
113
154
|
{{/if}}
|
|
114
|
-
<div
|
|
155
|
+
<div
|
|
156
|
+
style="padding: 8px"
|
|
157
|
+
{{#if dependencySettings}}
|
|
158
|
+
data-dependency="{{dependencySettings}}"
|
|
159
|
+
{{/if}}
|
|
160
|
+
></div>
|
|
115
161
|
{{/each}}
|
|
116
162
|
</div>
|
|
117
163
|
<crowdin-button
|
|
@@ -227,6 +227,24 @@
|
|
|
227
227
|
value="{{#if defaultValue}}{{defaultValue}}{{/if}}">
|
|
228
228
|
</crowdin-textarea>
|
|
229
229
|
{{/ifeq}}
|
|
230
|
+
{{#ifeq type "notice"}}
|
|
231
|
+
<crowdin-alert
|
|
232
|
+
{{#if noticeType}}
|
|
233
|
+
type="{{noticeType}}"
|
|
234
|
+
{{/if}}
|
|
235
|
+
{{#if label}}
|
|
236
|
+
title="{{label}}"
|
|
237
|
+
{{/if}}
|
|
238
|
+
{{#if noIcon}}
|
|
239
|
+
no-icon="{{noIcon}}"
|
|
240
|
+
{{/if}}
|
|
241
|
+
{{#if dependencySettings}}
|
|
242
|
+
data-dependency="{{dependencySettings}}"
|
|
243
|
+
{{/if}}
|
|
244
|
+
>
|
|
245
|
+
{{{helpText}}}
|
|
246
|
+
</crowdin-alert>
|
|
247
|
+
{{/ifeq}}
|
|
230
248
|
{{else}}
|
|
231
249
|
{{#if labelHtml}}
|
|
232
250
|
<crowdin-p
|
package/package.json
CHANGED