@crowdin/app-project-module 0.26.5 → 0.26.6

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 CHANGED
@@ -230,6 +230,9 @@ configuration.projectIntegration.loginForm = {
230
230
  label: 'Password',
231
231
  type: 'password'
232
232
  },
233
+ {
234
+ label: 'Api creds',
235
+ },
233
236
  {
234
237
  helpText: 'Api Key for http requests',
235
238
  key: 'apiKey',
@@ -195,7 +195,7 @@ export interface IntegrationLogic {
195
195
  /**
196
196
  * function to define configuration(settings) modal for you app (by default app will not have any custom settings)
197
197
  */
198
- getConfiguration?: (projectId: number, client: Crowdin, apiCredentials: any) => Promise<ConfigurationModalEntity[]>;
198
+ getConfiguration?: (projectId: number, client: Crowdin, apiCredentials: any) => Promise<FormEntity[]>;
199
199
  /**
200
200
  * Logout hook for cleanup logic
201
201
  */
@@ -236,12 +236,12 @@ export interface IntegrationLogic {
236
236
  */
237
237
  integrationPagination?: boolean;
238
238
  }
239
- export declare type ConfigurationModalEntity = FormField | ConfigurationDelimeter;
240
- export interface ConfigurationDelimeter {
239
+ export declare type FormEntity = FormField | FormDelimeter;
240
+ export interface FormDelimeter {
241
241
  label: string;
242
242
  }
243
243
  export interface LoginForm {
244
- fields: FormField[];
244
+ fields: FormEntity[];
245
245
  }
246
246
  export interface OAuthLogin {
247
247
  /**
@@ -10,64 +10,69 @@
10
10
  <crowdin-h4 id="integration-name">{{ name }}</crowdin-h4>
11
11
  <div class="inputs">
12
12
  {{#each loginFields}}
13
- {{#ifeq type "checkbox"}}
14
- <crowdin-checkbox
15
- id="{{key}}"
16
- label="{{label}}"
17
- value="false"
18
- use-switch
19
- {{#if helpText}}
20
- help-text="{{helpText}}"
21
- {{/if}}
22
- {{#if helpTextHtml}}
23
- help-text-html="{{helpTextHtml}}"
24
- {{/if}}
25
- {{#ifeq defaultValue true}}
26
- checked="{{defaultValue}}"
27
- {{/ifeq}}
28
- >
29
- </crowdin-checkbox>
30
- {{else}}
31
- {{#ifeq type "select"}}
32
- <crowdin-select
33
- {{#if isMulti}}
34
- is-multi
35
- close-on-select="false"
36
- {{/if}}
37
- {{#if isSearchable}}
38
- is-searchable
39
- {{/if}}
13
+ {{#if key}}
14
+ {{#ifeq type "checkbox"}}
15
+ <crowdin-checkbox
40
16
  id="{{key}}"
41
17
  label="{{label}}"
18
+ value="false"
19
+ use-switch
42
20
  {{#if helpText}}
43
21
  help-text="{{helpText}}"
44
22
  {{/if}}
45
23
  {{#if helpTextHtml}}
46
24
  help-text-html="{{helpTextHtml}}"
47
25
  {{/if}}
26
+ {{#ifeq defaultValue true}}
27
+ checked="{{defaultValue}}"
28
+ {{/ifeq}}
48
29
  >
49
- {{#each options}}
50
- <option {{#ifeq ../defaultValue value}} selected {{/ifeq}} value="{{value}}">{{label}}</option>
51
- {{/each}}
52
- </crowdin-select>
30
+ </crowdin-checkbox>
53
31
  {{else}}
54
- <crowdin-input
55
- id="{{key}}"
56
- label="{{label}}"
57
- {{#if helpText}}
58
- help-text="{{helpText}}"
59
- {{/if}}
60
- {{#if helpTextHtml}}
61
- help-text-html="{{helpTextHtml}}"
62
- {{/if}}
63
- {{#if type}}
64
- type="{{type}}"
65
- {{/if}}
66
- value="{{#if defaultValue}}{{defaultValue}}{{/if}}">
67
- </crowdin-input>
32
+ {{#ifeq type "select"}}
33
+ <crowdin-select
34
+ {{#if isMulti}}
35
+ is-multi
36
+ close-on-select="false"
37
+ {{/if}}
38
+ {{#if isSearchable}}
39
+ is-searchable
40
+ {{/if}}
41
+ id="{{key}}"
42
+ label="{{label}}"
43
+ {{#if helpText}}
44
+ help-text="{{helpText}}"
45
+ {{/if}}
46
+ {{#if helpTextHtml}}
47
+ help-text-html="{{helpTextHtml}}"
48
+ {{/if}}
49
+ >
50
+ {{#each options}}
51
+ <option {{#ifeq ../defaultValue value}} selected {{/ifeq}} value="{{value}}">{{label}}</option>
52
+ {{/each}}
53
+ </crowdin-select>
54
+ {{else}}
55
+ <crowdin-input
56
+ id="{{key}}"
57
+ label="{{label}}"
58
+ {{#if helpText}}
59
+ help-text="{{helpText}}"
60
+ {{/if}}
61
+ {{#if helpTextHtml}}
62
+ help-text-html="{{helpTextHtml}}"
63
+ {{/if}}
64
+ {{#if type}}
65
+ type="{{type}}"
66
+ {{/if}}
67
+ value="{{#if defaultValue}}{{defaultValue}}{{/if}}">
68
+ </crowdin-input>
68
69
  {{/ifeq}}
69
70
  {{/ifeq}}
70
- {{/each}}
71
+ {{else}}
72
+ <crowdin-p>{{label}}</crowdin-p>
73
+ {{/if}}
74
+ <div style="padding: 8px"></div>
75
+ {{/each}}
71
76
  </div>
72
77
  <crowdin-button
73
78
  outlined icon-after="arrow_forward"
@@ -153,11 +158,13 @@
153
158
  function getLoginForm() {
154
159
  return {
155
160
  {{#each loginFields}}
156
- {{#ifeq type "checkbox"}}
157
- '{{key}}': !!document.querySelector('#{{key}}').checked,
158
- {{else}}
159
- '{{key}}': document.querySelector('#{{key}}').getAttribute('value'),
160
- {{/ifeq}}
161
+ {{#if key}}
162
+ {{#ifeq type "checkbox"}}
163
+ '{{key}}': !!document.querySelector('#{{key}}').checked,
164
+ {{else}}
165
+ '{{key}}': document.querySelector('#{{key}}').getAttribute('value'),
166
+ {{/ifeq}}
167
+ {{/if}}
161
168
  {{/each}}
162
169
  };
163
170
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.26.5",
3
+ "version": "0.26.6",
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",