Skip to content

Commit 0e0b6fa

Browse files
authored
Merge pull request #26 from minjk-bl/devops
Devops #23(proceed), #22(closed)
2 parents aad32d8 + 8f625bc commit 0e0b6fa

File tree

5 files changed

+63
-46
lines changed

5 files changed

+63
-46
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ assignees: ''
88
---
99

1010
**Describe the bug**
11-
A clear and concise description of what the bug is.
11+
1212

1313
**To Reproduce**
1414
Steps to reproduce the behavior:
@@ -18,18 +18,17 @@ Steps to reproduce the behavior:
1818
4. See error
1919

2020
**Expected behavior**
21-
A clear and concise description of what you expected to happen.
21+
what you expected to happen
2222

2323
**Screenshots**
24-
If applicable, add screenshots to help explain your problem.
24+
add screenshots to help explain your problem
2525

2626
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
27+
- OS: [e.g. Windows 10, Mac]
28+
- Browser [e.g. chrome, safari]
3029

3130
**VisualPython Information (please complete the following information):**
3231
- Version [e.g. 1.1.0]
3332

3433
**Additional context**
35-
Add any other context about the problem here.
34+
any other context about the problem here.

data/libraries.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,11 +616,11 @@
616616
<path aa="AA">visualpython - numpy</path>
617617
<desc>Numpy 패키지 라이브러리</desc>
618618

619-
<item id="np_importNumpy" type="function" level="1" name="import" tag="넘파이, IMPORT NUMPY">
619+
<!-- <item id="np_importNumpy" type="function" level="1" name="import" tag="넘파이, IMPORT NUMPY">
620620
<path>visualpython - numpy - import numpy</path>
621621
<desc>Import Numpy</desc>
622622
<file>numpy/pageList/numpyImport/numpyImport.js</file>
623-
</item>
623+
</item> -->
624624

625625
<item id="pkg_arrayCreation" type="package" level="1" name="Array creation" tag="넘파이, NUMPY, FUNCTION">
626626
<path aa="AA">visualpython - numpy - array creation</path>
@@ -1210,11 +1210,11 @@
12101210
<desc>변수 조회해서 복사하는 화면</desc>
12111211
<file>pandas/variables.js</file>
12121212
</item> -->
1213-
<item id="pd_importPandas" type="function" level="1" name="import" tag="판다스, IMPORT PANDAS">
1213+
<!-- <item id="pd_importPandas" type="function" level="1" name="import" tag="판다스, IMPORT PANDAS">
12141214
<path>visualpython - pandas - import pandas</path>
12151215
<desc>Import Pandas</desc>
12161216
<file>pandas/import.js</file>
1217-
</item>
1217+
</item> -->
12181218
<!-- plotting -->
12191219
<item id="pd_plot" type="function" level="1" name="plot" tag="차트 그리기, PLOT, DRAW CHART FOR PANDAS, PLOT">
12201220
<path>visualpython - pandas - plot</path>

