Skip to content

Commit bc0c27a

Browse files
committed
Add github workflow
1 parent 70a255f commit bc0c27a

File tree

3 files changed

+44
-15
lines changed

3 files changed

+44
-15
lines changed

.github/workflows/zip.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Zip
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
zip:
9+
name: Build Zip
10+
runs-on: ubuntu-latest
11+
12+
env:
13+
NODE_VERSION: 24
14+
15+
steps:
16+
- name: '[setup] Checkout Project'
17+
uses: actions/checkout@v6
18+
19+
- name: '[setup] Node.js ${{ matrix.node-version }}'
20+
uses: actions/setup-node@v6
21+
with:
22+
node-version: ${{ env.NODE_VERSION }}
23+
24+
- name: '[app] Install'
25+
run: npm install
26+
27+
- name: '[app] Build'
28+
run: npm run build
29+
30+
- name: '[release] Create artifact'
31+
uses: actions/upload-artifact@v6
32+
with:
33+
name: plugin
34+
path: dist

src/components/RepliesImporterComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function RepliesImporterComponent({
2828

2929
setError(null)
3030
onImport(importer.getEvents())
31-
} catch (err) {
31+
} catch {
3232
setError(
3333
'Error reading or parsing file. Make sure you selected a valid JSON document.',
3434
)

src/importers/replies-importer.ts

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
2+
/** TODO: tighten types when time allows. */
3+
14
import { ProjectImporter } from '@ds-wizard/plugin-sdk/project-importer'
25

36
const KEY_ENTITIES = 'entities'
@@ -82,7 +85,7 @@ export default class RepliesImporter {
8285
}
8386
}
8487

85-
importQuestionValue(phase: number, path: string[], newPath: string[], question: any) {
88+
importQuestionValue(phase: number, path: string[], newPath: string[]) {
8689
if (phase === 1) {
8790
const reply = this.extractReply(path)
8891
if (reply !== undefined) {
@@ -91,7 +94,7 @@ export default class RepliesImporter {
9194
}
9295
}
9396

94-
importQuestionIntegration(phase: number, path: string[], newPath: string[], question: any) {
97+
importQuestionIntegration(phase: number, path: string[], newPath: string[]) {
9598
if (phase === 1) {
9699
const reply = this.extractReply(path)
97100
if (reply !== undefined) {
@@ -120,7 +123,7 @@ export default class RepliesImporter {
120123
})
121124
}
122125

123-
importQuestionMultiChoice(phase: number, path: string[], newPath: string[], question: any) {
126+
importQuestionMultiChoice(phase: number, path: string[], newPath: string[]) {
124127
if (phase === 1) {
125128
const reply = this.extractReply(path)
126129
if (reply !== undefined) {
@@ -129,7 +132,7 @@ export default class RepliesImporter {
129132
}
130133
}
131134

132-
importQuestionItemSelect(phase: number, path: string[], newPath: string[], question: any) {
135+
importQuestionItemSelect(phase: number, path: string[], newPath: string[]) {
133136
if (phase === 2) {
134137
const reply = this.extractReply(path)
135138
if (reply !== undefined) {
@@ -157,12 +160,7 @@ export default class RepliesImporter {
157160
)
158161
break
159162
case 'ValueQuestion':
160-
this.importQuestionValue(
161-
phase,
162-
[...path, questionUuid],
163-
[...newPath, questionUuid],
164-
question,
165-
)
163+
this.importQuestionValue(phase, [...path, questionUuid], [...newPath, questionUuid])
166164
break
167165
case 'ListQuestion':
168166
this.importQuestionList(
@@ -177,23 +175,20 @@ export default class RepliesImporter {
177175
phase,
178176
[...path, questionUuid],
179177
[...newPath, questionUuid],
180-
question,
181178
)
182179
break
183180
case 'MultiChoiceQuestion':
184181
this.importQuestionMultiChoice(
185182
phase,
186183
[...path, questionUuid],
187184
[...newPath, questionUuid],
188-
question,
189185
)
190186
break
191187
case 'ItemSelectQuestion':
192188
this.importQuestionItemSelect(
193189
phase,
194190
[...path, questionUuid],
195191
[...newPath, questionUuid],
196-
question,
197192
)
198193
break
199194
}
@@ -230,7 +225,7 @@ export default class RepliesImporter {
230225
return true
231226
}
232227
this.error = `Unsupported metamodel version: ${metamodelVersion}`
233-
} catch (e) {
228+
} catch {
234229
this.error = 'Unknown metamodel version (wrong JSON file).'
235230
}
236231
return false

0 commit comments

Comments
 (0)