Explorar o código

fixup and tags

Daniel Sheffield hai 8 meses
pai
achega
9376dae73d

+ 9 - 6
sqlpage/grocery/categories.sql

@@ -1,8 +1,11 @@
 SET title = 'Categories';
-SET input_log_scale = 'hidden';
-SET input_start = 'disbled';
-SET input_end = 'disbled';
-SET input_unit_mass = 'hidden';
-SET input_unit_volume = 'hidden';
-SET input_unit_count = 'hidden';
+SET filter_config = '{
+    "log_scale": {"type": "hidden"},
+    "start": {"type": "hidden"},
+    "end": {"type": "hidden"},
+    "unit_mass": {"type": "hidden"},
+    "unit_volume": {"type": "hidden"},
+    "unit_count[]": {"type": "hidden"},
+    "tags[]": {"type": "hidden"}
+}';
 SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/internal/entry.sql') AS properties;

+ 9 - 6
sqlpage/grocery/groups.sql

@@ -1,8 +1,11 @@
 SET title = 'Groups';
-SET input_log_scale = 'hidden';
-SET input_start = 'disbled';
-SET input_end = 'disbled';
-SET input_unit_mass = 'hidden';
-SET input_unit_volume = 'hidden';
-SET input_unit_count = 'hidden';
+SET filter_config = '{
+    "log_scale": {"type": "hidden"},
+    "start": {"type": "hidden"},
+    "end": {"type": "hidden"},
+    "unit_mass": {"type": "hidden"},
+    "unit_volume": {"type": "hidden"},
+    "unit_count[]": {"type": "hidden"},
+    "tags[]": {"type": "hidden"}
+}';
 SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/internal/entry.sql') AS properties;

+ 9 - 6
sqlpage/grocery/products.sql

@@ -1,8 +1,11 @@
 SET title = 'Products';
-SET input_log_scale = 'hidden';
-SET input_start = 'disbled';
-SET input_end = 'disbled';
-SET input_unit_mass = 'hidden';
-SET input_unit_volume = 'hidden';
-SET input_unit_count = 'hidden';
+SET filter_config = '{
+    "log_scale": {"type": "hidden"},
+    "start": {"type": "hidden"},
+    "end": {"type": "hidden"},
+    "unit_mass": {"type": "hidden"},
+    "unit_volume": {"type": "hidden"},
+    "unit_count[]": {"type": "hidden"},
+    "tags[]": {"type": "hidden"}
+}';
 SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/internal/entry.sql') AS properties;

+ 6 - 4
sqlpage/grocery/tags.sql

@@ -1,6 +1,8 @@
 SET title = 'Tags';
-SET input_log_scale = 'hidden';
-SET input_unit_mass = 'hidden';
-SET input_unit_volume = 'hidden';
-SET input_unit_count = 'hidden';
+SET filter_config = '{
+    "log_scale": {"type": "hidden"},
+    "unit_mass": {"type": "hidden"},
+    "unit_volume": {"type": "hidden"},
+    "unit_count[]": {"type": "hidden"}
+}';
 SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/internal/entry.sql') AS properties;

+ 3 - 1
sqlpage/grocery/transactions.sql

@@ -1,3 +1,5 @@
 SET title = 'Transactions';
-SET input_log_scale = 'hidden';
+SET filter_config = '{
+    "log_scale": {"type": "hidden"}
+}';
 SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/internal/entry.sql') AS properties;

+ 3 - 1
sqlpage/grocery/volume.sql

@@ -1,3 +1,5 @@
 SET title = 'Volume';
-SET input_log_scale = 'hidden';
+SET filter_config = '{
+    "log_scale": {"type": "hidden"}
+}';
 SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/internal/entry.sql') AS properties;

+ 1 - 1
sqlpage/sqlpage/data/transactions.sql

@@ -48,7 +48,7 @@ AND
     SELECT transaction_id FROM tags_map
     WHERE tag_id IN (
       SELECT id FROM tags tg
-      WHERE tg.name IN (SELECT v#>>'{}' FROM json_array_elements($groups::json) j(v))
+      WHERE tg.name IN (SELECT v#>>'{}' FROM json_array_elements($tags::json) j(v))
     )
   ) OR $tags IS NULL)
 ORDER BY ts DESC