Skip to content

Commit

Permalink
fix breaking api changes from shinyFeedback 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nanxstats committed Apr 30, 2020
1 parent c3ad0b5 commit 81597fa
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 142 deletions.
57 changes: 11 additions & 46 deletions server/logic-input-basic.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,23 @@
# 1. provenance

# name

observeEvent(input$provenance_name_basic, {
feedbackSuccess(
inputId = "provenance_name_basic",
condition = nchar(input$provenance_name_basic) >= 3
)
if (nchar(input$provenance_name_basic) >= 3) showFeedbackSuccess("provenance_name_basic") else hideFeedback("provenance_name_basic")
})

# version
observeEvent(input$provenance_version_basic, {
feedbackSuccess(
inputId = "provenance_version_basic",
condition = nchar(input$provenance_version_basic) > 0
)
if (nchar(input$provenance_version_basic) > 0) showFeedbackSuccess("provenance_version_basic") else hideFeedback("provenance_version_basic")
})

# derived_from
observeEvent(input$provenance_derived_from_basic, {
feedbackSuccess(
inputId = "provenance_derived_from_basic",
condition = nchar(input$provenance_derived_from_basic) > 0
)
if (nchar(input$provenance_derived_from_basic) > 0) showFeedbackSuccess("provenance_derived_from_basic") else hideFeedback("provenance_derived_from_basic")
})

# license
observeEvent(input$provenance_license_basic, {
feedbackSuccess(
inputId = "provenance_license_basic",
condition = nchar(input$provenance_license_basic) > 0
)
if (nchar(input$provenance_license_basic) > 0) showFeedbackSuccess("provenance_license_basic") else hideFeedback("provenance_license_basic")
})

