Bug fixes:

- Fixed hover style of selected table row
- Fixed loading and saving of db actuals location
- Fixed approved checks for organsiations
- Fixed what_if name for application state
This commit is contained in:
2026-02-10 16:20:54 +00:00
parent a37e664c82
commit 0a648f92f0
5 changed files with 35 additions and 20 deletions

View File

@@ -21,18 +21,15 @@ MNR.DB.Actuals <- R6::R6Class(
geom,
date = occurrence_date
) %>%
dplyr::arrange(proposed_activity_ref, dplyr::desc(date)) %>%
dplyr::collect() %>%
dplyr::glimpse()
},
selectProposedActuals = function(refs) {
partA <- private$db_client$table("proposed_activities") %>%
dplyr::filter(is.null(deleted_at), is.null(cancelled_at)) %>%
dplyr::filter(ref %in% !!refs) %>%
dplyr::select(ref, application_id) %>%
dplyr::left_join(
private$db_client$table("applications") %>%
dplyr::select(id, location_id),
by = c(application_id = "id")
) %>%
dplyr::select(ref, application_id, location_id) %>%
dplyr::inner_join(
private$db_client$table("locations") %>%
dplyr::filter(
@@ -57,13 +54,9 @@ MNR.DB.Actuals <- R6::R6Class(
geom = geom
)
partB <- private$db_client$table("proposed_activities") %>%
dplyr::filter(is.null(deleted_at), is.null(cancelled_at)) %>%
dplyr::filter(ref %in% !!refs) %>%
dplyr::select(ref, application_id) %>%
dplyr::left_join(
private$db_client$table("applications") %>%
dplyr::select(id, location_id),
by = c(application_id = "id")
) %>%
dplyr::select(ref, application_id, location_id) %>%
dplyr::inner_join(
private$db_client$table("locations") %>%
dplyr::filter(area_type == "Shapefile"),
@@ -83,7 +76,7 @@ MNR.DB.Actuals <- R6::R6Class(
geom = tolower(
sf::st_as_binary(geom.sf, EWKB = TRUE, hex = TRUE, srid = 4326)
),
geom = set_class(geom, "pq_geometry"),
geom = magrittr::set_class(geom, "pq_geometry"),
geom.sf = NULL
) %>%
dplyr::transmute(
@@ -105,8 +98,14 @@ MNR.DB.Actuals <- R6::R6Class(
self$deleteActuals(unique(actuals.sf$ref))
refs_with_actuals <- actuals.sf %>%
tidyr::unnest(dates) %>%
dplyr::filter(!is.na(dates)) %>%
dplyr::pull(ref)
actuals <- actuals.sf %>%
tibble::as_tibble() %>%
dplyr::filter(ref %in% refs_with_actuals) %>%
dplyr::mutate(
area_type = dplyr::if_else(
sf::st_is_empty(geom), "O&G Blocks", "Coordinates"
@@ -114,6 +113,11 @@ MNR.DB.Actuals <- R6::R6Class(
geom = sf::st_as_binary(geom, EWKB = TRUE, hex = TRUE)
)
if (nrow(actuals) == 0) {
cat("## No actuals to insert\n")
return(TRUE)
}
cat("## Inserting locations for actuals\n")
location_rows <- actuals %>%
dplyr::select(area_type, geom) %>%

View File

@@ -166,7 +166,7 @@ MNR.DB.Applications <- R6::R6Class(
closed = FALSE,
cancelled = FALSE,
deleted = FALSE,
whatif = FALSE,
what_if = FALSE,
voluntary = FALSE,
consented = FALSE,
multiyear = FALSE,

View File

@@ -90,11 +90,13 @@ MNR.DB.Organisations <- R6::R6Class(
dplyr::mutate(known_as = paste(first_name, last_name)) %>%
dplyr::left_join(
private$db_client$table("organisation_members") %>%
dplyr::filter(flag_approved == TRUE) %>%
dplyr::select(user_id, organisation_id),
by = c(id = "user_id")
) %>%
dplyr::inner_join(
private$db_client$table("organisations") %>%
dplyr::filter(flag_approved == TRUE) %>%
dplyr::filter((id == !!org_id) | (name == !!org_name)) %>%
dplyr::select(id),
by = c(organisation_id = "id")
@@ -169,6 +171,7 @@ MNR.DB.Organisations <- R6::R6Class(
dplyr::filter(flag_approved == TRUE) %>%
dplyr::inner_join(
private$db_client$table("organisation_agents") %>%
dplyr::filter(flag_approved == TRUE) %>%
dplyr::filter(organisation_id %in% !!org_ids) %>%
dplyr::select(agent_id) %>%
dplyr::collapse(),
@@ -198,6 +201,7 @@ MNR.DB.Organisations <- R6::R6Class(
dplyr::filter(flag_approved == TRUE) %>%
dplyr::inner_join(
private$db_client$table("organisation_agents") %>%
dplyr::filter(flag_approved == TRUE) %>%
dplyr::filter(agent_id %in% !!org_id) %>%
dplyr::select(organisation_id) %>%
dplyr::collapse(),
@@ -227,6 +231,7 @@ MNR.DB.Organisations <- R6::R6Class(
dplyr::filter(flag_approved == TRUE) %>%
dplyr::left_join(
private$db_client$table("organisation_members") %>%
dplyr::filter(flag_approved == TRUE) %>%
dplyr::select(user_id, organisation_id),
by = c(id = "organisation_id")
) %>%

View File

@@ -1,8 +1,12 @@
div.selectize-input > div.item {
line-height: 41px;
line-height: 27px;
}
input[type="text"], input[type="password"], input[type="number"] {
font-size: 12pt !important;
height: 41px !important;
}
.selectize-input input[type="text"] {
height: 27px !important;
}

View File

@@ -85,17 +85,19 @@ h6 {
}
.table.dataTable tbody td.active,
.table.dataTable tbody tr.active td {
.table.dataTable > tbody > td.active,
.table.dataTable > tbody > tr.active td {
background-color: #3f9c35 !important;
}
table.dataTable tbody tr.selected > * {
table.dataTable > tbody > tr.selected > * {
box-shadow: inset 0 0 0 9999px #3f9c35 !important;
}
table.dataTable.hover tbody tr.selected:hover > *,
table.dataTable.display tbody tr.selected:hover > * {
table.dataTable.hover > tbody > tr.even.selected:hover > *,
table.dataTable.display > tbody > tr.even.selected:hover > *,
table.dataTable.hover > tbody > tr.odd.selected:hover > *,
table.dataTable.display > tbody > tr.odd.selected:hover > * {
box-shadow: inset 0 0 0 9999px #44a939 !important;
}