Skip to content

Commit 4f851fa

Browse files
authored
Merge pull request #84 from minjk-bl/devops
Hotfix for 1.1.7 (as v1.1.8)
2 parents ee08bd1 + a31d345 commit 4f851fa

File tree

9 files changed

+63
-16
lines changed

9 files changed

+63
-16
lines changed

css/common/frameEditor.css

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,16 +358,19 @@
358358
.vp-popup-addpage .vp-popup-tab.replace {
359359
height: calc(100% - 50px);
360360
}
361-
.vp-popup-addtype{
361+
.vp-popup-addtype {
362362
width: 153px;
363363
margin-top: 5px;
364364
}
365-
.vp-popup-delete{
365+
.vp-popup-delete {
366366
padding-bottom: 20px;
367367
}
368-
.vp-popup-replace-add{
368+
.vp-popup-replace-add {
369369
margin-top: 30px
370370
}
371-
.vp_popup-apply{
372-
margin-left: 30px;
371+
.vp-popup-apply-column {
372+
width: 153px;
373+
}
374+
.vp-popup-apply-lambda{
375+
margin-top: 5px;
373376
}

css/common/subsetEditor.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@
318318
}
319319
.vp-ds-btn-apply {
320320
position: absolute;
321-
top: 4px;
321+
top: 9px;
322322
right: 15px;
323323
}
324324
.vp-ds-btn-run {

src/api_block/blockContainer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ define([
664664

665665
this.resetOptionPage();
666666

667-
this.setFocusedPageType(FOCUSED_PAGE_TYPE.EDITOR);
667+
this.setFocusedPageType(FOCUSED_PAGE_TYPE.BOARD);
668668
this.reNewContainerDom();
669669
this.reRenderAllBlock_asc();
670670
}
@@ -1124,7 +1124,7 @@ define([
11241124
if (prevSelectedBlock && prevSelectedBlock.isModified) {
11251125
// Ask to save
11261126
var apiBlockPackage = this.getImportPackageThis();
1127-
apiBlockPackage.openMultiBtnModal_new('Unsaved Changes', 'Save changes before leave?',['Don’t save', 'Save'], [() => {
1127+
apiBlockPackage.openMultiBtnModal_new('Unsaved Changes', 'Save changes before leave?',['Don’t save', 'Save'], 2, [() => {
11281128
// cancel
11291129
// $(VP_ID_PREFIX + VP_APIBLOCK_BOARD_OPTION_CANCEL_BUTTON).trigger(STR_CLICK);
11301130
blockContainerThis.cancelBlock();

src/api_block/component/boardMenuBar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ define([
111111

112112
var saveFilePath = vpCommon.formatString("./{0}.{1}", saveFileName, vpConst.VP_NOTE_EXTENSION);
113113
var apiBlockPackage = blockContainer.getImportPackageThis();
114-
apiBlockPackage.openMultiBtnModal_new('Save As', `Save changes to '${saveFileName}.vp'`,['Yes', 'No', 'Cancel'], [() => {
114+
apiBlockPackage.openMultiBtnModal_new('Save As', `Save changes to '${saveFileName}.vp'`,['Yes', 'No', 'Cancel'], 3, [() => {
115115
saveNotePageAction_newVersion(vpCommon.formatString("{0}.{1}", saveFileName, vpConst.VP_NOTE_EXTENSION), saveFilePath);
116116

117117
blockContainer.deleteAllBlock();
@@ -161,7 +161,7 @@ define([
161161

162162
var saveFilePath = $(vpCommon.wrapSelector(vpCommon.formatString("#{0}", vpConst.VP_NOTE_REAL_FILE_PATH))).val();
163163
var apiBlockPackage = blockContainer.getImportPackageThis();
164-
apiBlockPackage.openMultiBtnModal_new('Save As', `Save changes to '${saveFileName}.vp'`,['Yes', 'No', 'Cancel'], [() => {
164+
apiBlockPackage.openMultiBtnModal_new('Save As', `Save changes to '${saveFileName}.vp'`,['Yes', 'No', 'Cancel'], 3, [() => {
165165
if (saveFilePath == '') {
166166
saveAsNotePage();
167167
} else {

src/api_block/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ define([
812812
/** File navigation을 open하지 않고 alert창 띄움*/
813813
} else {
814814
var saveFilePath = vpCommon.formatString("./{0}.{1}", saveFileName, vpConst.VP_NOTE_EXTENSION);
815-
apiBlockPackage.openMultiBtnModal_new('Save As', `Save changes to '${saveFileName}.vp'`,['Yes','No', 'Cancel'], [() => {
815+
apiBlockPackage.openMultiBtnModal_new('Save As', `Save changes to '${saveFileName}.vp'`,['Yes', 'No', 'Cancel'], 3, [() => {
816816
saveNotePageAction_newVersion(saveFileName, saveFilePath);
817817
openNotePage();
818818

src/common/constant.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ define ([
199199
/**
200200
* faq page link
201201
*/
202-
const VPNOTE_PAGE_LINK = 'https://visualpython.ai/vpnote';
202+
const VPNOTE_PAGE_LINK = 'https://visualpython.ai/vpnotes';
203203

204204
/**
205205
* header extra menu faq caption

src/common/vpFuncJS.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,8 @@ define([
415415
* @param {Array<string>} buttons 버튼 캡션
416416
* @param {Array<function>} callback 선택 콜백 함수
417417
*/
418-
VpFuncJS.prototype.openMultiBtnModal_new = function(message = "", submessage, buttons = new Array(), callbackList) {
419-
var mbmModal = new vpMultiButtonModal_new.vpMultiButtonModal(message, submessage, buttons);
418+
VpFuncJS.prototype.openMultiBtnModal_new = function(message = "", submessage, buttons = new Array(), defaultButtonIdx, callbackList) {
419+
var mbmModal = new vpMultiButtonModal_new.vpMultiButtonModal(message, submessage, buttons, defaultButtonIdx);
420420
mbmModal.openModal(callbackList);
421421
}
422422
return {'VpFuncJS': VpFuncJS};

src/common/vpSubsetEditor.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,6 +1760,7 @@ define([
17601760
});
17611761

17621762
$(document).on('change', this.wrapSelector('.vp-ds-cond-tbl .vp-col-list'), function() {
1763+
var thisTag = $(this);
17631764
var varName = $(this).closest('td').find('.vp-cond-var').val();
17641765
var colName = $(this).find('option:selected').attr('data-code');
17651766

@@ -1769,6 +1770,12 @@ define([
17691770
// get result and load column list
17701771
kernelApi.executePython(code, function(result) {
17711772
var category = JSON.parse(result);
1773+
if (category && category.length > 0) {
1774+
// if it's categorical column, check 'Text' as default
1775+
$(thisTag).closest('td').find('.vp-cond-use-text').prop('checked', true);
1776+
} else {
1777+
$(thisTag).closest('td').find('.vp-cond-use-text').prop('checked', false);
1778+
}
17721779
$(condTag).replaceWith(function() {
17731780
return that.renderConditionCondInput(category);
17741781
});

src/file_io/udf.js

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,44 @@ define([
203203
} else if (menu == 'default-snippets') {
204204
// import default snippets
205205
var defaultSnippets = {
206-
'default import': 'import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n%matplotlib inline\nimport seaborn as sns'
206+
'default import': [
207+
'import numpy as np',
208+
'import pandas as pd',
209+
'import matplotlib.pyplot as plt',
210+
'%matplotlib inline',
211+
'import seaborn as sns',
212+
'import plotly.express as px'
213+
],
214+
'as_float': [
215+
'def as_float(x):',
216+
' """',
217+
" usage: df['col'] = df['col'].apply(as_float)",
218+
' """',
219+
' if not isinstance(x, str):',
220+
' return 0.0',
221+
' else:',
222+
' try:',
223+
' result = float(x)',
224+
' return result',
225+
' except ValueError:',
226+
' return 0.0'
227+
],
228+
'as_int': [
229+
'def as_int(x):',
230+
' """',
231+
" usage: df['col'] = df['col'].apply(as_int)",
232+
' """',
233+
' if not isinstance(x, str):',
234+
' return 0',
235+
' else:',
236+
' try:',
237+
' result = int(x)',
238+
' return result',
239+
' except ValueError:',
240+
' return 0.0'
241+
]
207242
}
243+
208244
var timestamp = new Date().getTime();
209245

210246
var keys = Object.keys(defaultSnippets);
@@ -218,7 +254,8 @@ define([
218254
importKey = key + '_imported' + importNo;
219255
importNo += 1;
220256
}
221-
var newSnippet = { [importKey]: { code: defaultSnippets[key], timestamp: timestamp } };
257+
var code = defaultSnippets[key].join('\n');
258+
var newSnippet = { [importKey]: { code: code, timestamp: timestamp } };
222259
vpSetting.saveUserDefinedCode(newSnippet);
223260

224261
importKeys.push(importKey);

0 commit comments

Comments
 (0)