Skip to content

Commit

Permalink
feat: add action name to action set
Browse files Browse the repository at this point in the history
  • Loading branch information
alberto-abarzua committed Nov 7, 2023
1 parent 9d34db7 commit 6ac8846
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 22 additions & 3 deletions frontend/src/components/actions/ActionSet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
AccordionItem,
AccordionTrigger,
} from '@/components/ui/accordion';
import { Label } from '@/components/ui/label';
import { actionListActions } from '@/redux/ActionListSlice';
import { ItemTypes } from '@/utils/ItemTypes';
import AddIcon from '@mui/icons-material/Add';
Expand Down Expand Up @@ -51,9 +52,26 @@ const ActionSet = ({ action, ...props }) => {
</div>
) : (
<div className="w-full px-2">
<Accordion type="single" collapsible defaultValue="item-1">
<Accordion type="single" collapsible defaultValue="item-1" className="w-full">
<AccordionItem value="item-1">
<AccordionTrigger>Sub Actions</AccordionTrigger>
<AccordionTrigger>
<input
type="search"
autoComplete="off"
className="focus:border-blue-3 w-2/3 rounded-md border-none bg-slate-300 px-2 py-1 text-lg italic text-gray-900 hover:border-blue-300 "
placeholder="Change Action Set Name"
value={action.name}
name="actionsetlabel"
onChange={e =>
dispatch(
actionListActions.setActionName({
actionId: action.id,
name: e.target.value,
})
)
}
/>
</AccordionTrigger>
<AccordionContent>
<ActionContainer actionList={actionList}></ActionContainer>
</AccordionContent>
Expand All @@ -69,7 +87,7 @@ const ActionSet = ({ action, ...props }) => {
{...props}
>
<div className=" flex flex-1 items-center justify-end">
<div className="flex w-full items-center justify-end text-black">
<div className="flex w-full flex-col items-start justify-center text-black">
<div className="my-3 flex w-full flex-1 items-center justify-center rounded-md bg-action-data shadow">
{body}
</div>
Expand All @@ -84,6 +102,7 @@ ActionSet.propTypes = {
type: PropTypes.string.isRequired,
id: PropTypes.number.isRequired,
value: PropTypes.arrayOf(PropTypes.any).isRequired,
name: PropTypes.string,
}).isRequired,
};

Expand Down
7 changes: 7 additions & 0 deletions frontend/src/redux/ActionListSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const initialState = {
// parentId,
// valid,
// running,
// name,
// }

const getParentList = (state, action) => {
Expand Down Expand Up @@ -165,6 +166,12 @@ const actionListSlice = createSlice({
const { actionId, value } = action.payload;
state.byId[actionId].value = value;
},

setActionName: (state, action) => {
const { actionId, name } = action.payload;
state.byId[actionId].name = name;
},

pushActionToValue: (state, action) => {
let { actionId, actionToAddId } = action.payload;

Expand Down

0 comments on commit 6ac8846

Please sign in to comment.