Skip to content

Commit

Permalink
Add tree and working demo
Browse files Browse the repository at this point in the history
  • Loading branch information
GilbertCherrie committed Dec 5, 2024
1 parent eef6e5b commit 7af9c71
Show file tree
Hide file tree
Showing 8 changed files with 427 additions and 116 deletions.
8 changes: 0 additions & 8 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -664,14 +664,6 @@ def ae_tree_select_toggle
session[:edit] = @edit
end

def ae_tree_load
assert_new_or_edit_by_service_type

require 'byebug'
byebug
session[:edit]
end

# Method to open the workflows dialog box
# params[:field] => :fqname || :retire_fqname || :reconfigure_fqname
# params[:selected] => Holds the value of the *_configuration_script_id
Expand Down
31 changes: 31 additions & 0 deletions app/javascript/components/automate-entry-points/checkbox.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React, { useState } from 'react';
import PropTypes from 'prop-types';

const Checkbox = ({ defaultState = false, onChange, children }) => {
const [on, setOn] = useState(defaultState);
const handleChange = (e) => {
setOn(e.target.checked);
onChange && onChange(e.target.checked);
};
return (
<form style={{ display: 'inline-block', padding: 10 }}>
<label>
<input type="checkbox" checked={on} onChange={handleChange} />
{children}
</label>
</form>
);
};

Checkbox.propTypes = {
defaultState: PropTypes.bool,
onChange: PropTypes.func.isRequired,
children: PropTypes.arrayOf(PropTypes.any),
};

Checkbox.defaultProps = {
defaultState: false,
children: [],
};

export default Checkbox;
Loading

0 comments on commit 7af9c71

Please sign in to comment.