From 790992ceff656515da770c242192794c343164a3 Mon Sep 17 00:00:00 2001 From: deepanshkhurana Date: Sat, 14 Sep 2024 17:42:43 +0530 Subject: [PATCH] fix: handle showing EMPTY SQL values properly --- app/logic/app_utils.R | 18 ++++++++++++++++-- app/static/css/app.min.css | 2 +- app/styles/_layout.scss | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/logic/app_utils.R b/app/logic/app_utils.R index cc44d69..ff9827f 100644 --- a/app/logic/app_utils.R +++ b/app/logic/app_utils.R @@ -4,7 +4,9 @@ box::use( ], dplyr[ mutate, - select + select, + mutate_all, + if_else ], ) @@ -25,5 +27,17 @@ process_table_data <- function( ) { sapply(api_table_response, data.frame) |> t() |> - data.frame() + data.frame() |> + select( + id, + everything() + ) |> + select(-created_at) |> + mutate_all( + ~ replace( + ., + . %in% c("NULL", "", "NA", NA, NULL), + " " + ) + ) } diff --git a/app/static/css/app.min.css b/app/static/css/app.min.css index d006d6c..c44c139 100644 --- a/app/static/css/app.min.css +++ b/app/static/css/app.min.css @@ -1 +1 @@ -.sweet-alert{border-radius:0 !important}.sweet-alert .sa-button-container{padding-bottom:30px !important}.sweet-alert button{border-radius:0 !important;box-shadow:none !important}.sweet-alert button.confirm{background-color:#305f72 !important}.sweet-alert button.cancel{background-color:#f18c8e !important}.argus-filter-area{display:flex;text-align:center;justify-content:center;gap:5px;color:#305f72;flex-wrap:wrap}@media(min-width: 768px){.argus-filter-area input[type=number]{min-width:36px}}.argus-filter-area input[type=number]::-webkit-inner-spin-button,.argus-filter-area input[type=number]::-webkit-outer-spin-button{opacity:1}.argus-filter-area .selectize-dropdown{width:fit-content !important;text-align:left;border-radius:0;border:0}.argus-filter-area .shiny-input-container,.argus-filter-area .shiny-text-output{width:fit-content}.argus-filter-area .selectize-dropdown .selected{background-color:rgba(48,95,114,.1254901961);color:#305f72}.argus-filter-area .form-control,.argus-filter-area .selectize-input,.argus-filter-area .selectize-input>.item{all:unset;text-decoration:underline dotted;font-weight:500}.argus-filter-area .selectize-input::after{content:none !important}.argus-filter-area .selectize-input.focus{border:0 !important;border-radius:0 !important;box-shadow:none}.argus-filter-area .has-error,.argus-filter-area .has-error .form-control:focus{text-decoration-color:#f18c8e !important;color:#f18c8e !important;border:0 !important;box-shadow:none !important}.argus-filter-area .selector-button{border:0;background:0;padding:0;height:0}.argus-filter-area .save-button,.argus-filter-area .delete-button{border:0;background:0;margin:0;padding:0;margin-left:5px;margin-bottom:10px;font-size:14px;color:#305f72}.argus-filter-area p{color:#333}.argus-data-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}@media screen and (max-width: 1023px){.argus-data-grid{grid-template-columns:1fr}}.argus-data-grid .argus-field-block{color:#305f72}.argus-data-grid .argus-field-block .argus-field-heading{font-size:12px;background:rgba(48,95,114,.1254901961);text-align:left;padding:10px;font-weight:700;text-transform:uppercase}.argus-data-grid .argus-field-block .argus-field-input{width:100%}.argus-data-grid .argus-field-block .argus-field-input .form-control{display:unset;width:unset;height:unset;padding:unset;font-size:unset;line-height:unset;color:unset;background-color:unset;background-image:unset;border:1px solid unset;border-radius:unset;box-shadow:unset;transition:unset}.argus-data-grid .argus-field-block .argus-field-value,.argus-data-grid .argus-field-block .argus-field-input>input{font-size:24px !important;padding:10px !important;font-weight:900 !important;width:100% !important}.argus-data-grid .argus-field-block .argus-field-value{border:solid 1px rgba(48,95,114,.1254901961) !important;pointer-events:none}.argus-data-grid .argus-field-block .argus-field-input>input{border:solid 1px #305f72 !important}.argus-data-grid .id-block{color:#f18c8e !important;pointer-events:not-allowed !important}.argus-data-grid .id-block .argus-field-heading{background:rgba(241,140,142,.062745098) !important}.argus-data-grid .id-block .argus-field-value{border:solid 1px rgba(241,140,142,.062745098) !important}.argus hr{width:60%}.argus .argus-header{display:flex;text-align:center;margin-top:20px;margin-bottom:40px;justify-content:center;align-items:center;gap:10px;color:#305f72}.argus .argus-header .argus-icon{cursor:pointer}.argus .argus-header i{font-size:24px;margin-top:10px} +.sweet-alert{border-radius:0 !important}.sweet-alert .sa-button-container{padding-bottom:30px !important}.sweet-alert button{border-radius:0 !important;box-shadow:none !important}.sweet-alert button.confirm{background-color:#305f72 !important}.sweet-alert button.cancel{background-color:#f18c8e !important}.argus-filter-area{display:flex;text-align:center;justify-content:center;gap:5px;color:#305f72;flex-wrap:wrap}@media(min-width: 768px){.argus-filter-area input[type=number]{min-width:36px}}.argus-filter-area input[type=number]::-webkit-inner-spin-button,.argus-filter-area input[type=number]::-webkit-outer-spin-button{opacity:1}.argus-filter-area .selectize-dropdown{width:fit-content !important;text-align:left;border-radius:0;border:0}.argus-filter-area .shiny-input-container,.argus-filter-area .shiny-text-output{width:fit-content}.argus-filter-area .selectize-dropdown .selected{background-color:rgba(48,95,114,.1254901961);color:#305f72}.argus-filter-area .form-control,.argus-filter-area .selectize-input,.argus-filter-area .selectize-input>.item{all:unset;text-decoration:underline dotted;font-weight:500}.argus-filter-area .selectize-input::after{content:none !important}.argus-filter-area .selectize-input.focus{border:0 !important;border-radius:0 !important;box-shadow:none}.argus-filter-area .has-error,.argus-filter-area .has-error .form-control:focus{text-decoration-color:#f18c8e !important;color:#f18c8e !important;border:0 !important;box-shadow:none !important}.argus-filter-area .selector-button{border:0;background:0;padding:0;height:0}.argus-filter-area .save-button,.argus-filter-area .delete-button{border:0;background:0;margin:0;padding:0;margin-left:5px;margin-bottom:10px;font-size:14px;color:#305f72}.argus-filter-area p{color:#333}.argus-data-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}@media screen and (max-width: 1023px){.argus-data-grid{grid-template-columns:1fr}}.argus-data-grid .argus-field-block{color:#305f72}.argus-data-grid .argus-field-block .argus-field-heading{font-size:12px;background:rgba(48,95,114,.1254901961);text-align:left;padding:10px;font-weight:700;text-transform:uppercase}.argus-data-grid .argus-field-block .argus-field-input{width:100%}.argus-data-grid .argus-field-block .argus-field-input .form-control{display:unset;width:unset;height:unset;padding:unset;font-size:unset;line-height:unset;color:unset;background-color:unset;background-image:unset;border:1px solid unset;border-radius:unset;box-shadow:unset;transition:unset}.argus-data-grid .argus-field-block .argus-field-value,.argus-data-grid .argus-field-block .argus-field-input>input{font-size:24px !important;padding:10px !important;font-weight:900 !important;width:100% !important}.argus-data-grid .argus-field-block .argus-field-value{border:solid 1px rgba(48,95,114,.1254901961) !important;pointer-events:none;height:56.28px !important}.argus-data-grid .argus-field-block .argus-field-input>input{border:solid 1px #305f72 !important}.argus-data-grid .id-block{color:#f18c8e !important;pointer-events:not-allowed !important}.argus-data-grid .id-block .argus-field-heading{background:rgba(241,140,142,.062745098) !important}.argus-data-grid .id-block .argus-field-value{border:solid 1px rgba(241,140,142,.062745098) !important}.argus hr{width:60%}.argus .argus-header{display:flex;text-align:center;margin-top:20px;margin-bottom:40px;justify-content:center;align-items:center;gap:10px;color:#305f72}.argus .argus-header .argus-icon{cursor:pointer}.argus .argus-header i{font-size:24px;margin-top:10px} diff --git a/app/styles/_layout.scss b/app/styles/_layout.scss index 9a15f54..1e26342 100644 --- a/app/styles/_layout.scss +++ b/app/styles/_layout.scss @@ -52,6 +52,7 @@ .argus-field-value { border: solid 1px $primary-blue-background !important; pointer-events: none; + height: 56.28px !important; } .argus-field-input > input {