mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Refactor upload modal for generic storage and read-only config
- Updates Upload Modal UI labels to be provider-agnostic (e.g., 'Storage Credentials', 'Endpoint'). - Implements a read-only 'Summary View' for configured storage connections, collapsing the editable form by default. - Adds 'Manage Storage' button that navigates to the Profile Modal's storage pane. - Updates `initUploadModal.js` to inject the navigation callback. - Updates `r2Service.js` status messages to be generic. - Fixes unlock flow to ensure UI updates after storage unlock.
This commit is contained in:
1 parent
0f4775819e
commit
2b446e8ddd
5 files changed
+273
-129
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
@@ -0,0 +1,45 @@
|
||||
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
def run():
|
||||
with sync_playwright() as p:
|
||||
browser = p.chromium.launch(headless=True)
|
||||
page = browser.new_page()
|
||||
|
||||
# Load the HTML template file directly by fetching it and injecting it
|
||||
# effectively unit-testing the template structure in a browser
|
||||
page.goto("http://localhost:8080")
|
||||
|
||||
# Inject the modal HTML manually to verify the static changes
|
||||
page.evaluate("""async () => {
|
||||
const response = await fetch("/components/upload-modal.html");
|
||||
const html = await response.text();
|
||||
document.body.innerHTML = html;
|
||||
document.getElementById("uploadModal").classList.remove("hidden");
|
||||
document.getElementById("section-storage-settings").classList.remove("hidden");
|
||||
}""")
|
||||
|
||||
# Wait for rendering
|
||||
page.wait_for_selector("#uploadModal", state="visible")
|
||||
|
||||
# Check text
|
||||
button_text = page.inner_text("#btn-storage-settings")
|
||||
print(f"Button Text: {button_text}")
|
||||
|
||||
content = page.content()
|
||||
if "Storage Configuration" in button_text:
|
||||
print("Verified: Button text updated.")
|
||||
|
||||
if "Account ID / Endpoint" in content:
|
||||
print("Verified: Account label updated.")
|
||||
|
||||
if "Public URL" in content:
|
||||
print("Verified: Public URL label updated.")
|
||||
|
||||
page.screenshot(path="verification/upload_modal_static.png")
|
||||
print("Screenshot saved to verification/upload_modal_static.png")
|
||||
|
||||
browser.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
run()
|
||||
Reference in new issue
Block a user