@aj-shadow/z-abs-complayer-modaldialog-client 0.0.0-aj-beta.221

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/.gitattributes +26 -0
  2. package/LICENSE.txt +96 -0
  3. package/README.md +5 -0
  4. package/npm-shrinkwrap.json +13 -0
  5. package/package.json +10 -0
  6. package/project/client/_build/Bundle-CompLayer-Modaldialog-client.bld +38 -0
  7. package/project/client/_build/Client-CompLayer-Modaldialog-client-jsx.bld +10 -0
  8. package/project/client/_build/Client-CompLayer-Modaldialog-client.bld +10 -0
  9. package/project/client/_build/Client-css-CompLayer-Modaldialog-bundle.bld +9 -0
  10. package/project/client/_build/z-abs-complayer-modaldialog-client.prj +36 -0
  11. package/project/client/actions/action-modal-dialog.js +29 -0
  12. package/project/client/css/abstraction_add.css +10 -0
  13. package/project/client/css/modal-dialog-file.css +5 -0
  14. package/project/client/css/modal.css +162 -0
  15. package/project/client/css/modal_body.css +18 -0
  16. package/project/client/css/modal_header.css +11 -0
  17. package/project/client/helper/helper-event-listener.js +29 -0
  18. package/project/client/helper/helper-modal-popover.js +35 -0
  19. package/project/client/helper/input-analyzer.js +47 -0
  20. package/project/client/images/actor-image.jsx +260 -0
  21. package/project/client/images/file-image.jsx +44 -0
  22. package/project/client/images/msg-image.jsx +31 -0
  23. package/project/client/modal-dialog-abstraction-add.jsx +992 -0
  24. package/project/client/modal-dialog-abstraction-properties.jsx +220 -0
  25. package/project/client/modal-dialog-file-add.jsx +183 -0
  26. package/project/client/modal-dialog-file-new.jsx +489 -0
  27. package/project/client/modal-dialog-file-properties.jsx +206 -0
  28. package/project/client/modal-dialog-file-remove.jsx +157 -0
  29. package/project/client/modal-dialog-folder-add.jsx +292 -0
  30. package/project/client/modal-dialog-folder-new.jsx +231 -0
  31. package/project/client/modal-dialog-folder-properties.jsx +237 -0
  32. package/project/client/modal-dialog-folder-remove.jsx +149 -0
  33. package/project/client/modal-dialog-search.jsx +144 -0
  34. package/project/client/modal-dialog-wizard-list.jsx +49 -0
  35. package/project/client/modal-dialog-wizard.jsx +145 -0
  36. package/project/client/modal-dialog-workspace-new.jsx +157 -0
  37. package/project/client/modal-dialog-workspace-open.jsx +306 -0
  38. package/project/client/stores/modal-dialog-store.js +63 -0
  39. package/project/z-abs-complayer-modaldialog-client.tree +41 -0