# review
Expand Down Expand Up @@ -137,18 +124,12 @@ load_df_contributors_basic <- reactive(if (file.exists(contributors_fname_basic)

# fhir_endpoint
observeEvent(input$fhir_endpoint_basic, {
feedbackSuccess(
inputId = "fhir_endpoint_basic",
condition = nchar(input$fhir_endpoint_basic) >= 7
)
if (nchar(input$fhir_endpoint_basic) >= 7) showFeedbackSuccess("fhir_endpoint_basic") else hideFeedback("fhir_endpoint_basic")
})

# fhir_version
observeEvent(input$fhir_version_basic, {
feedbackSuccess(
inputId = "fhir_version_basic",
condition = nchar(input$fhir_version_basic) >= 1
)
if (nchar(input$fhir_version_basic) >= 1) showFeedbackSuccess("fhir_version_basic") else hideFeedback("fhir_version_basic")
})

# fhir_resources
Expand Down Expand Up @@ -196,18 +177,12 @@ load_df_fhir_resources_basic <- reactive(if (file.exists(fhir_resources_fname_ba

# platform
observeEvent(input$desc_platform_basic, {
feedbackSuccess(
inputId = "desc_platform_basic",
condition = nchar(input$desc_platform_basic) >= 3
)
if (nchar(input$desc_platform_basic) >= 3) showFeedbackSuccess("desc_platform_basic") else hideFeedback("desc_platform_basic")
})

# keywords
observeEvent(input$desc_keywords_basic, {
feedbackSuccess(
inputId = "desc_keywords_basic",
condition = nchar(input$desc_keywords_basic) >= 3
)
if (nchar(input$desc_keywords_basic) >= 3) showFeedbackSuccess("desc_keywords_basic") else hideFeedback("desc_keywords_basic")
})

# xref
Expand Down Expand Up @@ -457,18 +432,12 @@ load_desc_pipeline_output_basic <- reactive(if (file.exists(desc_pipeline_output

# script
observeEvent(input$execution_script_basic, {
feedbackSuccess(
inputId = "execution_script_basic",
condition = nchar(input$execution_script_basic) >= 7
)
if (nchar(input$execution_script_basic) >= 7) showFeedbackSuccess("execution_script_basic") else hideFeedback("execution_script_basic")
})

# script_driver
observeEvent(input$execution_script_driver_basic, {
feedbackSuccess(
inputId = "execution_script_driver_basic",
condition = nchar(input$execution_script_driver_basic) >= 2
)
if (nchar(input$execution_script_driver_basic) >= 2) showFeedbackSuccess("execution_script_driver_basic") else hideFeedback("execution_script_driver_basic")
})

# execution_software_prerequisites
Expand Down Expand Up @@ -831,9 +800,5 @@ load_error_algorithmic_basic <- reactive(if (file.exists(error_algorithmic_fname

# top level fields
observeEvent(input$bco_id_basic, {
feedbackSuccess(
inputId = "bco_id_basic",
condition = nchar(input$bco_id_basic) >= 7
)
if (nchar(input$bco_id_basic) >= 7) showFeedbackSuccess("bco_id_basic") else hideFeedback("bco_id_basic")
})

56 changes: 12 additions & 44 deletions server/logic-input-local.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ observeEvent(get_rawcwl_local(), {
})

observeEvent(input$provenance_name_local, {
feedbackSuccess(
inputId = "provenance_name_local",
condition = nchar(input$provenance_name_local) >= 3
)
if (nchar(input$provenance_name_local) >= 3) showFeedbackSuccess("provenance_name_local") else hideFeedback("provenance_name_local")
})

# version
Expand All @@ -20,10 +17,7 @@ observeEvent(get_rawcwl_local(), {
})

observeEvent(input$provenance_version_local, {
feedbackSuccess(
inputId = "provenance_version_local",
condition = nchar(input$provenance_version_local) >= 5
)
if (nchar(input$provenance_version_local) >= 5) showFeedbackSuccess("provenance_version_local") else hideFeedback("provenance_version_local")
})

# derived_from
Expand All @@ -32,18 +26,12 @@ observeEvent(get_rawcwl_local(), {
})

observeEvent(input$provenance_derived_from_local, {
feedbackSuccess(
inputId = "provenance_derived_from_local",
condition = nchar(input$provenance_derived_from_local) >= 0
)
if (nchar(input$provenance_derived_from_local) >= 0) showFeedbackSuccess("provenance_derived_from_local") else hideFeedback("provenance_derived_from_local")
})

# license
observeEvent(input$provenance_license_local, {
feedbackSuccess(
inputId = "provenance_license_local",
condition = nchar(input$provenance_license_local) >= 2
)
if (nchar(input$provenance_license_local) >= 2) showFeedbackSuccess("provenance_license_local") else hideFeedback("provenance_license_local")
})

# review
Expand Down Expand Up @@ -222,18 +210,12 @@ observeEvent(get_rawcwl_local(), {

# fhir_endpoint
observeEvent(input$fhir_endpoint_local, {
feedbackSuccess(
inputId = "fhir_endpoint_local",
condition = nchar(input$fhir_endpoint_local) >= 7
)
if (nchar(input$fhir_endpoint_local) >= 7) showFeedbackSuccess("fhir_endpoint_local") else hideFeedback("fhir_endpoint_local")
})

# fhir_version
observeEvent(input$fhir_version_local, {
feedbackSuccess(
inputId = "fhir_version_local",
condition = nchar(input$fhir_version_local) >= 1
)
if (nchar(input$fhir_version_local) >= 1) showFeedbackSuccess("fhir_version_local") else hideFeedback("fhir_version_local")
})

# fhir_resources
Expand Down Expand Up @@ -281,18 +263,12 @@ load_df_fhir_resources_local <- reactive(if (file.exists(fhir_resources_fname_lo

# platform
observeEvent(input$desc_platform_local, {
feedbackSuccess(
inputId = "desc_platform_local",
condition = nchar(input$desc_platform_local) >= 3
)
if (nchar(input$desc_platform_local) >= 3) showFeedbackSuccess("desc_platform_local") else hideFeedback("desc_platform_local")
})

# keywords
observeEvent(input$desc_keywords_local, {
feedbackSuccess(
inputId = "desc_keywords_local",
condition = nchar(input$desc_keywords_local) >= 3
)
if (nchar(input$desc_keywords_local) >= 3) showFeedbackSuccess("desc_keywords_local") else hideFeedback("desc_keywords_local")
})

# xref
Expand Down Expand Up @@ -538,19 +514,14 @@ load_desc_pipeline_output_local <- reactive(if (file.exists(desc_pipeline_output
observeEvent(get_rawcwl_local(), {
updateTextInput(session, "execution_script_local", value = tidycwl::parse_meta(get_rawcwl_local())$"id")
})

observeEvent(input$execution_script_local, {
feedbackSuccess(
inputId = "execution_script_local",
condition = nchar(input$execution_script_local) >= 7
)
if (nchar(input$execution_script_local) >= 7) showFeedbackSuccess("execution_script_local") else hideFeedback("execution_script_local")
})

# script_driver
observeEvent(input$execution_script_driver_local, {
feedbackSuccess(
inputId = "execution_script_driver_local",
condition = nchar(input$execution_script_driver_local) >= 2
)
if (nchar(input$execution_script_driver_local) >= 2) showFeedbackSuccess("execution_script_driver_local") else hideFeedback("execution_script_driver_local")
})

# execution_software_prerequisites
Expand Down Expand Up @@ -913,8 +884,5 @@ load_error_algo_local <- reactive(if (file.exists(error_algorithmic_fname_local)

# top level fields
observeEvent(input$bco_id_local, {
feedbackSuccess(
inputId = "bco_id_local",
condition = nchar(input$bco_id_local) >= 7
)
if (nchar(input$bco_id_local) >= 7) showFeedbackSuccess("bco_id_local") else hideFeedback("bco_id_local")
})
65 changes: 13 additions & 52 deletions server/logic-input.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ observeEvent(get_rawcwl(), {
})

observeEvent(input$provenance_name, {
feedbackSuccess(
inputId = "provenance_name",
condition = nchar(input$provenance_name) >= 3
)
if (nchar(input$provenance_name) >= 3) showFeedbackSuccess("provenance_name") else hideFeedback("provenance_name")
})

# version
Expand All @@ -20,10 +17,7 @@ observeEvent(get_rawcwl(), {
})

observeEvent(input$provenance_version, {
feedbackSuccess(
inputId = "provenance_version",
condition = nchar(input$provenance_version) >= 5
)
if (nchar(input$provenance_version) >= 5) showFeedbackSuccess("provenance_version") else hideFeedback("provenance_version")
})

# derived_from
Expand All @@ -32,18 +26,12 @@ observeEvent(get_rawcwl(), {
})

observeEvent(input$provenance_derived_from, {
feedbackSuccess(
inputId = "provenance_derived_from",
condition = nchar(input$provenance_derived_from) >= 0
)
if (nchar(input$provenance_derived_from) >= 0) showFeedbackSuccess("provenance_derived_from") else hideFeedback("provenance_derived_from")
})

# license
observeEvent(input$provenance_license, {
feedbackSuccess(
inputId = "provenance_license",
condition = nchar(input$provenance_license) >= 2
)
if (nchar(input$provenance_license) >= 2) showFeedbackSuccess("provenance_license") else hideFeedback("provenance_license")
})

# review
Expand Down Expand Up @@ -177,18 +165,12 @@ observeEvent(get_rawcwl(), {

# fhir_endpoint
observeEvent(input$fhir_endpoint, {
feedbackSuccess(
inputId = "fhir_endpoint",
condition = nchar(input$fhir_endpoint) >= 7
)
if (nchar(input$fhir_endpoint) >= 7) showFeedbackSuccess("fhir_endpoint") else hideFeedback("fhir_endpoint")
})

# fhir_version
observeEvent(input$fhir_version, {
feedbackSuccess(
inputId = "fhir_version",
condition = nchar(input$fhir_version) >= 1
)
if (nchar(input$fhir_version) >= 1) showFeedbackSuccess("fhir_version") else hideFeedback("fhir_version")
})

# fhir_resources
Expand Down Expand Up @@ -236,18 +218,12 @@ load_df_fhir_resources <- reactive(if (file.exists(fhir_resources_fname)) readRD

# platform
observeEvent(input$desc_platform, {
feedbackSuccess(
inputId = "desc_platform",
condition = nchar(input$desc_platform) >= 3
)
if (nchar(input$desc_platform) >= 3) showFeedbackSuccess("desc_platform") else hideFeedback("desc_platform")
})

# keywords
observeEvent(input$desc_keywords, {
feedbackSuccess(
inputId = "desc_keywords",
condition = nchar(input$desc_keywords) >= 3
)
if (nchar(input$desc_keywords) >= 3) showFeedbackSuccess("desc_keywords") else hideFeedback("desc_keywords")
})

# TODO: Fix that, no need to give blank row, added due to error in biocompute package
Expand Down Expand Up @@ -499,18 +475,12 @@ observeEvent(get_rawcwl(), {
})

observeEvent(input$execution_script, {
feedbackSuccess(
inputId = "execution_script",
condition = nchar(input$execution_script) >= 7
)
if (nchar(input$execution_script) >= 7) showFeedbackSuccess("execution_script") else hideFeedback("execution_script")
})

# script_driver
observeEvent(input$execution_script_driver, {
feedbackSuccess(
inputId = "execution_script_driver",
condition = nchar(input$execution_script_driver) >= 2
)
if (nchar(input$execution_script_driver) >= 2) showFeedbackSuccess("execution_script_driver") else hideFeedback("execution_script_driver")
})

# execution_software_prerequisites
Expand Down Expand Up @@ -896,10 +866,7 @@ load_error_algorithmic <- reactive(if (file.exists(error_algorithmic_fname)) rea

# top level fields
observeEvent(input$bco_id, {
feedbackSuccess(
inputId = "bco_id",
condition = nchar(input$bco_id) >= 7
)
if (nchar(input$bco_id) >= 7) showFeedbackSuccess("bco_id") else hideFeedback("bco_id")
})

# Git window
Expand All @@ -910,17 +877,11 @@ observe({
})

observeEvent(input$userName, {
feedbackSuccess(
inputId = "userName",
condition = nchar(input$userName) > 3
)
if (nchar(input$userName) > 3) showFeedbackSuccess("userName") else hideFeedback("userName")
})

observeEvent(input$passUser, {
feedbackSuccess(
inputId = "passUser",
condition = nchar(input$passUser) > 5
)
if (nchar(input$passUser) > 5) showFeedbackSuccess("passUser") else hideFeedback("passUser")
})

observeEvent(push_to_git(), {
Expand Down

0 comments on commit 81597fa

Please sign in to comment.