Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JS functions break entire app if there's no input, fixed (#7865)
* changes * add changeset * add changeset * changes * changes * changes --------- Co-authored-by: Ali Abid <aliabid94@gmail.com> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
- Loading branch information
1 parent
e6d051d
commit 7bbc3b6
Showing
6 changed files
with
34 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@gradio/app": patch | ||
"gradio": patch | ||
--- | ||
|
||
fix:JS functions break entire app if there's no input, fixed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: theme_builder"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "\n", "demo = gr.themes.builder\n", "\n", "if __name__ == \"__main__\":\n", " demo()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} | ||
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: theme_builder"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["from gradio.themes.builder_app import demo\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import gradio as gr | ||
|
||
demo = gr.themes.builder | ||
from gradio.themes.builder_app import demo | ||
|
||
if __name__ == "__main__": | ||
demo() | ||
demo.launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { test, expect } from "@gradio/tootils"; | ||
|
||
test("test theme builder changes are applied", async ({ page }) => { | ||
await page.getByLabel("Theme", { exact: true }).click(); | ||
await page.getByLabel("Soft", { exact: true }).click(); | ||
await page.getByRole("button", { name: "Load Theme" }).click(); | ||
await page.getByRole("tab", { name: "Core Colors" }).click(); | ||
await page.getByLabel("Primary Hue").click(); | ||
await page.getByLabel("emerald").click(); | ||
|
||
const go_btn = page.getByRole("button", { name: "Go", exact: true }); | ||
await expect(go_btn).toHaveCSS( | ||
"font-family", | ||
'Montserrat, ui-sans-serif, "system-ui", sans-serif' | ||
); | ||
await expect(go_btn).toHaveCSS("background-color", "rgb(16, 185, 129)"); | ||
|
||
await page.getByRole("button", { name: "View Code ▼" }).click(); | ||
const code = page.getByLabel("Code input container"); | ||
await expect(code).toContainText("gr.themes.Soft"); | ||
await expect(code).toContainText('primary_hue="emerald"'); | ||
}); |