Skip to content

Commit

Permalink
v0.1.0 changes
Browse files Browse the repository at this point in the history
Merge all changes for v0.1.0 from development into master now they're on CRAN
  • Loading branch information
cjrace authored Sep 18, 2024
2 parents a033342 + 7f9f069 commit 5709fc3
Show file tree
Hide file tree
Showing 155 changed files with 12,471 additions and 3,118 deletions.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
^\.Rproj\.user$
^cran-comments\.md$
^css_changes\.md$
^_pkgdown\.yml$
^docs$
^pkgdown$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
52 changes: 52 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master, development, update-to-gds-v5.4]

name: R-CMD-check

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
50 changes: 50 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

permissions: read-all

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.Rhistory
.RData
.DS_Store
docs
38 changes: 23 additions & 15 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
Package: shinyGovstyle
Title: Custom Gov Style Inputs for Shiny
Version: 0.0.8
Authors@R: person(
given = "Ross",
family = "Wyatt",
email = "[email protected]",
role = c("aut", "cre"))
Description: Collection of 'shiny' application styling that are the based on
the GOV.UK Design System. See
<https://design-system.service.gov.uk/components/> for details.
Depends: R (>= 3.1.0)
Version: 0.1.0
Authors@R: c(
person("Ross", "Wyatt", , "[email protected]", role = c("aut", "cre")),
person("Cameron", "Race", , "[email protected]", role = "ctb"),
person("Sarah", "Wong", role = "ctb"),
person("Richard", "Bielby", , "[email protected]", role = "ctb"),
person("Charlotte", "Foster", , "[email protected]", role = "ctb"),
person("Jeni", "Martin", role = "ctb")
)
Description: Collection of 'shiny' application styling that are the based
on the GOV.UK Design System. See
<https://design-system.service.gov.uk/components/> for details.
License: GPL-3
Encoding: UTF-8
RoxygenNote: 7.1.2
URL: https://github.com/moj-analytical-services/shinyGovstyle
BugReports: https://github.com/moj-analytical-services/shinyGovstyle/issues
BugReports:
https://github.com/moj-analytical-services/shinyGovstyle/issues
Depends:
R (>= 3.1.0)
Imports:
shiny (>= 0.14),
htmltools,
jsonlite,
magrittr,
purrr,
shiny (>= 0.14),
shinyjs,
jsonlite
stringr
Suggests:
testthat
Encoding: UTF-8
RoxygenNote: 7.3.2
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Generated by roxygen2: do not edit by hand

export("%>%")
export(accordion)
export(backlink_Input)
export(banner)
export(button_Input)
export(checkbox_Input)
export(contents_link)
export(cookieBanner)
export(date_Input)
export(details)
Expand Down Expand Up @@ -41,5 +43,6 @@ export(word_count)
importFrom(htmltools,attachDependencies)
importFrom(htmltools,findDependencies)
importFrom(htmltools,htmlDependency)
importFrom(magrittr,"%>%")
importFrom(shiny,addResourcePath)
importFrom(utils,packageVersion)
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# shinyGovstyle 0.1.0

* Update the css to v5.4.0 and made fixes associated with that.
* No longer requires rem remover step to update for future changes
* One of the major changes in the css is a change in look and functionality for the accordion. Show/hide all works as expected now.
* Another major change to how the radio buttons look and feel, in line with the v5.4.0 design examples.
* Added additional functions to the `run_example` for ease of testing
* Added the contents_links() function as a helper for getting the styling and behaviour for left navigation


# shinyGovstyle 0.0.8

* Update the css to v4.0.0 and made fixes associated with that.
Expand Down
1 change: 1 addition & 0 deletions R/accordion.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ accordion <- function(inputId, titles, descriptions){
class = "govuk-accordion__show-all",
`aria-expanded` = "false",
shiny::tags$span(
id="show-all-chevron",
class=paste(
"govuk-accordion-nav__chevron",
"govuk-accordion-nav__chevron--down"),
Expand Down
12 changes: 12 additions & 0 deletions R/attachDependency.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ attachDependency <- function(tag, widget = NULL) {
)
}

else if (widget == "contents_link") {
dep <- list(
dep,
htmltools::htmlDependency(
name = "contents_link",
version = version,
src = c(href="shinyGovstyle/js"),
script = "contents_link.js"
)
)
}

}

htmltools::attachDependencies(tag, dep, append = TRUE)
Expand Down
10 changes: 5 additions & 5 deletions R/backlink_Input.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#'
#' This function adds a back link to the page
#' @param inputId The input slot that will be used to access the value.
#' @param label The link text for the backlink, default is "Back"
#' @return a backlink html shiny object
#' @keywords backlink
#' @export
Expand Down Expand Up @@ -42,13 +43,12 @@
#' shinyApp(ui = ui, server = server)
#' }

backlink_Input <- function(inputId) {
backlink_Input <- function(inputId, label = "Back") {

value <- shiny::restoreInput(id = inputId, default = NULL)
govBacklink <- shiny::tags$button("Back",
id = inputId,
class = paste0("govuk-back-link",
" action-button"),
govBacklink <- shiny::actionLink(label = label,
inputId = inputId,
class = paste0("govuk-back-link"),
`data-val` = value)
attachDependency(govBacklink)

Expand Down
2 changes: 1 addition & 1 deletion R/banner.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' secondary_text = "User Examples",
#' logo="shinyGovstyle/images/moj_logo.png"),
#' shinyGovstyle::banner(
#' inputId = "banner", type = "beta", 'This is a new service')
#' inputId = "banner", type = "Beta", 'This is a new service')
#' )
#'
#' server <- function(input, output, session) {}
Expand Down
13 changes: 13 additions & 0 deletions R/clean_heading_text.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#' Clean heading text function
#' This internal function is used in subcontents_links and heading_text to create an automated link between the two
#' @param text string
#' @return a string
#' @keywords internal
clean_heading_text <- function(text){

text %>%
stringr::str_replace_all(" ", "_") %>%
stringr::str_to_lower() %>%
stringr::str_remove_all( "[^_[a-z]]")

}
Loading

0 comments on commit 5709fc3

Please sign in to comment.