@@ -0,0 +1,145 @@
1
+
2
+ 'use strict';
3
+
4
+ import HelperModalPopover from './helper/helper-modal-popover';
5
+ import Modal from 'z-abs-complayer-bootstrap-client/client/modal';
6
+ import ModalHeader from 'z-abs-complayer-bootstrap-client/client/modal-header';
7
+ import ModalBody from 'z-abs-complayer-bootstrap-client/client/modal-body';
8
+ import ModalFooter from 'z-abs-complayer-bootstrap-client/client/modal-footer';
9
+ import Popover from 'z-abs-complayer-bootstrap-client/client/popover';
10
+ import ReactComponentBase from 'z-abs-corelayer-client/client/react-component/react-component-base';
11
+ import React from 'react';
12
+
13
+
14
+ export default class ModalDialogWizard extends ReactComponentBase {
15
+ constructor(props) {
16
+ super(props, {
17
+ show: false,
18
+ folder: null,
19
+ name: ''
20
+ });
21
+ this.boundKeyDown = this._keyDown.bind(this);
22
+ this.helperModalPopover = new HelperModalPopover();
23
+ }
24
+
25
+ didMount() {
26
+ this.helperModalPopover.didMount();
27
+ }
28
+
29
+ shouldUpdate(nextProps, nextState) {
30
+ return !this.shallowCompare(this.props, nextProps)
31
+ || !this.shallowCompare(this.state, nextState);
32
+ }
33
+
34
+ show(folder) {
35
+ this.updateState({
36
+ show: {$set: true},
37
+ folder: {$set: folder},
38
+ name: {$set: ''}
39
+ });
40
+ window.addEventListener('keydown', this.boundKeyDown, true);
41
+ }
42
+
43
+ hide() {
44
+ window.removeEventListener('keydown', this.boundKeyDown, true);
45
+ this.updateState({
46
+ show: {$set: false},
47
+ folder: {$set: null}
48
+ });
49
+ }
50
+
51
+ _keyDown(e) {
52
+ if(!e.ctrlKey && !e.shiftKey && 'Enter' === e.key) {
53
+ if(!this.state.error) {
54
+ e.preventDefault();
55
+ this.new();
56
+ this.hide();
57
+ }
58
+ }
59
+ else if(e.ctrlKey && e.shiftKey && 'C' === e.key) {
60
+ e.preventDefault();
61
+ this.hide();
62
+ }
63
+ }
64
+
65
+ renderErrorMessage() {
66
+ /* if(this.props.result.code !== 'success') {
67
+ let errorDivStyle = {
68
+ float: 'left',
69
+ textAlign: 'left',
70
+ width: 440
71
+ }
72
+ return (
73
+ <div style={errorDivStyle}>
74
+ <p className="text-danger control-label modal_body_p_as_label">{this.props.result.msg}</p>
75
+ </div>
76
+ );
77
+ }*/
78
+ }
79
+
80
+ renderChildren() {
81
+ return (
82
+ <>
83
+ <br />
84
+ {this.props.children}
85
+ </>
86
+ );
87
+ }
88
+
89
+ render() {
90
+ let nameDivLabelClassName = 'col-sm-10';
91
+ let errorShow = false;
92
+ if(undefined !== this.props.result.status && !this.props.result.status.name.status) {
93
+ nameDivLabelClassName += ' has-error';
94
+ errorShow = true;
95
+ }
96
+ this.helperModalPopover.onRender();
97
+ return (
98
+ <Modal ref={this.helperModalPopover.modalRef} id="modal_wizard" aria-labelledby="contained-modal-title-sm" show={this.state.show || errorShow}
99
+ onHide={(e) => {
100
+ this.hide();
101
+ }}
102
+ >
103
+ <ModalHeader closeButton>
104
+ <img className="modal_header_icon pull-left" src="/abs-images/svg/ActorJsA.svg" alt="ActorJs Icon"></img>
105
+ <h4 className="modal_header_heading modal-sm">{this.props.heading}</h4>
106
+ </ModalHeader>
107
+ <ModalBody>
108
+ <div className="form-group">
109
+ <div className="row" style={{textAlign: 'right'}}>
110
+ <div className="col-sm-2">
111
+ <label htmlFor="modal_dialog_wizard_name" className="control-label">Name</label>
112
+ </div>
113
+ <div className="col-sm-9">
114
+ <input type="text" id="modal_dialog_wizard_name" className="form-control input-sm" placeholder={this.props.namePlaceHolder} value={this.state.name}
115
+ onChange={(e) => {
116
+ this.updateState({name: {$set: e.target.value}});
117
+ }}
118
+ />
119
+ </div>
120
+ </div>
121
+ {this.renderChildren()}
122
+ </div>
123
+ </ModalBody>
124
+ <ModalFooter>
125
+ {this.renderErrorMessage()}
126
+ <Popover ref={this.helperModalPopover.getPopoverRef()} placement="bottom" heading="" content="" shortcut="Enter" style={{display:'inline-block'}} disabled={!this.state.show}>
127
+ <button id="wizard_add_button" type="button" className="btn btn-primary" disabled={0 === this.state.name.length}
128
+ onClick={(e) => {
129
+ this.props.onWizardNew(this.state.folder.projectId, `${this.state.folder.data.path}/${this.state.folder.title}`, this.state.name);
130
+ this.hide();
131
+ }}
132
+ >Add</button>
133
+ </Popover>
134
+ <Popover ref={this.helperModalPopover.getPopoverRef()} placement="bottom" heading="" content="" shortcut="Ctrl+Shift+C" style={{display:'inline-block',marginLeft:'5px'}} disabled={!this.state.show}>
135
+ <button id="wizard_close_button" type="button" className="btn btn-default" disabled={!this.state.show}
136
+ onClick={(e) => {
137
+ this.hide();
138
+ }}
139
+ >Close</button>
140
+ </Popover>
141
+ </ModalFooter>
142
+ </Modal>
143
+ );
144
+ }
145
+ }
@@ -0,0 +1,157 @@
1
+
2
+ 'use strict';
3
+
4
+ import HelperModalPopover from './helper/helper-modal-popover';
5
+ import Modal from 'z-abs-complayer-bootstrap-client/client/modal';
6
+ import ModalHeader from 'z-abs-complayer-bootstrap-client/client/modal-header';
7
+ import ModalBody from 'z-abs-complayer-bootstrap-client/client/modal-body';
8
+ import ModalFooter from 'z-abs-complayer-bootstrap-client/client/modal-footer';
9
+ import Popover from 'z-abs-complayer-bootstrap-client/client/popover';
10
+ import ReactComponentBase from 'z-abs-corelayer-client/client/react-component/react-component-base';
11
+ import React from 'react';
12
+
13
+
14
+ export default class ModalDialogWorkspaceNew extends ReactComponentBase {
15
+ constructor(props) {
16
+ super(props, {
17
+ show: false,
18
+ appName: '',
19
+ appType: 0
20
+ });
21
+ this.boundKeyDown = this._keyDown.bind(this);
22
+ this.helperModalPopover = new HelperModalPopover();
23
+ }
24
+
25
+ didMount() {
26
+ this.helperModalPopover.didMount();
27
+ }
28
+
29
+ shouldUpdate(nextProps, nextState) {
30
+ return !this.shallowCompare(this.props.heading, nextProps.heading)
31
+ || !this.shallowCompare(this.props.result, nextProps.result)
32
+ || !this.shallowCompare(this.state, nextState);
33
+ }
34
+
35
+ show() {
36
+ this.updateState({
37
+ show: {$set: true},
38
+ appName: {$set: ''},
39
+ appType: {$set: 0}
40
+ });
41
+ window.addEventListener('keydown', this.boundKeyDown, true);
42
+ }
43
+
44
+ hide() {
45
+ window.removeEventListener('keydown', this.boundKeyDown, true);
46
+ this.updateState({
47
+ show: {$set: false},
48
+ appName: {$set: ''},
49
+ appType: {$set: 0}
50
+ });
51
+ }
52
+
53
+ _keyDown(e) {
54
+ if(!e.ctrlKey && !e.shiftKey && 'Enter' === e.key) {
55
+ if(!this.state.error) {
56
+ e.preventDefault();
57
+ this.new();
58
+ this.hide();
59
+ }
60
+ }
61
+ else if(e.ctrlKey && e.shiftKey && 'C' === e.key) {
62
+ e.preventDefault();
63
+ this.hide();
64
+ }
65
+ }
66
+
67
+ renderErrorMessage() {
68
+ /* if(this.props.result.code !== 'success') {
69
+ let errorDivStyle = {
70
+ float: 'left',
71
+ textAlign: 'left',
72
+ width: 440
73
+ }
74
+ return (
75
+ <div style={errorDivStyle}>
76
+ <p className="text-danger control-label modal_body_p_as_label">{this.props.result.msg}</p>
77
+ </div>
78
+ );
79
+ }*/
80
+ }
81
+
82
+ render() {
83
+ let nameDivLabelClassName = 'col-sm-10';
84
+ let errorShow = false;
85
+ if(undefined !== this.props.result.status && !this.props.result.status.name.status) {
86
+ nameDivLabelClassName += ' has-error';
87
+ errorShow = true;
88
+ }
89
+ this.helperModalPopover.onRender();
90
+ return (
91
+ <Modal ref={this.helperModalPopover.modalRef} id="modal_workspace_new" aria-labelledby="contained-modal-title-sm" show={this.state.show || errorShow}
92
+ onHide={(e) => {
93
+ this.hide();
94
+ }}
95
+ >
96
+ <ModalHeader closeButton>
97
+ <img className="modal_header_icon pull-left" src="/abs-images/svg/ActorJsA.svg" alt="ActorJs Icon"></img>
98
+ <h4 className="modal_header_heading modal-sm">{this.props.heading}</h4>
99
+ </ModalHeader>
100
+ <ModalBody>
101
+ <div className="form-group">
102
+ <div className="row" style={{textAlign: 'right'}}>
103
+ <div className="col-sm-3">
104
+ <label htmlFor="workspace_new_app_name" className="control-label">App Name</label>
105
+ </div>
106
+ <div className="col-sm-8">
107
+ <input type="text" id="workspace_new_app_name" className="form-control input-sm" placeholder="app name" value={this.state.appName}
108
+ onChange={(e) => {
109
+ this.updateState({appName: {$set: e.target.value}});
110
+ }}
111
+ />
112
+ </div>
113
+ </div>
114
+ <br />
115
+ <div className="row" style={{textAlign: 'right'}}>
116
+ <div className="col-sm-3">
117
+ <label htmlFor="workspace_new_workspace_name" className="control-label">App Type</label>
118
+ </div>
119
+ <div className="col-sm-8">
120
+ <div className="col-sm-3">
121
+ <input type="radio" id="radio-app" style={{position:'relative',top:'1px'}} aria-label="..." checked={0 === this.state.appType} onChange={(e) => {
122
+ this.updateState({appType: {$set: 0}});
123
+ }}/>
124
+ <label htmlFor="radio-app" style={{paddingLeft:'4px'}}>{"App"}</label>
125
+ </div>
126
+ <div className="col-sm-3">
127
+ <input type="radio" id="radio-node" style={{position:'relative',top:'1px'}} aria-label="..." checked={1 === this.state.appType} onChange={(e) => {
128
+ this.updateState({appType: {$set: 1}});
129
+ }}/>
130
+ <label htmlFor="radio-node" style={{paddingLeft:'4px'}}>{"Node"}</label>
131
+ </div>
132
+ </div>
133
+ </div>
134
+ </div>
135
+ </ModalBody>
136
+ <ModalFooter>
137
+ {this.renderErrorMessage()}
138
+ <Popover ref={this.helperModalPopover.getPopoverRef()} placement="bottom" heading="" content="" shortcut="Enter" style={{display:'inline-block'}} disabled={!this.state.show}>
139
+ <button id="workspace_new_add_button" type="button" className="btn btn-primary" disabled={0 === this.state.appName.length}
140
+ onClick={(e) => {
141
+ this.props.onWorkspaceNew(this.state.appName, this.state.appType);
142
+ this.hide();
143
+ }}
144
+ >Add</button>
145
+ </Popover>
146
+ <Popover ref={this.helperModalPopover.getPopoverRef()} placement="bottom" heading="" content="" shortcut="Ctrl+Shift+C" style={{display:'inline-block',marginLeft:'5px'}} disabled={!this.state.show}>
147
+ <button id="workspace_new_close_button" type="button" className="btn btn-default" disabled={!this.state.show}
148
+ onClick={(e) => {
149
+ this.hide();
150
+ }}
151
+ >Close</button>
152
+ </Popover>
153
+ </ModalFooter>
154
+ </Modal>
155
+ );
156
+ }
157
+ }
@@ -0,0 +1,306 @@
1
+
2
+ 'use strict';
3
+
4
+ import HelperEventListener from './helper/helper-event-listener';
5
+ import HelperModalPopover from './helper/helper-modal-popover';
6
+ import FileIcons from 'z-abs-complayer-bootstrap-client/client/icons/file-icons';
7
+ import FolderIcons from 'z-abs-complayer-bootstrap-client/client/icons/folder-icons';
8
+ import Modal from 'z-abs-complayer-bootstrap-client/client/modal';
9
+ import ModalHeader from 'z-abs-complayer-bootstrap-client/client/modal-header';
10
+ import ModalBody from 'z-abs-complayer-bootstrap-client/client/modal-body';
11
+ import ModalFooter from 'z-abs-complayer-bootstrap-client/client/modal-footer';
12
+ import Popover from 'z-abs-complayer-bootstrap-client/client/popover';
13
+ import Tree from 'z-abs-complayer-tree-client/client/react-components/tree';
14
+ import ReactComponentBase from 'z-abs-corelayer-client/client/react-component/react-component-base';
15
+ import Project from 'z-abs-corelayer-cs/clientServer/project';
16
+ import React from 'react';
17
+
18
+
19
+ export default class ModalDialogWorkspaceOpen extends ReactComponentBase {
20
+ constructor(props) {
21
+ super(props, {
22
+ name: '',
23
+ types: []
24
+ });
25
+ this.helperModalPopover = new HelperModalPopover();
26
+ this.eventListener = new HelperEventListener('keydown', this._keyDown.bind(this), true);
27
+ }
28
+
29
+ static getDerivedStateFromProps(props, state) {
30
+ let update = null;
31
+ if(0 === state.types.length) {
32
+ const types = props.folder?.data.types.map((type) => {
33
+ return {
34
+ chosen: 'actorjs' !== type,
35
+ name: type
36
+ }
37
+ });
38
+ update = {
39
+ types: types ? types : []
40
+ };
41
+ }
42
+ return update;
43
+ }
44
+
45
+ didMount() {
46
+ this.helperModalPopover.didMount();
47
+ }
48
+
49
+ shouldUpdate(nextProps, nextState) {
50
+ return !this.shallowCompare(this.props.name, nextProps.name)
51
+ || !this.shallowCompare(this.props.heading, nextProps.heading)
52
+ || !this.shallowCompare(this.props.result, nextProps.result)
53
+ //|| !this.shallowCompare(this.props.project, nextProps.project)
54
+ //|| !this.shallowCompare(this.props.current, nextProps.current)
55
+ //|| !this.shallowCompare(this.props.original, nextProps.original)
56
+ || !this.shallowCompare(this.props.modalResults, nextProps.modalResults)
57
+ || !this.shallowCompare(this.state, nextState);
58
+ }
59
+
60
+ didUpdate(prevProps, prevState) {
61
+ const previousModalResult = prevProps.modalResults.get(this.props.name);
62
+ const modalResult = this.props.modalResults.get(this.props.name);
63
+ if(modalResult) {
64
+ if(!prevProps.modalResult || (prevProps.modalResult.visible !== modalResult.visible)) {
65
+ if(modalResult.visible) {
66
+ this.eventListener.init();
67
+ }
68
+ else {
69
+ this.eventListener.exit();
70
+ }
71
+ }
72
+ }
73
+ }
74
+
75
+ willUnmount() {
76
+ this.eventListener.exit();
77
+ }
78
+
79
+ hide() {
80
+ this.updateState({
81
+ name: {$set: ''},
82
+ types: {$set: []}
83
+ });
84
+ this.props.onHide();
85
+ }
86
+
87
+ _keyDown(e) {
88
+ const disabled = null === this.props.current.folder || !this.props.current.folder.data.path.startsWith(`${this.props.original.folder.data.path}/${this.props.original.folder.title}`);
89
+ if(!e.ctrlKey && !e.shiftKey && 'Enter' === e.key) {
90
+ if(!disabled) {
91
+ e.preventDefault();
92
+ const types = [];
93
+ this.state.types.forEach((type) => {
94
+ if(type.chosen) {
95
+ types.push(type.name);
96
+ }
97
+ });
98
+ const data = this.deepCopy(this.props.current.folder.data);
99
+ data.path = `${this.props.folder.data.path}/${this.props.folder.title}`;
100
+ data.types = types;
101
+ this.props.onAdd();
102
+ this.hide();
103
+ }
104
+ }
105
+ else if(e.ctrlKey && e.shiftKey && 'C' === e.key) {
106
+ e.preventDefault();
107
+ this.hide();
108
+ }
109
+ else if('ArrowUp' === e.key) {
110
+
111
+ }
112
+ else if('ArrowDown' === e.key) {
113
+
114
+ }
115
+ else if('ArrowLeft' === e.key) {
116
+
117
+ }
118
+
119
+ else if('ArrowRight' === e.key) {
120
+
121
+ }
122
+ }
123
+
124
+ setName(name) {
125
+ this.updateState({
126
+ name: {$set: name}
127
+ });
128
+ }
129
+
130
+ setDescription(description) {
131
+ this.updateState({
132
+ description: description
133
+ });
134
+ }
135
+
136
+ renderErrorMessage() {
137
+ const modalResult = this.props.modalResults.get(this.props.name);
138
+ if(this.state.error || 'error' === modalResult?.result.code) {
139
+ const msg = this.state.error ? this.state.errorText : modalResult.result.msg;
140
+ const errorDivStyle = {
141
+ float: 'left',
142
+ textAlign: 'left',
143
+ width: 420
144
+ };
145
+ const labelStyle = {
146
+ top: '2px',
147
+ position: 'relative'
148
+ };
149
+ return (
150
+ <div style={errorDivStyle}>
151
+ <p id="worksapce_opn_modal_error_label" className="text-danger control-label modal_body_p_as_label" style={labelStyle}>{msg}</p>
152
+ </div>
153
+ );
154
+ }
155
+ else {
156
+ return null;
157
+ }
158
+ }
159
+
160
+ renderTree() {
161
+ if(0 !== this.props.workspaces.length) {
162
+ const project = new Project();
163
+ let node = project.addRootFolder('workspaces', [], 'key', true);
164
+ this.props.workspaces.forEach((workspace) => {
165
+ project.addFolderToNode(workspace, '.', [], node);
166
+ });
167
+ return (
168
+ <Tree id="actor_tree_modal_dialogworkspace_open" project={project} current={{folder:null, file:null}} expandCurrentFolder={true} allowExpand={false} folderIcons={FolderIcons} fileIcons={FileIcons}
169
+ onClickFile={(key, title, path, type) => {}}
170
+ onClickFolder={(key, title, data) => {
171
+ console.log('KLOCLSDASDASDASDASDASDASDASDASDASDASDASDA');
172
+ project.select(key, true);
173
+ this.props.onChoose(title);
174
+ }}
175
+ onToggleFolder={(key, expanded) => {}}
176
+ />
177
+ );
178
+ }
179
+ else {
180
+ return null;
181
+ }
182
+ }
183
+
184
+ /*renderFileTypes(disabled) {
185
+ if(!disabled && this.props.folder) {
186
+ const fileTypes = this.props.folder.data.types.map((type, index) => {
187
+ if('actorjs' !== type) {
188
+ return (
189
+ <React.Fragment key={`worksapce_opn_input_${type}`}>
190
+ <div className="col-sm-1">
191
+ <input type="checkbox" id={`worksapce_opn_input_type_${type}`} aria-label="..." autoComplete="off" checked={this.state.types[index]?.chosen}
192
+ onChange={(e) => {
193
+ this.state.types[index].chosen = e.currentTarget.checked;
194
+ this.updateState({types: {$set: this.state.types}});
195
+ }}
196
+ />
197
+ </div>
198
+ <div className="col-sm-1">
199
+ <label htmlFor={`worksapce_opn_input_type_${type}`} className="modal_body_file_type control-label">{type}</label>
200
+ </div>
201
+ </React.Fragment>
202
+ );
203
+ }
204
+ });
205
+ return (
206
+ <>
207
+ <hr className="modal_body_hr" />
208
+ <div className="row">
209
+ <div className="col-sm-1" />
210
+ <h5 className="modal_body_file_type_heading col-sm-4">File Types</h5>
211
+ </div>
212
+ <div key="file_types" className="row">
213
+ <div className="col-sm-1" />
214
+ {fileTypes}
215
+ </div>
216
+ </>
217
+ );
218
+ }
219
+ }*/
220
+
221
+ _calculateDepth(node, currentDepth, depth) {
222
+ if(depth > currentDepth.value) {
223
+ ++currentDepth.value;
224
+ }
225
+ node.children.forEach((child) => {
226
+ if(child.folder) {
227
+ this._calculateDepth(child, currentDepth, ++depth);
228
+ }
229
+ });
230
+ }
231
+
232
+ /*renderNotFound(disabled) {
233
+ if(disabled && 0 !== this.props.project.source.length) {
234
+ const errorDivStyle = {
235
+ float: 'left',
236
+ textAlign: 'left',
237
+ width: 420
238
+ };
239
+ const labelStyle = {
240
+ top: '2px',
241
+ position: 'relative'
242
+ };
243
+ const currentDepth = {value: 0};
244
+ this._calculateDepth(this.props.project.source[0], currentDepth, 0);
245
+ return (
246
+ <div style={errorDivStyle}>
247
+ <p id="worksapce_opn_modal_error_label" className="text-danger control-label modal_body_p_as_label" style={labelStyle}>No Folders Found</p>
248
+ </div>
249
+ );
250
+ }
251
+ }*/
252
+
253
+ render() {
254
+ this.helperModalPopover.onRender();
255
+ const modalResult = this.props.modalResults.get(this.props.name);
256
+ const show = !!modalResult?.visible;
257
+ // const disabled = null === this.props.current.folder || !this.props.current.folder.data.path.startsWith(`${this.props.original.folder.data.path}/${this.props.original.folder.title}`);
258
+ const disabled = false;
259
+ return (
260
+ <Modal ref={this.helperModalPopover.modalRef} id="modal_worksapce_opn" aria-labelledby="contained-modal-title-sm" show={show}
261
+ onHide={(e) => {
262
+ this.hide();
263
+ }}
264
+ >
265
+ <ModalHeader closeButton>
266
+ <img className="modal_header_icon pull-left" src="/abs-images/svg/ActorJsA.svg" alt="ActorJs Icon"></img>
267
+ <h4 className="modal_header_heading modal-sm">{this.props.heading}</h4>
268
+ </ModalHeader>
269
+ <ModalBody className="modal-dialog-file-body">
270
+ {this.renderTree()}
271
+ {/*this.renderFileTypes(disabled)*/}
272
+ </ModalBody>
273
+ <ModalFooter>
274
+ {this.renderErrorMessage()}
275
+ {/*this.renderNotFound(disabled)*/}
276
+ <Popover ref={this.helperModalPopover.getPopoverRef()} placement="bottom" heading="" content="" shortcut="Enter" style={{display:'inline-block'}} disabled={!show}>
277
+ <button id="worksapce_opn_add_button" type="button" className="btn btn-primary" disabled={disabled}
278
+ onClick={(e) => {
279
+ const types = [];
280
+ this.state.types.forEach((type) => {
281
+ if(type.chosen) {
282
+ types.push(type.name);
283
+ }
284
+ });
285
+ {/*const data = this.deepCopy(this.props.current.folder.data);
286
+ data.path = `${this.props.folder.data.path}/${this.props.folder.title}`;
287
+ data.types = types;*/}
288
+ this.props.onAdd();
289
+ }}
290
+ >Add</button>
291
+ </Popover>
292
+ <Popover ref={this.helperModalPopover.getPopoverRef()} placement="bottom" heading="" content="" shortcut="Ctrl+Shift+C" style={{display:'inline-block',marginLeft:'5px'}} disabled={!show}>
293
+ <button id="worksapce_opn_close_button" type="button" className="btn btn-default" disabled={!show}
294
+ onClick={(e) => {
295
+ this.hide();
296
+ }}
297
+ >Close</button>
298
+ </Popover>
299
+ </ModalFooter>
300
+ </Modal>
301
+ );
302
+ }
303
+ }
304
+
305
+
306
+ module.exports = ModalDialogWorkspaceOpen;
@@ -0,0 +1,63 @@
1
+
2
+ 'use strict';
3
+
4
+ import StoreBaseRealtime from 'z-abs-corelayer-client/client/store/store-base-realtime';
5
+
6
+
7
+ class ModalDialogStore extends StoreBaseRealtime {
8
+ constructor() {
9
+ super({
10
+ modalResults: new Map()
11
+ });
12
+ this.pendingName = '';
13
+ }
14
+
15
+ onActionModalDialogShow(action) {
16
+ this.updateState({modalResults: (modalResults) => {
17
+ const modalResultNew = {
18
+ name: action.name,
19
+ visible: true,
20
+ result: {
21
+ code: 'success',
22
+ error: null,
23
+ msg: ''
24
+ }
25
+ };
26
+ modalResults.set(action.name, modalResultNew);
27
+ }});
28
+ }
29
+
30
+ onActionModalDialogHide(action) {
31
+ this.updateState({modalResults: (modalResults) => {
32
+ const modalResultNew = {
33
+ name: action.name,
34
+ visible: false,
35
+ result: {
36
+ code: 'success',
37
+ error: null,
38
+ msg: ''
39
+ }
40
+ };
41
+ modalResults.set(action.name, modalResultNew);
42
+ }});
43
+ }
44
+
45
+ onActionModalDialogPending(action) {
46
+ this.pendingName = action.name;
47
+ }
48
+
49
+ onActionModalDialogResult(action) {
50
+ this.updateState({modalResults: (modalResults) => {
51
+ const modalResultNew = {
52
+ name: this.pendingName,
53
+ visible: 'error' === action.result.code,
54
+ result: action.result
55
+ };
56
+ modalResults.set(this.pendingName, modalResultNew);
57
+ }});
58
+ this.pendingName = '';
59
+ }
60
+ }
61
+
62
+
63
+ module.exports = new ModalDialogStore();