From 897a3177c35f0e0c02699dde68d9219cdc27b1fa Mon Sep 17 00:00:00 2001 From: nezbite Date: Fri, 21 Aug 2020 17:55:02 +0200 Subject: [PATCH 01/11] optimized query input bar --- IHP/IDE/Data/View/EditRow.hs | 2 +- IHP/IDE/Data/View/EditValue.hs | 2 +- IHP/IDE/Data/View/Layout.hs | 2 +- IHP/IDE/Data/View/NewRow.hs | 2 +- IHP/IDE/Data/View/ShowDatabase.hs | 2 +- IHP/IDE/Data/View/ShowQuery.hs | 2 +- IHP/IDE/Data/View/ShowTableRows.hs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/IHP/IDE/Data/View/EditRow.hs b/IHP/IDE/Data/View/EditRow.hs index dac26ecf9..4bb627648 100644 --- a/IHP/IDE/Data/View/EditRow.hs +++ b/IHP/IDE/Data/View/EditRow.hs @@ -23,13 +23,13 @@ data EditRowView = EditRowView instance View EditRowView ViewContext where html EditRowView { .. } = [hsx|
- {customQuery ""}
{renderTableSelector tableNames tableName}
{renderRows rows tableBody tableName}
+ {customQuery ""}
{Just modal} |] diff --git a/IHP/IDE/Data/View/EditValue.hs b/IHP/IDE/Data/View/EditValue.hs index 193338a4e..37146a88b 100644 --- a/IHP/IDE/Data/View/EditValue.hs +++ b/IHP/IDE/Data/View/EditValue.hs @@ -22,13 +22,13 @@ data EditValueView = EditValueView instance View EditValueView ViewContext where html EditValueView { .. } = [hsx|
- {customQuery ""}
{renderTableSelector tableNames tableName}
{renderRows rows tableBody tableName}
+ {customQuery ""}
{script} |] diff --git a/IHP/IDE/Data/View/Layout.hs b/IHP/IDE/Data/View/Layout.hs index a0081f5f4..c621fa368 100644 --- a/IHP/IDE/Data/View/Layout.hs +++ b/IHP/IDE/Data/View/Layout.hs @@ -6,7 +6,7 @@ import IHP.IDE.ToolServer.Types import IHP.IDE.ToolServer.Layout customQuery :: Text -> Html -customQuery input = [hsx|
{input}
|] +customQuery input = [hsx|
{input}
|] tableHead :: [[DynamicField]] -> Text -> Html tableHead rows tableName = [hsx|{forEach (columnNames rows) renderColumnHead} diff --git a/IHP/IDE/Data/View/NewRow.hs b/IHP/IDE/Data/View/NewRow.hs index 14ecafc68..c7637f44f 100644 --- a/IHP/IDE/Data/View/NewRow.hs +++ b/IHP/IDE/Data/View/NewRow.hs @@ -21,13 +21,13 @@ data NewRowView = NewRowView instance View NewRowView ViewContext where html NewRowView { .. } = [hsx|
- {customQuery ""}
{renderTableSelector tableNames tableName}
{renderRows rows tableBody tableName}
+ {customQuery ""}
{Just modal} |] diff --git a/IHP/IDE/Data/View/ShowDatabase.hs b/IHP/IDE/Data/View/ShowDatabase.hs index 702691134..ece7e3bb4 100644 --- a/IHP/IDE/Data/View/ShowDatabase.hs +++ b/IHP/IDE/Data/View/ShowDatabase.hs @@ -15,10 +15,10 @@ data ShowDatabaseView = ShowDatabaseView { instance View ShowDatabaseView ViewContext where html ShowDatabaseView { .. } = [hsx|
- {customQuery ""}
{renderTableSelector tableNames ""}
+ {customQuery ""}
|] diff --git a/IHP/IDE/Data/View/ShowQuery.hs b/IHP/IDE/Data/View/ShowQuery.hs index a8015e6ef..5bb64992a 100644 --- a/IHP/IDE/Data/View/ShowQuery.hs +++ b/IHP/IDE/Data/View/ShowQuery.hs @@ -18,12 +18,12 @@ data ShowQueryView = ShowQueryView instance View ShowQueryView ViewContext where html ShowQueryView { .. } = [hsx|
- {customQuery query}
{renderRows}
+ {customQuery query}
|] where diff --git a/IHP/IDE/Data/View/ShowTableRows.hs b/IHP/IDE/Data/View/ShowTableRows.hs index 1ef655fa5..5eaa23ceb 100644 --- a/IHP/IDE/Data/View/ShowTableRows.hs +++ b/IHP/IDE/Data/View/ShowTableRows.hs @@ -20,13 +20,13 @@ data ShowTableRowsView = ShowTableRowsView instance View ShowTableRowsView ViewContext where html ShowTableRowsView { .. } = [hsx|
- {customQuery ""}
{renderTableSelector tableNames tableName}
{renderRows rows tableBody tableName}
+ {customQuery ""}
|] where From 305e9ccfedcb2c3a0af9256cf073973375f56ba8 Mon Sep 17 00:00:00 2001 From: nezbite Date: Fri, 21 Aug 2020 18:07:40 +0200 Subject: [PATCH 02/11] fieldValues are displayed without quotes --- IHP/IDE/Data/View/EditRow.hs | 2 +- IHP/IDE/Data/View/EditValue.hs | 2 +- IHP/IDE/Data/View/Layout.hs | 10 +++++++--- IHP/IDE/Data/View/NewRow.hs | 2 +- IHP/IDE/Data/View/ShowQuery.hs | 2 +- IHP/IDE/Data/View/ShowTableRows.hs | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/IHP/IDE/Data/View/EditRow.hs b/IHP/IDE/Data/View/EditRow.hs index 4bb627648..027fdcbac 100644 --- a/IHP/IDE/Data/View/EditRow.hs +++ b/IHP/IDE/Data/View/EditRow.hs @@ -36,7 +36,7 @@ instance View EditRowView ViewContext where where tableBody = [hsx|{forEach rows renderRow}|] renderRow fields = [hsx|{forEach fields renderField}|] - renderField DynamicField { .. } = [hsx|{fieldValue}|] + renderField DynamicField { .. } = [hsx|{cleanValue fieldValue}|] modalContent = [hsx| diff --git a/IHP/IDE/Data/View/EditValue.hs b/IHP/IDE/Data/View/EditValue.hs index 37146a88b..bd3aa07d2 100644 --- a/IHP/IDE/Data/View/EditValue.hs +++ b/IHP/IDE/Data/View/EditValue.hs @@ -55,7 +55,7 @@ instance View EditValueView ViewContext where |] - else [hsx|{fieldValue}|] + else [hsx|{cleanValue fieldValue}|] renderValue DynamicField { .. } = [hsx| fromMaybe "" fieldValue <> "'"}/>|] script = preEscapedToHtml [plain|