Skip to content

Commit 0d0df07

Browse files
authored
Revert "Devops"
1 parent 5b9b8b7 commit 0d0df07

15 files changed

+121
-179
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
dist/
22
jupyterlab/lib/visualpython
3-
test/
3+
test/

visualpython/css/component/dataSelector.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@
5555
}
5656
.vp-ds-data-box {
5757
width: 100%;
58-
height: 150px;
58+
height: 160px;
5959
align-content: baseline;
6060
align-items: center;
6161
}
6262
.vp-ds-type-box,
6363
.vp-ds-variable-box {
6464
border: 0.25px solid var(--border-gray-color);
65-
height: 150px;
65+
height: 160px;
6666
grid-row-gap: 0px;
6767
align-content: baseline;
6868
}
@@ -90,7 +90,7 @@
9090
margin-top: 10px;
9191
}
9292
.vp-ds-option-inner-box {
93-
height: calc(100% - 35px);
93+
height: calc(100% - 30px);
9494
}
9595
.vp-ds-df-option-box {
9696
height: 100%;

visualpython/css/component/multiSelector.css

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,4 @@
7979
left: calc(100% - 25px);
8080
bottom: 23px;
8181
cursor: pointer;
82-
}
83-
.vp-cs-del-item {
84-
position: relative;
85-
float: right;
86-
top: 4px;
87-
cursor: pointer;
8882
}

