Skip to content

Commit 71a6e1d

Browse files
authored
Merge pull request #185 from entrylabs/develop
2.1.6 버전업
2 parents 2022ae1 + babf48c commit 71a6e1d

File tree

8 files changed

+186
-101
lines changed

8 files changed

+186
-101
lines changed

build/entryx64.nsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
!define MUI_UNICON "icon.ico"
1414
!define PRODUCT_NAME "Entry"
1515
!define APP_NAME "Entry.exe"
16-
!define PRODUCT_VERSION "2.1.5"
16+
!define PRODUCT_VERSION "2.1.6"
1717
!define PRODUCT_PUBLISHER "EntryLabs"
1818
!define PRODUCT_WEB_SITE "http://www.playentry.org/"
1919

build/entryx86.nsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
!define MUI_UNICON "icon.ico"
1414
!define PRODUCT_NAME "Entry"
1515
!define APP_NAME "Entry.exe"
16-
!define PRODUCT_VERSION "2.1.5"
16+
!define PRODUCT_VERSION "2.1.6"
1717
!define PRODUCT_PUBLISHER "EntryLabs"
1818
!define PRODUCT_WEB_SITE "http://www.playentry.org/"
1919

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"private": true,
33
"productName": "Entry",
44
"name": "entry",
5-
"version": "2.1.5",
5+
"version": "2.1.6",
66
"description": "Entry for offline",
77
"main": "src/main_build/main.bundle.js",
88
"scripts": {
@@ -36,8 +36,8 @@
3636
"async-csv": "^2.1.3",
3737
"axios": "^0.19.2",
3838
"cross-spawn": "^7.0.3",
39-
"entry-hw": "git+https://github.com/entrylabs/entry-hw.git#dist/v1.9.42",
40-
"entry-js": "git+https://github.com/entrylabs/entryjs.git#dist/offline_v2.1.5",
39+
"entry-hw": "git+https://github.com/entrylabs/entry-hw.git#dist/v1.9.44",
40+
"entry-js": "git+https://github.com/entrylabs/entryjs.git#dist/offline_v2.1.6",
4141
"entry-tool": "git+https://github.com/entrylabs/entry-tool.git#dist/20221024",
4242
"excel4node": "^1.7.0",
4343
"fs-extra": "^8.1.0",

src/renderer/helper/entry/entryModalHelper.ts

Lines changed: 65 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class EntryModalHelper {
6767
objectType: 'sprite',
6868
sprite: {
6969
name: `${RendererUtils.getLang(
70-
'Workspace.new_object'
70+
'Workspace.new_object',
7171
)}${Entry.container.getAllObjects().length + 1}`,
7272
pictures: [
7373
{
@@ -116,55 +116,14 @@ class EntryModalHelper {
116116
Entry.container.addObject(object, 0);
117117
},
118118
dummyUploads: async ({ formData, objectData }: { formData: any; objectData: any }) => {
119-
const pictures = formData ? formData.values() : [];
120-
const objects = objectData ? objectData.values() : [];
121-
122-
const uploadPicturesPaths = [];
123-
const uploadObjectPaths = [];
124-
// picture files
125-
for (const value of pictures) {
126-
if (value.path) {
127-
uploadPicturesPaths.push(value.path);
128-
}
129-
}
130-
131-
// eo files
132-
for (const value of objects) {
133-
if (value.path) {
134-
uploadObjectPaths.push(value.path);
135-
}
136-
}
137-
138-
const results = await IpcRendererHelper.importPictures(uploadPicturesPaths);
139-
const objectResults = await IpcRendererHelper.importObjects(uploadObjectPaths);
140-
141-
EntryModalHelper.popup.setData({
142-
data: {
143-
data: [],
144-
uploads: results.concat(
145-
objectResults.map((objectModel: any) => {
146-
// thumbnail 용으로 쓸 selectedPicture 표기. 본 데이터는 sprite
147-
const [firstObject] = objectModel.objects;
148-
149-
let selected = firstObject.selectedPicture;
150-
if (firstObject.objectType === 'textBox') {
151-
// selected = firstObject;
152-
selected = {
153-
sprite: objectModel,
154-
name: firstObject.name,
155-
text: firstObject.text,
156-
objectType: firstObject.objectType,
157-
options: firstObject.entity || {},
158-
_id: Entry.generateHash(),
159-
fileurl:
160-
'../../renderer/resources/images/workspace/text_icon_ko.svg',
161-
};
162-
}
163-
164-
return selected;
165-
})
166-
),
167-
},
119+
const result = [
120+
await this.uploadItem('picture', formData),
121+
await this.uploadItem('object', objectData),
122+
];
123+
124+
result.forEach((uploads) => {
125+
const _uploads = uploads || [];
126+
EntryModalHelper.popup.setData({ data: { uploads: _uploads, data:[] } });
168127
});
169128
},
170129
uploads: (data: any) => {
@@ -179,7 +138,7 @@ class EntryModalHelper {
179138
},
180139
uploadFail: (data: any) => {
181140
EntryModalHelper.getAlertModal(
182-
RendererUtils.getLang(`${data.messageParent}.${data.message}`)
141+
RendererUtils.getLang(`${data.messageParent}.${data.message}`),
183142
);
184143
},
185144
fail: () => {
@@ -191,6 +150,45 @@ class EntryModalHelper {
191150
});
192151
}
193152

153+
static async uploadItem (kind: any, formData: any) {
154+
if (!kind || !formData) {
155+
return null;
156+
}
157+
const datas = formData ? formData.values() : [];
158+
const uploadPaths = [];
159+
160+
for (const value of datas) {
161+
if (value.path) {
162+
uploadPaths.push(value.path);
163+
}
164+
}
165+
166+
if (kind === 'object') {
167+
const results = await IpcRendererHelper.importObjects(uploadPaths);
168+
169+
return (
170+
results.flatMap((item: any) => item.objects.map((object: any) => {
171+
object.id = Entry.generateHash();
172+
if (object.objectType === 'textBox') {
173+
object.selectedPicture = {
174+
name: object.name,
175+
text: object.text,
176+
objectType: object.objectType,
177+
options: object.entity || {},
178+
_id: Entry.generateHash(),
179+
fileurl: '../../renderer/resources/images/workspace/text_icon_ko.svg',
180+
};
181+
}
182+
object.selectedPicture.sprite = item;
183+
return object.selectedPicture;
184+
})) || []
185+
);
186+
} else if (kind === 'picture') {
187+
const results = await IpcRendererHelper.importPictures(uploadPaths);
188+
return results;
189+
}
190+
}
191+
194192
/**
195193
* 모양 추가 팝업을 노출한다.
196194
* fetch 시 Object 와 동일하나, Object 내의 Pictures 를 전부 까서 보여주는 차이가 있다.
@@ -292,7 +290,7 @@ class EntryModalHelper {
292290
},
293291
uploadFail: (data: any) => {
294292
EntryModalHelper.getAlertModal(
295-
RendererUtils.getLang(`${data.messageParent}.${data.message}`)
293+
RendererUtils.getLang(`${data.messageParent}.${data.message}`),
296294
);
297295
},
298296
fail: () => {
@@ -389,7 +387,7 @@ class EntryModalHelper {
389387
},
390388
uploadFail: (data: any) => {
391389
EntryModalHelper.getAlertModal(
392-
RendererUtils.getLang(`${data.messageParent}.${data.message}`)
390+
RendererUtils.getLang(`${data.messageParent}.${data.message}`),
393391
);
394392
},
395393
fail: (data: any) => {
@@ -416,7 +414,7 @@ class EntryModalHelper {
416414
}
417415

418416
const langFilteredData = allFetchedData.filter(
419-
(element) => element.lang === langType
417+
(element) => element.lang === langType,
420418
);
421419

422420
EntryModalHelper.popup.setData({
@@ -437,10 +435,10 @@ class EntryModalHelper {
437435
const max = _.max([fields.length, ..._.map(origin, (row) => row.length)]);
438436
fields = _.concat(fields, new Array(max - fields.length).fill(''));
439437
origin = _.map(origin, (row) =>
440-
_.concat(row, new Array(max - row.length).fill(''))
438+
_.concat(row, new Array(max - row.length).fill('')),
441439
);
442440
return { ...tableInfo, ...infos, fields, data: origin };
443-
})
441+
}),
444442
);
445443
tableInfos.map((item) => {
446444
Entry.playground.dataTable.addSource(item);
@@ -525,15 +523,15 @@ class EntryModalHelper {
525523
callback && callback();
526524
} else {
527525
EntryModalHelper.getAlertModal(
528-
RendererUtils.getLang('Workspace.deselect_expansion_block_warning')
526+
RendererUtils.getLang('Workspace.deselect_expansion_block_warning'),
529527
);
530528
}
531529
},
532530
itemon: ({ callback }: { callback?: () => void }) => {
533531
callback && callback();
534532
},
535533
},
536-
expansionBlocks as any
534+
expansionBlocks as any,
537535
);
538536
}
539537

@@ -552,7 +550,7 @@ class EntryModalHelper {
552550
callback && callback();
553551
} else {
554552
EntryModalHelper.getAlertModal(
555-
RendererUtils.getLang('Workspace.deselect_ai_utilize_block_warning')
553+
RendererUtils.getLang('Workspace.deselect_ai_utilize_block_warning'),
556554
);
557555
}
558556
},
@@ -561,7 +559,7 @@ class EntryModalHelper {
561559
},
562560
},
563561
aiBlocks as any,
564-
'../../../node_modules/entry-js/images/aiUtilize/'
562+
'../../../node_modules/entry-js/images/aiUtilize/',
565563
);
566564
}
567565

@@ -599,7 +597,7 @@ class EntryModalHelper {
599597

600598
static async _addAIUtilizeBlocks(blocks: any) {
601599
const addBlocks = blocks.filter(
602-
({ name }: { name: string }) => !Entry.aiUtilizeBlocks.includes(name)
600+
({ name }: { name: string }) => !Entry.aiUtilizeBlocks.includes(name),
603601
);
604602
const removeBlocks = this._getActiveAIUtilizeBlocks()
605603
.filter((item) => item.active)
@@ -618,7 +616,7 @@ class EntryModalHelper {
618616

619617
static _addExpansionBlocks(blocks: any) {
620618
const addBlocks = blocks.filter(
621-
({ name }: { name: string }) => !Entry.expansionBlocks.includes(name)
619+
({ name }: { name: string }) => !Entry.expansionBlocks.includes(name),
622620
);
623621
const removeBlocks = this._getActiveExpansionBlocks()
624622
.filter((item) => item.active)
@@ -691,7 +689,7 @@ class EntryModalHelper {
691689
},
692690
uploadFail: (data: any) => {
693691
EntryModalHelper.getAlertModal(
694-
RendererUtils.getLang(`${data.messageParent}.${data.message}`)
692+
RendererUtils.getLang(`${data.messageParent}.${data.message}`),
695693
);
696694
},
697695
fail: () => {
@@ -710,7 +708,7 @@ class EntryModalHelper {
710708
type: string,
711709
events: PopupEventListeners = {},
712710
data: any = [],
713-
imageBaseUrl: string = '../../../node_modules/entry-js/images/hardware/'
711+
imageBaseUrl: string = '../../../node_modules/entry-js/images/hardware/',
714712
) {
715713
this.loadPopup(data);
716714
const popup = EntryModalHelper.popup;
@@ -772,7 +770,7 @@ class EntryModalHelper {
772770
const modalStyleLink = document.createElement('link');
773771
modalStyleLink.setAttribute(
774772
'href',
775-
'../../../node_modules/@entrylabs/modal/dist/entry/entry-modal.css'
773+
'../../../node_modules/@entrylabs/modal/dist/entry/entry-modal.css',
776774
);
777775
modalStyleLink.setAttribute('rel', 'stylesheet');
778776
document.head.appendChild(modalStyleLink);
@@ -865,7 +863,7 @@ class EntryModalHelper {
865863
.alert(
866864
`${RendererUtils.getLang('Msgs.version_update_msg1').replace(
867865
/%1/gi,
868-
latestVersion
866+
latestVersion,
869867
)}\n\n${RendererUtils.getLang('Msgs.version_update_msg3')}`,
870868
RendererUtils.getLang('General.update_title'),
871869
{
@@ -877,7 +875,7 @@ class EntryModalHelper {
877875
},
878876
parentClassName: 'versionAlert',
879877
withDontShowAgain: true,
880-
}
878+
},
881879
)
882880
.one('click', (event: string, { dontShowChecked }: { dontShowChecked: boolean }) => {
883881
if (event === 'ok') {

0 commit comments

Comments
 (0)