@crowdin/app-project-module 0.22.5 → 0.23.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.
package/README.md CHANGED
@@ -450,6 +450,7 @@ configuration.projectIntegration.getConfiguration = (projectId, crowdinClient, i
450
450
  key: 'option',
451
451
  label: 'Select',
452
452
  type: 'select',
453
+ defaultValue: '12',
453
454
  isSearchable: true, //allow to search for option(s), default is `false`
454
455
  isMulti: true, //allow to select multiple options, default is `false`
455
456
  options: [
@@ -794,6 +795,7 @@ Framework also supports following modules:
794
795
  - [organization-menu module](https://support.crowdin.com/enterprise/crowdin-apps-modules/#organization-menu-module)
795
796
  - [editor-right-panel module](https://support.crowdin.com/crowdin-apps-modules/#editor-panels-module)
796
797
  - [project-menu module](https://support.crowdin.com/crowdin-apps-modules/#project-menu-module)
798
+ - [project-menu-crowdsource module](https://developer.crowdin.com/crowdin-apps-module-project-menu-crowdsource/)
797
799
  - [project-tools module](https://support.crowdin.com/crowdin-apps-modules/#tools-module)
798
800
  - [project-reports module](https://support.crowdin.com/crowdin-apps-modules/#reports-module)
799
801
 
@@ -811,7 +813,7 @@ const configuration = {
811
813
  description: 'Sample App description',
812
814
  dbFolder: __dirname,
813
815
  imagePath: __dirname + '/' + 'logo.png',
814
- projectReports: { //can be editorRightPanel, projectMenu, projectTools
816
+ projectReports: { //can be editorRightPanel, projectMenu, projectTools, projectMenuCrowdsource
815
817
  imagePath: __dirname + '/' + 'reports.png',
816
818
  fileName: 'reports.html', //optional, only needed if file is not index.html
817
819
  uiPath: __dirname + '/' + 'public' // folder where UI of the module is located (js, html, css files)
@@ -77,6 +77,15 @@ function handle(config) {
77
77
  },
78
78
  ];
79
79
  }
80
+ if (config.projectMenuCrowdsource) {
81
+ modules['project-menu-crowdsource'] = [
82
+ {
83
+ key: config.identifier + '-project-menu-crowdsource',
84
+ name: config.name,
85
+ url: '/project-menu-crowdsource/' + (config.projectMenuCrowdsource.fileName || 'index.html'),
86
+ },
87
+ ];
88
+ }
80
89
  if (config.projectTools) {
81
90
  modules['project-tools'] = [
82
91
  {
package/out/index.js CHANGED
@@ -154,6 +154,9 @@ function addCrowdinEndpoints(app, config) {
154
154
  if (config.projectMenu) {
155
155
  app.use('/project-menu', (0, ui_module_1.default)(config), express_1.default.static(config.projectMenu.uiPath));
156
156
  }
157
+ if (config.projectMenuCrowdsource) {
158
+ app.use('/project-menu-crowdsource', (0, ui_module_1.default)(config), express_1.default.static(config.projectMenuCrowdsource.uiPath));
159
+ }
157
160
  if (config.projectTools) {
158
161
  app.get('/logo/tools/logo.png', (req, res) => { var _a; return res.sendFile(((_a = config.projectTools) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath || (0, path_1.join)(__dirname, 'logo.png')); });
159
162
  app.use('/tools', (0, ui_module_1.default)(config), express_1.default.static(config.projectTools.uiPath));
@@ -92,6 +92,10 @@ export interface Config extends ImagePath {
92
92
  * project menu module
93
93
  */
94
94
  projectMenu?: UiModule;
95
+ /**
96
+ * project menu crowdsource module
97
+ */
98
+ projectMenuCrowdsource?: UiModule;
95
99
  /**
96
100
  * tools module
97
101
  */
@@ -221,28 +225,7 @@ export interface IntegrationLogic {
221
225
  */
222
226
  integrationSearchListener?: boolean;
223
227
  }
224
- export declare type ConfigurationModalEntity = ConfigurationField | ConfigurationDelimeter;
225
- export interface ConfigurationField {
226
- key: string;
227
- label: string;
228
- type: 'text' | 'checkbox' | 'select';
229
- helpText?: string;
230
- /**
231
- * only for select
232
- */
233
- isMulti?: boolean;
234
- /**
235
- * only for select
236
- */
237
- isSearchable?: boolean;
238
- /**
239
- * only for select
240
- */
241
- options?: {
242
- label: string;
243
- value: string;
244
- }[];
245
- }
228
+ export declare type ConfigurationModalEntity = FormField | ConfigurationDelimeter;
246
229
  export interface ConfigurationDelimeter {
247
230
  label: string;
248
231
  }
@@ -76,48 +76,60 @@
76
76
  {{#if key}}
77
77
  {{#ifeq type "checkbox"}}
78
78
  <crowdin-checkbox
79
- use-switch
80
- label="{{label}}"
81
- value="false"
82
79
  id="{{key}}-settings"
83
80
  key="{{key}}"
81
+ label="{{label}}"
82
+ value="false"
83
+ use-switch
84
84
  {{#if helpText}}
85
85
  help-text="{{helpText}}"
86
86
  {{/if}}
87
+ {{#if helpTextHtml}}
88
+ help-text-html="{{helpTextHtml}}"
89
+ {{/if}}
90
+ {{#ifeq defaultValue true}}
91
+ checked="{{defaultValue}}"
92
+ {{/ifeq}}
87
93
  >
88
94
  </crowdin-checkbox>
89
95
  {{/ifeq}}
90
96
  {{#ifeq type "select"}}
91
97
  <crowdin-select
92
98
  {{#if isMulti}}
93
- is-multi
94
- close-on-select="false"
99
+ is-multi
100
+ close-on-select="false"
95
101
  {{/if}}
96
102
  {{#if isSearchable}}
97
- is-searchable
103
+ is-searchable
98
104
  {{/if}}
99
- id="{{key}}-settings"
100
- key="{{key}}"
101
- label="{{label}}"
105
+ id="{{key}}-settings"
106
+ key="{{key}}"
107
+ label="{{label}}"
102
108
  {{#if helpText}}
103
109
  help-text="{{helpText}}"
104
110
  {{/if}}
111
+ {{#if helpTextHtml}}
112
+ help-text-html="{{helpTextHtml}}"
113
+ {{/if}}
105
114
  >
106
115
  {{#each options}}
107
- <option value="{{value}}">{{label}}</option>
116
+ <option {{#ifeq ../defaultValue value}} selected {{/ifeq}} value="{{value}}">{{label}}</option>
108
117
  {{/each}}
109
118
  </crowdin-select>
110
119
  {{/ifeq}}
111
120
  {{#ifeq type "text"}}
112
121
  <crowdin-input
113
- with-fixed-height
114
- label="{{label}}"
115
- value=""
116
122
  id="{{key}}-settings"
123
+ label="{{label}}"
117
124
  key="{{key}}"
125
+ with-fixed-height
118
126
  {{#if helpText}}
119
127
  help-text="{{helpText}}"
120
128
  {{/if}}
129
+ {{#if helpTextHtml}}
130
+ help-text-html="{{helpTextHtml}}"
131
+ {{/if}}
132
+ value="{{#if defaultValue}}{{defaultValue}}{{/if}}"
121
133
  >
122
134
  </crowdin-input>
123
135
  {{/ifeq}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.22.5",
3
+ "version": "0.23.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",