generated from alecodes/base-template
feat: add logic_group crud
This commit is contained in:
parent
baf70e6820
commit
d643e1c0f2
7 changed files with 98 additions and 11 deletions
63
src/app/logic_groups/index.sql
Normal file
63
src/app/logic_groups/index.sql
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
SELECT
|
||||
'dynamic' AS component,
|
||||
sqlpage.read_file_as_text('../shared/shell.json') AS properties;
|
||||
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ Form │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
SELECT
|
||||
'form' AS component,
|
||||
'create.sql' AS "action",
|
||||
'Save' AS validate,
|
||||
'Logic Group' AS title;
|
||||
|
||||
SELECT
|
||||
'source_id' AS name,
|
||||
'Source' AS label,
|
||||
'select' AS TYPE,
|
||||
TRUE AS required,
|
||||
TRUE AS searchable,
|
||||
'Select...' AS empty_option,
|
||||
(
|
||||
SELECT
|
||||
jsonb_agg(jsonb_build_object('label', name, 'value', id))
|
||||
FROM
|
||||
public.sources
|
||||
) AS options;
|
||||
|
||||
SELECT
|
||||
'name' AS name,
|
||||
'Name' AS label,
|
||||
8 AS width,
|
||||
TRUE AS required;
|
||||
|
||||
SELECT
|
||||
'uid' AS name,
|
||||
'Identifier' AS label,
|
||||
4 AS width,
|
||||
8 AS maxlength,
|
||||
1 AS minlength,
|
||||
TRUE AS required;
|
||||
|
||||
SELECT
|
||||
'uri' AS name,
|
||||
'URI' AS label;
|
||||
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ Table list │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
SELECT
|
||||
'table' AS component,
|
||||
'source' AS markdown,
|
||||
TRUE AS sort,
|
||||
TRUE AS search;
|
||||
|
||||
SELECT
|
||||
lg.id,
|
||||
lg.uid,
|
||||
format('[%s](/sources/%s)', src.name, src.id) AS Source,
|
||||
lg.name,
|
||||
lg.uri
|
||||
FROM
|
||||
public.logic_groups AS lg
|
||||
INNER JOIN public.sources AS src ON lg.source_id = src.id;
|
||||
Loading…
Add table
Add a link
Reference in a new issue