Compare commits
8 Commits
v1.0.1
...
f3b36c3519
| Author | SHA1 | Date | |
|---|---|---|---|
| f3b36c3519 | |||
| 81e73807ef | |||
| 766d27a508 | |||
| 3ebeea6cc7 | |||
| 7a92bdd6da | |||
| 2aaa9f03f8 | |||
| c6759959c8 | |||
| 2aa6c4d447 |
@@ -1,6 +1,6 @@
|
|||||||
Package: AVSDevR.MarineNoiseRegistry
|
Package: AVSDevR.MarineNoiseRegistry
|
||||||
Title: Marine Noise Registry Common Code Package
|
Title: Marine Noise Registry Common Code Package
|
||||||
Version: 1.0.1
|
Version: 1.1.0
|
||||||
Authors@R:
|
Authors@R:
|
||||||
person("Craig", "Williams", , "craig@avsdev.uk", role = c("aut", "cre"))
|
person("Craig", "Williams", , "craig@avsdev.uk", role = c("aut", "cre"))
|
||||||
Description: Comon code and assets for all of the Marine Noise Registry
|
Description: Comon code and assets for all of the Marine Noise Registry
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export(MNR.DB.Organisations)
|
|||||||
export(MNR.DB.Users)
|
export(MNR.DB.Users)
|
||||||
export(MNR.GeoPlot)
|
export(MNR.GeoPlot)
|
||||||
export(attachResourcePaths)
|
export(attachResourcePaths)
|
||||||
|
export(mnrNotification)
|
||||||
export(resourcePrefix)
|
export(resourcePrefix)
|
||||||
export(use_mnr_ui)
|
export(use_mnr_ui)
|
||||||
import(dplyr)
|
import(dplyr)
|
||||||
|
|||||||
@@ -278,6 +278,8 @@ MNR.DB.Applications <- R6::R6Class(
|
|||||||
)
|
)
|
||||||
# Include user what-ifs
|
# Include user what-ifs
|
||||||
| (user_match & organisation_id == -1 & state_whatif)
|
| (user_match & organisation_id == -1 & state_whatif)
|
||||||
|
# Include organisation what-ifs
|
||||||
|
| (!user_match & organisation_match & app_submitter & state_whatif)
|
||||||
# Admin override
|
# Admin override
|
||||||
| (!!flag_admin & organisation_id == -1)
|
| (!!flag_admin & organisation_id == -1)
|
||||||
) %>%
|
) %>%
|
||||||
@@ -355,7 +357,9 @@ MNR.DB.Applications <- R6::R6Class(
|
|||||||
# Work out what the closeout closeout year should be
|
# Work out what the closeout closeout year should be
|
||||||
dplyr::mutate(
|
dplyr::mutate(
|
||||||
closeout_year = as.Date(paste(
|
closeout_year = as.Date(paste(
|
||||||
lubridate::year(pmax(start_date, closed_at, na.rm = TRUE)),
|
lubridate::year(
|
||||||
|
pmax(start_date, last_closeout_at, closed_at, na.rm = TRUE)
|
||||||
|
),
|
||||||
12L,
|
12L,
|
||||||
31L,
|
31L,
|
||||||
sep = "-"
|
sep = "-"
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ MNR.GeoPlot <- R6::R6Class(
|
|||||||
family = "Roboto, \"Helvetica Neue\", Helvetica, Arial, sans-serif",
|
family = "Roboto, \"Helvetica Neue\", Helvetica, Arial, sans-serif",
|
||||||
size = 15
|
size = 15
|
||||||
),
|
),
|
||||||
mapbox = list(style = "carto-positron"),
|
mapbox = list(style = "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"),
|
||||||
legend = list(
|
legend = list(
|
||||||
groupclick = "toggleitem",
|
groupclick = "toggleitem",
|
||||||
itemdoubleclick = FALSE
|
itemdoubleclick = FALSE
|
||||||
|
|||||||
22
R/notification.R
Normal file
22
R/notification.R
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
#' Displays a shiny notification with MNR specific settings
|
||||||
|
#'
|
||||||
|
#' @inheritParams shiny::showNotification
|
||||||
|
#' @param message Character string to display in the notification
|
||||||
|
#'
|
||||||
|
#' @export
|
||||||
|
mnrNotification <- function(
|
||||||
|
message, type = "message", session = shiny::getDefaultReactiveDomain()
|
||||||
|
) {
|
||||||
|
shiny::showNotification(
|
||||||
|
message,
|
||||||
|
type = type,
|
||||||
|
duration = ifelse(
|
||||||
|
type %in% c("warning", "error"),
|
||||||
|
getOption("mnr.error_duration", 30),
|
||||||
|
getOption("mnr.notify_duration", 15)
|
||||||
|
),
|
||||||
|
closeButton = TRUE,
|
||||||
|
session = session
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -81,3 +81,36 @@ hr {
|
|||||||
opacity: 1.0;
|
opacity: 1.0;
|
||||||
width: 2px;
|
width: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.shiny-notification-close {
|
||||||
|
font-size: 2em !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dt-scroll-x {
|
||||||
|
overflow-x: auto;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
.dt-scroll-x table {
|
||||||
|
width: 150% !important;
|
||||||
|
}
|
||||||
|
.dt-sticky-left-border {
|
||||||
|
border-right: 3px double #000000;
|
||||||
|
}
|
||||||
|
.dt-sticky-right-border {
|
||||||
|
border-left: 3px double #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media(max-width:1200px) {
|
||||||
|
.dtfc-fixed-left {
|
||||||
|
position: inherit !important;
|
||||||
|
}
|
||||||
|
.dtfc-fixed-right {
|
||||||
|
position: inherit !important;
|
||||||
|
}
|
||||||
|
.dt-sticky-left-border {
|
||||||
|
border-right: 0;
|
||||||
|
}
|
||||||
|
.dt-sticky-right-border {
|
||||||
|
border-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
19
man/mnrNotification.Rd
Normal file
19
man/mnrNotification.Rd
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/notification.R
|
||||||
|
\name{mnrNotification}
|
||||||
|
\alias{mnrNotification}
|
||||||
|
\title{Displays a shiny notification with MNR specific settings}
|
||||||
|
\usage{
|
||||||
|
mnrNotification(message, type, session = shiny::getDefaultReactiveDomain())
|
||||||
|
}
|
||||||
|
\arguments{
|
||||||
|
\item{message}{Character string to display in the notification}
|
||||||
|
|
||||||
|
\item{type}{A string which controls the color of the notification. One of
|
||||||
|
"default" (gray), "message" (blue), "warning" (yellow), or "error" (red).}
|
||||||
|
|
||||||
|
\item{session}{Session object to send notification to.}
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
Displays a shiny notification with MNR specific settings
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user