-
Notifications
You must be signed in to change notification settings - Fork 114
fix: Make outside users able to read tmp files #2070
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
Changes from 19 commits
5aaa249
cc15245
e6b8260
0fb5ccf
f4c53fd
2764cbe
03839f0
649c856
c1a11a1
ff8581e
c888903
e99f795
c1d7568
14012c8
7ffeab5
63a3c40
6609d20
b477812
30fc4f7
87afb30
8ae6460
74c931e
26fedcc
b48aea9
88a9fee
e4fea42
cee6f3e
9004f58
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| from pathlib import Path | ||
|
|
||
| from shiny import App, Inputs, Outputs, Session, ui | ||
|
|
||
| js_file = Path(__file__).parent / "js" / "customjs.js" | ||
| css_file = Path(__file__).parent / "css" / "style.css" | ||
|
|
||
| # Define the UI | ||
| app_ui = ui.page_fluid( | ||
| ui.include_css(css_file, method="link_files"), | ||
| ui.include_js(js_file, method="link_files"), | ||
| ui.h1("Simple Shiny App with External CSS"), | ||
| ui.div( | ||
| ui.p("This is a simple Shiny app that demonstrates ui.include_css()"), | ||
| ui.p("The styling comes from an external CSS file!"), | ||
| class_="content", | ||
| ), | ||
| ) | ||
|
|
||
|
|
||
| # Define the server | ||
| def server(input: Inputs, output: Outputs, session: Session): | ||
| pass | ||
|
|
||
|
|
||
| # Create and run the app | ||
| app = App(app_ui, server) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| body { | ||
| background-color: #c8e1f7; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| @import url("./evenmorecss/more.css"); | ||
|
|
||
| body { | ||
| font-family: Arial, sans-serif; | ||
| } | ||
|
|
||
| h1 { | ||
| color: black; | ||
| border-bottom: 2px solid #4682b4; | ||
| padding-bottom: 10px; | ||
| } | ||
|
|
||
| .content { | ||
| margin: 20px; | ||
| padding: 15px; | ||
| background-color: white; | ||
| border-radius: 5px; | ||
| box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| const newParagraph = document.createElement('p'); | ||
| newParagraph.textContent = 'Heyo!'; | ||
| const bodyElement = document.body; | ||
| bodyElement.appendChild(newParagraph); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from playwright.sync_api import Page, expect | ||
|
|
||
| from shiny.run import ShinyAppProc | ||
|
|
||
|
|
||
| def test_inclusion(page: Page, local_app: ShinyAppProc) -> None: | ||
| page.goto(local_app.url) | ||
|
|
||
| expect(page.locator("body > p")).to_have_text("Heyo!") |
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test is for the other PR, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh nvm, I think I see why we're adding the test -- it's not that we're directly testing this fix, it's more about adding coverage that should've already existed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, because we're altering how we include files, I want to have a test for both "link_files" and "link" versions |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| from pathlib import Path | ||
|
|
||
| from shiny import App, Inputs, Outputs, Session, ui | ||
|
|
||
| js_file = Path(__file__).parent / "customjs.js" | ||
| css_file = Path(__file__).parent / "style.css" | ||
|
|
||
| # Define the UI | ||
| app_ui = ui.page_fluid( | ||
| ui.include_css(css_file, method="link"), | ||
| ui.include_js(js_file, method="link"), | ||
| ui.h1("Simple Shiny App with External CSS"), | ||
| ui.div( | ||
| ui.p("This is a simple Shiny app that demonstrates ui.include_css()"), | ||
| ui.p("The styling comes from an external CSS file!"), | ||
| class_="content", | ||
| ), | ||
| ) | ||
|
|
||
|
|
||
| # Define the server | ||
| def server(input: Inputs, output: Outputs, session: Session): | ||
| pass | ||
|
|
||
|
|
||
| # Create and run the app | ||
| app = App(app_ui, server) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| const newParagraph = document.createElement('p'); | ||
| newParagraph.textContent = 'Heyo!'; | ||
| const bodyElement = document.body; | ||
| bodyElement.appendChild(newParagraph); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| body { | ||
| background-color: #70bfef; | ||
| font-family: Arial, sans-serif; | ||
| } | ||
|
|
||
| h1 { | ||
| color: black; | ||
| border-bottom: 2px solid #4682b4; | ||
| padding-bottom: 10px; | ||
| } | ||
|
|
||
| .content { | ||
| margin: 20px; | ||
| padding: 15px; | ||
| background-color: white; | ||
| border-radius: 5px; | ||
| box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from playwright.sync_api import Page, expect | ||
|
|
||
| from shiny.run import ShinyAppProc | ||
|
|
||
|
|
||
| def test_inclusion(page: Page, local_app: ShinyAppProc) -> None: | ||
| page.goto(local_app.url) | ||
|
|
||
| expect(page.locator("body > p")).to_have_text("Heyo!") |
Uh oh!
There was an error while loading. Please reload this page.