src/api_block/blockContainer.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ define([
285285
// re-render block header
286286
var codeLineStr = block.getNowCodeLine();
287287
block.writeCode(codeLineStr);
288+
this.resetBlockList();
289+
this.resetOptionPage();
290+
this.reRenderAllBlock_asc();
291+
288292
} else {
289293
// blockList에 없으면, 삭제
290294
block.deleteBlock_childBlockList();
@@ -349,6 +353,7 @@ define([
349353
block.isModified = true;
350354
} else {
351355
$(VP_CLASS_PREFIX + 'vp-apiblock-option-new-to-save').css('display', 'none');
356+
block.isModified = false;
352357
}
353358
}
354359
} else {

src/common/component/vpVarSelector.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,14 @@ define([
131131
// load using kernel
132132
var dataTypes = this.showOthers? []: this.dataTypes;
133133
kernelApi.searchVarList(dataTypes, function(result) {
134-
var varList = JSON.parse(result);
135-
that.state.varList = varList;
136-
// render variable list
137-
that.loadVariableList(varList);
134+
try {
135+
var varList = JSON.parse(result);
136+
that.state.varList = varList;
137+
// render variable list
138+
that.loadVariableList(varList);
139+
} catch (ex) {
140+
console.log(ex);
141+
}
138142
});
139143
}
140144

src/common/vpSubsetEditor.js

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -150,28 +150,6 @@ define([
150150
this.bindEvent();
151151
this.init();
152152

153-
// set codemirror
154-
this.codepreview = codemirror.fromTextArea($('#vp_previewCode')[0], {
155-
mode: {
156-
name: 'python',
157-
version: 3,
158-
singleLineStringErrors: false
159-
}, // text-cell(markdown cell) set to 'htmlmixed'
160-
height: '100%',
161-
width: '100%',
162-
indentUnit: 4,
163-
matchBrackets: true,
164-
readOnly:true,
165-
autoRefresh: true,
166-
// lineWrapping: false, // text-cell(markdown cell) set to true
167-
// indentWithTabs: true,
168-
theme: "ipython",
169-
extraKeys: {"Enter": "newlineAndIndentContinueMarkdownList"},
170-
scrollbarStyle: "null"
171-
});
172-
this.setPreview('# Code Preview');
173-
174-
175153
// set readonly
176154
if (useInputVariable) {
177155
$(this.wrapSelector('.' + VP_DS_PANDAS_OBJECT)).attr('disabled', true);
@@ -384,7 +362,7 @@ define([
384362
* Wrap Selector for data selector popup with its uuid
385363
* @param {string} query
386364
*/
387-
SubsetEditor.prototype.wrapSelector = function(query) {
365+
SubsetEditor.prototype.wrapSelector = function(query = '') {
388366
return vpCommon.formatString('.{0}.{1} {2}', VP_DS, this.uuid, query);
389367
}
390368

@@ -1644,17 +1622,46 @@ define([
16441622
* open popup
16451623
*/
16461624
SubsetEditor.prototype.open = function() {
1625+
if (!this.codepreview) {
1626+
// var previewTextarea = $('#vp_previewCode')[0];
1627+
var previewTextarea = $(this.wrapSelector('#vp_previewCode'))[0];
1628+
// if (wrappedTextarea) {
1629+
// previewTextarea = wrappedTextarea;
1630+
// }
1631+
// set codemirror
1632+
this.codepreview = codemirror.fromTextArea(previewTextarea, {
1633+
mode: {
1634+
name: 'python',
1635+
version: 3,
1636+
singleLineStringErrors: false
1637+
}, // text-cell(markdown cell) set to 'htmlmixed'
1638+
height: '100%',
1639+
width: '100%',
1640+
indentUnit: 4,
1641+
matchBrackets: true,
1642+
readOnly:true,
1643+
autoRefresh: true,
1644+
// lineWrapping: false, // text-cell(markdown cell) set to true
1645+
// indentWithTabs: true,
1646+
theme: "ipython",
1647+
extraKeys: {"Enter": "newlineAndIndentContinueMarkdownList"},
1648+
scrollbarStyle: "null"
1649+
});
1650+
this.setPreview('# Code Preview');
1651+
}
1652+
this.codepreview.refresh();
1653+
16471654
// reload pandasObject on open
16481655
this.loadVariables();
16491656

1650-
$(vpCommon.formatString(".{0}.{1}", VP_DS, this.uuid)).show();
1657+
$(this.wrapSelector()).show();
16511658
}
16521659

16531660
/**
16541661
* close popup
16551662
*/
16561663
SubsetEditor.prototype.close = function() {
1657-
$(vpCommon.formatString(".{0}.{1}", VP_DS, this.uuid)).hide();
1664+
$(this.wrapSelector()).hide();
16581665
}
16591666

16601667
SubsetEditor.prototype.hideButton = function() {
@@ -1908,12 +1915,14 @@ define([
19081915
}
19091916

19101917
SubsetEditor.prototype.setPreview = function(previewCodeStr) {
1911-
this.codepreview.setValue(previewCodeStr);
1912-
this.codepreview.save();
1913-
var that = this;
1914-
setTimeout(function() {
1915-
that.codepreview.refresh();
1916-
}, 1);
1918+
if (this.codepreview) {
1919+
this.codepreview.setValue(previewCodeStr);
1920+
this.codepreview.save();
1921+
var that = this;
1922+
setTimeout(function() {
1923+
that.codepreview.refresh();
1924+
}, 1);
1925+
}
19171926
}
19181927

19191928
return SubsetEditor

0 commit comments

Comments
 (0)