@crowdin/app-project-module 0.10.0 → 0.10.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/README.md +1 -1
- package/out/handlers/integration-login.js +4 -0
- package/out/models/index.d.ts +1 -1
- package/out/views/login.handlebars +35 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -571,7 +571,7 @@ const configuration = {
|
|
|
571
571
|
description: 'Sample App description',
|
|
572
572
|
dbFolder: __dirname,
|
|
573
573
|
imagePath: __dirname + '/' + 'logo.png',
|
|
574
|
-
reports: {
|
|
574
|
+
reports: { //can be editorPanels, projectMenu, tools
|
|
575
575
|
fileName: 'reports.html', //optional, only needed if file is not index.html
|
|
576
576
|
uiPath: __dirname + '/' + 'public' // folder where UI of the module is located (js, html, css files)
|
|
577
577
|
},
|
|
@@ -16,6 +16,10 @@ function handle(config, integration) {
|
|
|
16
16
|
if (integration.checkConnection) {
|
|
17
17
|
yield integration.checkConnection(req.body.credentials);
|
|
18
18
|
}
|
|
19
|
+
const existing = yield (0, storage_1.getIntegrationCredentials)(req.crowdinContext.clientId);
|
|
20
|
+
if (!!existing) {
|
|
21
|
+
yield (0, storage_1.deleteIntegrationCredentials)(req.crowdinContext.clientId);
|
|
22
|
+
}
|
|
19
23
|
yield (0, storage_1.saveIntegrationCredentials)(req.crowdinContext.clientId, (0, util_1.encryptData)(config.clientSecret, JSON.stringify(req.body.credentials)), req.crowdinContext.crowdinId);
|
|
20
24
|
res.status(204).end();
|
|
21
25
|
}));
|
package/out/models/index.d.ts
CHANGED
|
@@ -250,7 +250,7 @@ export interface FormField {
|
|
|
250
250
|
helpText?: string;
|
|
251
251
|
helpTextHtml?: string;
|
|
252
252
|
label: string;
|
|
253
|
-
type?: 'text' | 'password';
|
|
253
|
+
type?: 'text' | 'password' | 'checkbox';
|
|
254
254
|
}
|
|
255
255
|
export declare type TreeItem = File | Folder;
|
|
256
256
|
export interface File {
|
|
@@ -12,20 +12,36 @@
|
|
|
12
12
|
{{else}}
|
|
13
13
|
<div class="inputs">
|
|
14
14
|
{{#each loginFields}}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
+
>
|
|
28
|
+
</crowdin-checkbox>
|
|
29
|
+
{{else}}
|
|
30
|
+
<crowdin-input
|
|
31
|
+
id="{{key}}"
|
|
32
|
+
label="{{label}}"
|
|
33
|
+
{{#if helpText}}
|
|
34
|
+
help-text="{{helpText}}"
|
|
35
|
+
{{/if}}
|
|
36
|
+
{{#if helpTextHtml}}
|
|
37
|
+
help-text-html="{{helpTextHtml}}"
|
|
38
|
+
{{/if}}
|
|
39
|
+
{{#if type}}
|
|
40
|
+
type="{{type}}"
|
|
41
|
+
{{/if}}
|
|
42
|
+
value="">
|
|
43
|
+
</crowdin-input>
|
|
44
|
+
{{/ifeq}}
|
|
29
45
|
{{/each}}
|
|
30
46
|
</div>
|
|
31
47
|
{{/if}}
|
|
@@ -63,7 +79,11 @@
|
|
|
63
79
|
function integrationLogin(oauthCredentials) {
|
|
64
80
|
const credentials = oauthCredentials || {
|
|
65
81
|
{{#each loginFields}}
|
|
66
|
-
|
|
82
|
+
{{#ifeq type "checkbox"}}
|
|
83
|
+
'{{key}}': !!document.querySelector('#{{key}}').checked,
|
|
84
|
+
{{else}}
|
|
85
|
+
'{{key}}': document.querySelector('#{{key}}').getAttribute('value'),
|
|
86
|
+
{{/ifeq}}
|
|
67
87
|
{{/each}}
|
|
68
88
|
};
|
|
69
89
|
checkOrigin()
|
package/package.json
CHANGED