Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a message informing about no active filters or don't return anything from the format_data_extract #1110

Closed
kpagacz opened this issue May 19, 2022 · 2 comments · Fixed by #1111
Assignees
Labels

Comments

@kpagacz
Copy link
Contributor

kpagacz commented May 19, 2022

@kpagacz

If we have filters we see this:
image

If we don't we see this:
image

Should we update the formatting function in teal.slice to say No filters or remove IRIS etc? And we can't do append_text(cat(datasets$get_formatted_filter_state()) as that outputs to console and we get an app crash as we have a NULL in append_text.

Feel free to spin out to another issue or ignore

Originally posted by @nikolas-burkoff in #635 (comment)

@donyunardi
Copy link
Contributor

Acceptance Criteria

  • To communicate clearly on the Reporter Previewer card that there is no filter applied to the snapshot/card.

@m7pr m7pr self-assigned this Feb 22, 2024
@m7pr
Copy link
Contributor

m7pr commented Feb 22, 2024

Moving this card to teal package, since TealReportCard and TealSlicesBlock exist in teal now

@m7pr m7pr transferred this issue from insightsengineering/teal.slice Feb 22, 2024
m7pr added a commit that referenced this issue Feb 26, 2024
)

Close #1110 

Tested on `teal.modules.general::tm_a_pca()` 

<details><summary> tm_a_pca code </summary>

```r
library(teal.widgets)

data <- teal_data()
data <- within(data, {
  library(nestcolor)
  USArrests <- USArrests
})
datanames(data) <- "USArrests"

app <- init(
  data = data,
  modules = modules(
    tm_a_pca(
      "PCA",
      dat = data_extract_spec(
        dataname = "USArrests",
        select = select_spec(
          choices = variable_choices(
            data = data[["USArrests"]], c("Murder", "Assault", "UrbanPop", "Rape")
          ),
          selected = c("Murder", "Assault"),
          multiple = TRUE
        ),
        filter = NULL
      ),
      ggplot2_args = ggplot2_args(
        labs = list(subtitle = "Plot generated by PCA Module")
      )
    )
  )
)

if (interactive()) {
  shinyApp(app$ui, app$server)
}
```

</details>

Now, when a report card is created, but no filters were specified, we
will have an extra text on a report card:

<img width="670" alt="image"
src="https://github.com/insightsengineering/teal/assets/133694481/dc532345-47ec-4b36-b188-164ac53e275d">


A potential change to this solution is to hide the `Filter State` header
(and it's empty content) at all.

---------

Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants