Skip to content

Commit 7af9c71

Browse files
Add tree and working demo
1 parent eef6e5b commit 7af9c71

File tree

8 files changed

+427
-116
lines changed

8 files changed

+427
-116
lines changed

app/controllers/catalog_controller.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -664,14 +664,6 @@ def ae_tree_select_toggle
664664
session[:edit] = @edit
665665
end
666666

667-
def ae_tree_load
668-
assert_new_or_edit_by_service_type
669-
670-
require 'byebug'
671-
byebug
672-
session[:edit]
673-
end
674-
675667
# Method to open the workflows dialog box
676668
# params[:field] => :fqname || :retire_fqname || :reconfigure_fqname
677669
# params[:selected] => Holds the value of the *_configuration_script_id
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React, { useState } from 'react';
2+
import PropTypes from 'prop-types';
3+
4+
const Checkbox = ({ defaultState = false, onChange, children }) => {
5+
const [on, setOn] = useState(defaultState);
6+
const handleChange = (e) => {
7+
setOn(e.target.checked);
8+
onChange && onChange(e.target.checked);
9+
};
10+
return (
11+
<form style={{ display: 'inline-block', padding: 10 }}>
12+
<label>
13+
<input type="checkbox" checked={on} onChange={handleChange} />
14+
{children}
15+
</label>
16+
</form>
17+
);
18+
};
19+
20+
Checkbox.propTypes = {
21+
defaultState: PropTypes.bool,
22+
onChange: PropTypes.func.isRequired,
23+
children: PropTypes.arrayOf(PropTypes.any),
24+
};
25+
26+
Checkbox.defaultProps = {
27+
defaultState: false,
28+
children: [],
29+
};
30+
31+
export default Checkbox;

0 commit comments

Comments
 (0)