visualpython/css/m_ml/modelInfo.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
.vp-model-select-box {
2-
grid-column-gap: 5px;
3-
align-items: start;
4-
}
51
.vp-ins-select-title {
62
font-weight: bold;
73
color: var(--font-highlight);

visualpython/html/component/dataSelector.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="vp-inner-popup-close" title="Close data selector"></div>
99
</div>
1010
<div class="vp-inner-popup-body vp-scrollbar">
11-
<div class="vp-grid-col-p50 mb5">
11+
<div class="vp-grid-col-p50">
1212
<label class="vp-bold">Type</label>
1313
<label class="vp-bold">Data</label>
1414
</div>
@@ -22,7 +22,7 @@
2222
</div>
2323
<div class="vp-ds-option-box">
2424
<label class="vp-bold">Option Page</label>
25-
<div class="vp-ds-option-inner-box mt5">
25+
<div class="vp-ds-option-inner-box">
2626

2727
</div>
2828
</div>

visualpython/html/m_apps/file.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
</td>
7575
</tr>
7676
<tr>
77-
<td><label for="vp_sampleReturn">Allocate to</label></td>
77+
<td><label for="vp_sampleReturn" class="vp-orange-text">Allocate to</label></td>
7878
<td><input type="text" class="vp-input input-single" id="vp_sampleReturn" placeholder="" value="" title=""></td>
7979
</tr>
8080
</tbody>

visualpython/js/MainFrame.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,10 +478,10 @@ define([
478478
let parentBlock = null;
479479
let prevBlock = null;
480480
loadStateList.forEach(obj => {
481-
let { file, blockType, menuId, menuState, menuConfig, argIdx, position, afterAction } = obj;
481+
let { blockType, menuId, menuState, menuConfig, argIdx, position, afterAction } = obj;
482482
// get OptionComponent Object
483483
// LAB: relative path needed
484-
let OptionComponent = require('./' + file);
484+
let OptionComponent = require('./' + menuConfig.file);
485485
if (OptionComponent) {
486486
let taskState = menuState.taskState;
487487
let blockState = menuState.blockState;

visualpython/js/com/com_Config.js

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ define([
208208
vp_config_version: '1.0.0',
209209
vp_signature: 'VisualPython',
210210
vp_position: {},
211-
vp_section_display: false,
211+
// CHROME: default to display vp
212+
vp_section_display: true,
212213
vp_note_display: false,
213214
vp_menu_width: Config.MENU_MIN_WIDTH,
214215
vp_note_width: Config.BOARD_MIN_WIDTH
@@ -484,15 +485,15 @@ define([
484485
that._checkMounted().then(function() {
485486
that._readFromColab(configKey).then(function(result) {
486487
let data = result;
487-
if (data == undefined || (data instanceof Object && Object.keys(data).length === 0)) {
488+
if (data == undefined || data == {}) {
488489
resolve(data);
489490
return;
490491
}
491492
if (dataKey == '') {
492493
resolve(data);
493494
return;
494495
}
495-
if (data instanceof Object && Object.keys(data).length > 0) {
496+
if (Object.keys(data).length > 0) {
496497
resolve(data[dataKey]);
497498
return;
498499
}
@@ -508,15 +509,15 @@ define([
508509
// LAB: use local .visualpython files
509510
that._readFromLab(configKey).then(function(result) {
510511
let data = result;
511-
if (data == undefined || (data instanceof Object && Object.keys(data).length === 0)) {
512+
if (data == undefined || data == {}) {
512513
resolve(data);
513514
return;
514515
}
515516
if (dataKey == '') {
516517
resolve(data);
517518
return;
518519
}
519-
if (data instanceof Object && Object.keys(data).length > 0) {
520+
if (Object.keys(data).length > 0) {
520521
resolve(data[dataKey]);
521522
return;
522523
}
@@ -778,40 +779,6 @@ define([
778779
return Config.version;
779780
}
780781

781-
checkVersionTimestamp = function() {
782-
let that = this;
783-
// check version timestamp
784-
let nowDate = new Date();
785-
this.getData('version_timestamp', 'vpcfg').then(function(data) {
786-
let doCheckVersion = false;
787-
vpLog.display(VP_LOG_TYPE.DEVELOP, 'Checking its version timestamp... : ' + data);
788-
if (data == undefined || (data instanceof Object && Object.keys(data).length === 0)) {
789-
// no timestamp, check version
790-
doCheckVersion = true;
791-
} else if (data != '') {
792-
let lastCheck = new Date(parseInt(data));
793-
let diffCheck_now = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, nowDate.getDate());
794-
let diffCheck_last = new Date(lastCheck.getFullYear(), lastCheck.getMonth() + 1, lastCheck.getDate());
795-
796-
let diff = Math.abs(diffCheck_now.getTime() - diffCheck_last.getTime());
797-
diff = Math.ceil(diff / (1000 * 3600 * 24));
798-
799-
if (diff >= 1) {
800-
// if More than 1 day passed, check version
801-
doCheckVersion = true;
802-
}
803-
}
804-
805-
// check version and update version_timestamp
806-
if (doCheckVersion == true) {
807-
that.checkVpVersion(true);
808-
}
809-
810-
}).catch(function(err) {
811-
vpLog.display(VP_LOG_TYPE.ERROR, err);
812-
})
813-
}
814-
815782
checkVpVersion(background=false) {
816783
let that = this;
817784
let nowVersion = this.getVpInstalledVersion();
@@ -851,8 +818,6 @@ define([
851818
switch (clickedBtnIdx) {
852819
case 0:
853820
// cancel
854-
// update version_timestamp
855-
that.setData({ 'version_timestamp': new Date().getTime() }, 'vpcfg');
856821
break;
857822
case 1:
858823
// update

visualpython/js/com/com_generatorV2.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,14 @@ define([
134134
package.options && package.options.forEach(function(o, i) {
135135
var obj = JSON.parse(JSON.stringify(o));
136136
let newTag = vp_createTag(pageThis, obj, state);
137-
if (obj.required === true || obj.output === true) {
137+
if (obj.required) {
138138
tblInput.append(newTag);
139139
} else {
140140
tblOption.append(newTag);
141141
}
142142
});
143143

144144
// TODO: userOption
145-
if (package.code.includes('${etc}')) {
146-
147-
}
148145

149146
bindAutoComponentEvent(pageThis);
150147
}
@@ -166,7 +163,7 @@ define([
166163
let value = state[name];
167164

168165
var requiredFontStyle = required == true? 'vp-orange-text' : '';
169-
var lblTag = $(`<label class="vp-bold">${label}</label>`).attr({
166+
var lblTag = $(`<label>${label}</label>`).attr({
170167
'for': name,
171168
'class': requiredFontStyle,
172169
'title': '(' + name + ')'

visualpython/js/com/component/MultiSelector.js

Lines changed: 57 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ define([
305305
// select - right
306306
tag.appendFormatLine('<div class="{0}">', APP_SELECT_RIGHT);
307307
var selectedList = this.dataList.filter(data => that.selectedList.includes(data.code));
308-
tag.appendLine(this.renderSelectedBox(this.selectedList));
308+
tag.appendLine(this.renderSelectedBox(selectedList));
309309
if (this.allowAdd) {
310310
// add item
311311
tag.appendLine('<input type="text" class="vp-cs-add-item-name vp-input wp100" placeholder="New item to add" value="">');
@@ -380,6 +380,62 @@ define([
380380
that.bindDraggable();
381381
});
382382

383+
// item indexing
384+
$(this.wrapSelector('.' + APP_SELECT_ITEM)).on('click', function(event) {
385+
var dataIdx = $(this).attr('data-idx');
386+
var idx = $(this).index();
387+
var added = $(this).hasClass('added'); // right side added item?
388+
var selector = '';
389+
390+
// remove selection for select box on the other side
391+
if (added) {
392+
// remove selection for left side
393+
$(that.wrapSelector('.' + APP_SELECT_ITEM + ':not(.added)')).removeClass('selected');
394+
// set selector
395+
selector = '.added';
396+
} else {
397+
// remove selection for right(added) side
398+
$(that.wrapSelector('.' + APP_SELECT_ITEM + '.added')).removeClass('selected');
399+
// set selector
400+
selector = ':not(.added)';
401+
}
402+
403+
if (vpEvent.keyManager.keyCheck.ctrlKey) {
404+
// multi-select
405+
that.pointer = { start: idx, end: -1 };
406+
$(this).toggleClass('selected');
407+
} else if (vpEvent.keyManager.keyCheck.shiftKey) {
408+
// slicing
409+
var startIdx = that.pointer.start;
410+
411+
if (startIdx == -1) {
412+
// no selection
413+
that.pointer = { start: idx, end: -1 };
414+
} else if (startIdx > idx) {
415+
// add selection from idx to startIdx
416+
var tags = $(that.wrapSelector('.' + APP_SELECT_ITEM + selector));
417+
for (var i = idx; i <= startIdx; i++) {
418+
$(tags[i]).addClass('selected');
419+
}
420+
that.pointer = { start: startIdx, end: idx };
421+
} else if (startIdx <= idx) {
422+
// add selection from startIdx to idx
423+
var tags = $(that.wrapSelector('.' + APP_SELECT_ITEM + selector));
424+
for (var i = startIdx; i <= idx; i++) {
425+
$(tags[i]).addClass('selected');
426+
}
427+
that.pointer = { start: startIdx, end: idx };
428+
}
429+
} else {
430+
// single-select
431+
that.pointer = { start: idx, end: -1 };
432+
// un-select others
433+
$(that.wrapSelector('.' + APP_SELECT_ITEM + selector)).removeClass('selected');
434+
// select this
435+
$(this).addClass('selected');
436+
}
437+
});
438+
383439
// item indexing - add all
384440
$(this.wrapSelector('.' + APP_SELECT_ADD_ALL_BTN)).on('click', function(event) {
385441
$(that.wrapSelector('.' + APP_SELECT_BOX + '.left .' + APP_SELECT_ITEM)).appendTo(
@@ -454,75 +510,6 @@ define([
454510
that._addNewItem(newItemName);
455511
}
456512
});
457-
458-
this._bindItemClickEvent();
459-
}
460-
461-
_bindItemClickEvent() {
462-
let that = this;
463-
// item indexing
464-
$(this.wrapSelector('.' + APP_SELECT_ITEM)).off('click');
465-
$(this.wrapSelector('.' + APP_SELECT_ITEM)).on('click', function(event) {
466-
var dataIdx = $(this).attr('data-idx');
467-
var idx = $(this).index();
468-
var added = $(this).hasClass('added'); // right side added item?
469-
var selector = '';
470-
471-
// remove selection for select box on the other side
472-
if (added) {
473-
// remove selection for left side
474-
$(that.wrapSelector('.' + APP_SELECT_ITEM + ':not(.added)')).removeClass('selected');
475-
// set selector
476-
selector = '.added';
477-
} else {
478-
// remove selection for right(added) side
479-
$(that.wrapSelector('.' + APP_SELECT_ITEM + '.added')).removeClass('selected');
480-
// set selector
481-
selector = ':not(.added)';
482-
}
483-
484-
if (vpEvent.keyManager.keyCheck.ctrlKey) {
485-
// multi-select
486-
that.pointer = { start: idx, end: -1 };
487-
$(this).toggleClass('selected');
488-
} else if (vpEvent.keyManager.keyCheck.shiftKey) {
489-
// slicing
490-
var startIdx = that.pointer.start;
491-
492-
if (startIdx == -1) {
493-
// no selection
494-
that.pointer = { start: idx, end: -1 };
495-
} else if (startIdx > idx) {
496-
// add selection from idx to startIdx
497-
var tags = $(that.wrapSelector('.' + APP_SELECT_ITEM + selector));
498-
for (var i = idx; i <= startIdx; i++) {
499-
$(tags[i]).addClass('selected');
500-
}
501-
that.pointer = { start: startIdx, end: idx };
502-
} else if (startIdx <= idx) {
503-
// add selection from startIdx to idx
504-
var tags = $(that.wrapSelector('.' + APP_SELECT_ITEM + selector));
505-
for (var i = startIdx; i <= idx; i++) {
506-
$(tags[i]).addClass('selected');
507-
}
508-
that.pointer = { start: startIdx, end: idx };
509-
}
510-
} else {
511-
// single-select
512-
that.pointer = { start: idx, end: -1 };
513-
// un-select others
514-
$(that.wrapSelector('.' + APP_SELECT_ITEM + selector)).removeClass('selected');
515-
// select this
516-
$(this).addClass('selected');
517-
}
518-
});
519-
520-
// item deleting (manually added item only)
521-
$(this.wrapSelector('.vp-cs-del-item')).off('click');
522-
$(this.wrapSelector('.vp-cs-del-item')).on('click', function(event) {
523-
$(this).closest('.' + APP_SELECT_ITEM).remove();
524-
that.pointer = { start: -1, end: -1 };
525-
});
526513
}
527514

528515
_addNewItem(newItemName) {
@@ -564,7 +551,6 @@ define([
564551
let newItemIndex = this.dataList.length;
565552
var targetTag = $(`<div class="${APP_SELECT_ITEM} ${APP_DRAGGABLE} added selected" data-idx="${newItemIndex}" data-name="${newItemName}" data-type="object" data-code="'${newItemName}'" title="${newItemName}: Added manually">
566553
<span>${newItemName}</span>
567-
<div class="vp-cs-del-item vp-icon-close-small" title="Delete this manually added item"></div>
568554
</div>`);
569555
$(targetTag).appendTo(
570556
$(this.wrapSelector('.' + APP_SELECT_BOX + '.right'))
@@ -574,8 +560,6 @@ define([
574560
$(this.wrapSelector('.' + APP_SELECT_ITEM)).removeClass('selected');
575561
// clear item input
576562
$(this.wrapSelector('.vp-cs-add-item-name')).val('');
577-
// bind click event
578-
this._bindItemClickEvent();
579563
// bind draggable
580564
this.bindDraggable();
581565
}

visualpython/js/com/component/PopupComponent.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ define([
9292
this.id = this.state.config.id;
9393
this.name = this.state.config.name;
9494
this.path = this.state.config.path;
95-
this.category = this.state.config.category;
9695

9796

9897
this.config = {
@@ -531,8 +530,7 @@ define([
531530
template() {
532531
this.$pageDom = $(popupComponentHtml.replaceAll('${vp_base}', com_Const.BASE_PATH));
533532
// set title
534-
// this.$pageDom.find('.vp-popup-title').text(this.category + ' > ' + this.name);
535-
this.$pageDom.find('.vp-popup-title').html(`<span style="color: var(--gray-color);font-size: 12px;">${this.category} > </span><span>${this.name}</span>`);
533+
this.$pageDom.find('.vp-popup-title').text(this.name);
536534
// set body
537535
let bodyTemplate = this.templateForBody();
538536
// CHROME: check url keyword and replace it

0 commit comments

Comments
 (0)