@@ -64,7 +64,8 @@ shinyServer(function(input, output, session) {
6464 project = reactiveVal(NULL ), folder = reactiveVal(" " ),
6565 schema = reactiveVal(NULL ), schema_type = reactiveVal(NULL ),
6666 master_asset_view = reactiveVal(NULL ),
67- master_asset_view_label = reactiveVal(NULL )
67+ master_asset_view_label = reactiveVal(NULL ),
68+ project_scope = reactiveVal(NULL )
6869 )
6970
7071 isUpdateFolder <- reactiveVal(FALSE )
@@ -540,6 +541,14 @@ shinyServer(function(input, output, session) {
540541 selected $ schema(data_list $ template()[input $ dropdown_template ])
541542 schema_type <- config_schema()[[1 ]]$ type [which(config_schema()[[1 ]]$ display_name == input $ dropdown_template )]
542543 selected $ schema_type(schema_type )
544+
545+ # set project scope for each template for cross-manifest validation.
546+ # If project_scope is missing from dca_template_config.json then
547+ # this value will be NULL and cross-manifest validation won't happen.
548+ # validation will occur.
549+ project_scope <- config_schema()[[1 ]]$ project_scope [which(config_schema()[[1 ]]$ display_name == input $ dropdown_template )]
550+ selected $ project_scope(project_scope )
551+
543552 # clean all tags related with selected template
544553 sapply(clean_tags , FUN = hide )
545554 }, ignoreInit = TRUE )
@@ -626,7 +635,6 @@ shinyServer(function(input, output, session) {
626635 ),
627636 {
628637 message(" Downloading offline manifest" )
629- Sys.sleep(0 )
630638 tibble(a = " b" , c = " d" )
631639 }
632640 )
@@ -724,7 +732,13 @@ shinyServer(function(input, output, session) {
724732 .infile_data <- inFile $ data()
725733 .dd_template <- input $ dropdown_template
726734 .restrict_rules <- dcc_config_react()$ schematic $ model_validate $ restrict_rules
727-
735+ .project_scope <- selected $ project_scope()
736+ .access_token <- access_token
737+ # asset view must be NULL to avoid cross-manifest validation.
738+ # doing this in a verbose way to avoid warning with ifelse
739+ .asset_view <- NULL
740+ if (! is.null(.project_scope )) .asset_view <- selected $ master_asset_view()
741+
728742 promises :: future_promise({
729743 annotation_status <- switch (dca_schematic_api ,
730744 reticulate = manifest_validate_py(
@@ -737,9 +751,11 @@ shinyServer(function(input, output, session) {
737751 schema_url = .data_model ,
738752 data_type = .schema ,
739753 file_name = .datapath ,
740- restrict_rules = .restrict_rules ),
754+ restrict_rules = .restrict_rules ,
755+ project_scope = .project_scope ,
756+ access_token = .access_token ,
757+ asset_view = .asset_view ),
741758 {
742- Sys.sleep(0 )
743759 list (list (
744760 " errors" = list (
745761 Row = NA , Column = NA , Value = NA ,
@@ -748,7 +764,7 @@ shinyServer(function(input, output, session) {
748764 ))
749765 }
750766 )
751-
767+
752768 # validation messages
753769 validationResult(annotation_status , .dd_template , .infile_data )
754770
0 commit comments