1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

#23 fixed submit button appearance for lab

This commit is contained in:
Fedor Katurov 2021-03-26 12:35:31 +07:00
parent 998a2e305a
commit ede5dfe17f
15 changed files with 82 additions and 44 deletions

View file

@ -87,9 +87,10 @@ export const nodeSetTags = (tags: ITag[]) => ({
tags,
});
export const nodeCreate = (node_type: INode['type']) => ({
export const nodeCreate = (node_type: INode['type'], isLab?: boolean) => ({
type: NODE_ACTIONS.CREATE,
node_type,
isLab,
});
export const nodeEdit = (id: INode['id']) => ({

View file

@ -227,10 +227,18 @@ function* onUpdateTags({ id, tags }: ReturnType<typeof nodeUpdateTags>) {
} catch {}
}
function* onCreateSaga({ node_type: type }: ReturnType<typeof nodeCreate>) {
function* onCreateSaga({ node_type: type, isLab }: ReturnType<typeof nodeCreate>) {
if (!type || !has(type, NODE_EDITOR_DIALOGS)) return;
yield put(nodeSetEditor({ ...EMPTY_NODE, ...(NODE_EDITOR_DATA[type] || {}), type }));
yield put(
nodeSetEditor({
...EMPTY_NODE,
...(NODE_EDITOR_DATA[type] || {}),
type,
is_promoted: !isLab,
})
);
yield put(modalShowDialog(NODE_EDITOR_DIALOGS[type]));
}