Compare commits

..

4 Commits

7 changed files with 124 additions and 1 deletions

View File

@@ -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.0.9000 Version: 1.0.2
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

View File

@@ -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)

View File

@@ -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)
) %>% ) %>%

22
R/notification.R Normal file
View 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
)
}

View File

@@ -9,4 +9,79 @@ input[type="text"], input[type="password"], input[type="number"] {
.selectize-input input[type="text"] { .selectize-input input[type="text"] {
height: 27px !important; height: 27px !important;
}
.selectize-control .selectize-input.disabled {
cursor: not-allowed !important;
opacity: 1;
background-color: #eee;
}
.selectize-input.disabled, .selectize-input.disabled * {
cursor: not-allowed !important;
}
.table.dataTable tbody tr td.actions-col, .table.dataTable thead tr th.actions-col {
min-width: 140px;
}
.row-header {
padding-bottom: 0;
margin-bottom: 0;
margin-top: 30px;
text-decoration: underline;
}
.form-group.has-success div div.selectize-control div.selectize-input {
border-color: #00a65a;
box-shadow: none;
}
.tab-content {
border-left: 1px solid #ddd;
padding: 8px;
padding-left: 15px;
}
.noise-parameter {
display: inline-block;
width: 32%;
padding: 0px 20px 0px 0px;
}
dl.parameters {
display: grid;
grid-template-columns: max-content auto;
}
dl.parameters dt {
grid-column-start: 1;
}
dl.parameters dt::after {
content: ":";
margin-right: 10px;
}
dl.parameters dd {
grid-column-start: 2;
}
tr.deleted-row {
text-decoration: line-through;
color: #BBB;
}
hr {
color: #BBB;
}
.vr {
color: #BBB;
opacity: 1.0;
width: 2px;
}
.shiny-notification-close {
font-size: 2em !important;
} }

View File

@@ -441,6 +441,10 @@ a:focus {
text-decoration: underline; text-decoration: underline;
} }
.form-control {
font-size: 12pt;
}
.form-group.has-success label { .form-group.has-success label {
color: #008549; color: #008549;
} }

19
man/mnrNotification.Rd Normal file
View 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
}