Buttons
diff --git a/templates/devtest/dropdown.tmpl b/templates/demo/dropdown.tmpl similarity index 96% rename from templates/devtest/dropdown.tmpl rename to templates/demo/dropdown.tmpl index 9df58758d4..7776a99cad 100644 --- a/templates/devtest/dropdown.tmpl +++ b/templates/demo/dropdown.tmpl @@ -1,6 +1,6 @@ {{template "base/head" .}} -
+
Dropdown
a.k.a. overflow menu, ellipsis menu diff --git a/templates/devtest/fetch-action.tmpl b/templates/demo/fetch-action.tmpl similarity index 97% rename from templates/devtest/fetch-action.tmpl rename to templates/demo/fetch-action.tmpl index be15a5389f..d31044320a 100644 --- a/templates/devtest/fetch-action.tmpl +++ b/templates/demo/fetch-action.tmpl @@ -1,5 +1,5 @@ {{template "base/head" .}} -
+
{{template "base/alert" .}}
link-action
diff --git a/templates/devtest/flex-list.tmpl b/templates/demo/flex-list.tmpl similarity index 96% rename from templates/devtest/flex-list.tmpl rename to templates/demo/flex-list.tmpl index 015ab1e154..e62c23fcc6 100644 --- a/templates/devtest/flex-list.tmpl +++ b/templates/demo/flex-list.tmpl @@ -1,6 +1,6 @@ {{template "base/head" .}} - -
+
+
Flex List (standalone)
diff --git a/templates/devtest/fomantic-modal.tmpl b/templates/demo/fomantic-modal.tmpl similarity index 98% rename from templates/devtest/fomantic-modal.tmpl rename to templates/demo/fomantic-modal.tmpl index 5b94afc4f1..4d1ba0a2c4 100644 --- a/templates/devtest/fomantic-modal.tmpl +++ b/templates/demo/fomantic-modal.tmpl @@ -1,5 +1,5 @@ {{template "base/head" .}} -
+
{{template "base/alert" .}}
diff --git a/templates/devtest/gitea-ui.tmpl b/templates/demo/gitea-ui.tmpl
similarity index 97%
rename from templates/devtest/gitea-ui.tmpl
rename to templates/demo/gitea-ui.tmpl
index 6daf6d74c7..866298a121 100644
--- a/templates/devtest/gitea-ui.tmpl
+++ b/templates/demo/gitea-ui.tmpl
@@ -1,6 +1,6 @@
{{template "base/head" .}}
-
-
+
+
Link
@@ -21,7 +21,7 @@
State:
-
+
{{template "base/footer" .}}
diff --git a/templates/devtest/hashbox.tmpl b/templates/demo/hashbox.tmpl
similarity index 97%
rename from templates/devtest/hashbox.tmpl
rename to templates/demo/hashbox.tmpl
index 7321c9956d..a74a125891 100644
--- a/templates/devtest/hashbox.tmpl
+++ b/templates/demo/hashbox.tmpl
@@ -1,6 +1,6 @@
{{template "base/head" .}}
-
-
General purpose:
@@ -65,7 +65,7 @@
+
Hashbox (shabox)
Unsigned
diff --git a/templates/devtest/label.tmpl b/templates/demo/label.tmpl similarity index 91% rename from templates/devtest/label.tmpl rename to templates/demo/label.tmpl index c4b52a3e23..1354cc85cb 100644 --- a/templates/devtest/label.tmpl +++ b/templates/demo/label.tmpl @@ -1,6 +1,6 @@ {{template "base/head" .}} - -
+
+
Label
diff --git a/templates/devtest/list.tmpl b/templates/demo/list.tmpl
similarity index 56%
rename from templates/devtest/list.tmpl
rename to templates/demo/list.tmpl
index 7325347454..80f9648ee8 100644
--- a/templates/devtest/list.tmpl
+++ b/templates/demo/list.tmpl
@@ -1,7 +1,7 @@
{{template "base/head" .}}
-
diff --git a/templates/devtest/modal.tmpl b/templates/demo/modal.tmpl
similarity index 96%
rename from templates/devtest/modal.tmpl
rename to templates/demo/modal.tmpl
index 3e79879692..746d82b229 100644
--- a/templates/devtest/modal.tmpl
+++ b/templates/demo/modal.tmpl
@@ -1,6 +1,6 @@
{{template "base/head" .}}
-Development pages
+Demo pages
Various pages that may be helpful in development or testing
@@ -9,7 +9,7 @@Components
@@ -17,9 +17,9 @@Error pages
+
Modals
diff --git a/templates/devtest/tmplerr-sub.tmpl b/templates/demo/tmplerr-sub.tmpl
similarity index 100%
rename from templates/devtest/tmplerr-sub.tmpl
rename to templates/demo/tmplerr-sub.tmpl
diff --git a/templates/devtest/tmplerr.tmpl b/templates/demo/tmplerr.tmpl
similarity index 75%
rename from templates/devtest/tmplerr.tmpl
rename to templates/demo/tmplerr.tmpl
index dd938c895e..afc3685f21 100644
--- a/templates/devtest/tmplerr.tmpl
+++ b/templates/demo/tmplerr.tmpl
@@ -1,11 +1,11 @@
{{template "base/head" .}}
-
+
diff --git a/tests/e2e/buttons.test.e2e.ts b/tests/e2e/buttons.test.e2e.ts
index 265e432d48..89dc47821e 100644
--- a/tests/e2e/buttons.test.e2e.ts
+++ b/tests/e2e/buttons.test.e2e.ts
@@ -49,7 +49,7 @@ test('Button visuals', async ({browser}) => {
const context = await browser.newContext({javaScriptEnabled: false});
const page = await context.newPage();
- const response = await page.goto('/devtest/buttons');
+ const response = await page.goto('/-/demo/buttons');
expect(response?.status()).toBe(200);
const transparent = 'rgba(0, 0, 0, 0)';
diff --git a/tests/e2e/dropdown.test.e2e.ts b/tests/e2e/dropdown.test.e2e.ts
index e90ea93d6b..b9390f360f 100644
--- a/tests/e2e/dropdown.test.e2e.ts
+++ b/tests/e2e/dropdown.test.e2e.ts
@@ -5,7 +5,7 @@
// templates/shared/user/actions_menu.tmpl
// templates/org/header.tmpl
// templates/explore/search.tmpl
-// templates/devtest/dropdown.tmpl
+// templates/demo/dropdown.tmpl
// web_src/js/modules/dropdown.ts
// @watch end
@@ -228,12 +228,12 @@ test.describe(`Visual properties`, () => {
expect(await inactiveItem.evaluate((el) => getComputedStyle(el).backgroundColor)).toBe('rgba(0, 0, 0, 0)');
});
- test('Devtest', async ({browser}) => {
+ test('Demo page', async ({browser}) => {
const context = await browser.newContext({javaScriptEnabled: false});
const page = await context.newPage();
- // `/devtest` has dropdowns with various combinations of items
- await page.goto('/devtest/dropdown');
+ // `/-/demo` has dropdowns with various combinations of items
+ await page.goto('/-/demo/dropdown');
// Dropdown with just 3 items and nothing special
await page.locator(`#dropdown-1 > summary`).click();
diff --git a/tests/e2e/modal.test.e2e.ts b/tests/e2e/modal.test.e2e.ts
index 4451b2543d..28161a2012 100644
--- a/tests/e2e/modal.test.e2e.ts
+++ b/tests/e2e/modal.test.e2e.ts
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// @watch start
-// templates/devtest/modal.tmpl
+// templates/demo/modal.tmpl
// templates/repo/editor/edit.tmpl
// templates/repo/editor/patch.tmpl
// web_src/js/features/repo-editor.js
@@ -50,7 +50,7 @@ test('Dialog modal', async ({page}) => {
test('Dialog modal: width', async ({page, isMobile}) => {
// This test doesn't need JS and runs a little faster without it
- await page.goto('/devtest/modal');
+ await page.goto('/-/demo/modal');
// Open modal with short content
const shortModal = page.locator('#short-modal');
diff --git a/tests/integration/devtest_error_test.go b/tests/integration/error_pages_test.go
similarity index 79%
rename from tests/integration/devtest_error_test.go
rename to tests/integration/error_pages_test.go
index b0148b3fd1..41c7d8e870 100644
--- a/tests/integration/devtest_error_test.go
+++ b/tests/integration/error_pages_test.go
@@ -14,11 +14,11 @@ import (
"github.com/stretchr/testify/assert"
)
-// `/devtest/error/{errcode}` provides a convenient way of testing various
+// `/-/demo/error/{errcode}` provides a convenient way of testing various
// error pages sometimes which can be hard to reach otherwise.
// This file is a test of various attributes on those pages.
-func enableDevtest() func() {
+func enableDemoPages() func() {
resetIsProd := test.MockVariableValue(&setting.IsProd, false)
resetRoutes := test.MockVariableValue(&testWebRoutes, routers.NormalRoutes())
return func() {
@@ -27,13 +27,13 @@ func enableDevtest() func() {
}
}
-func TestDevtestErrorpages(t *testing.T) {
- defer enableDevtest()()
+func TestDemoErrorPages(t *testing.T) {
+ defer enableDemoPages()()
t.Run("Server error", func(t *testing.T) {
- // `/devtest/error/x` returns 500 for any x by default.
+ // `/-/demo/error/x` returns 500 for any x by default.
// `/500` is simply for good look here
- req := NewRequest(t, "GET", "/devtest/error/500")
+ req := NewRequest(t, "GET", "/-/demo/error/500")
resp := MakeRequest(t, req, http.StatusInternalServerError)
doc := NewHTMLParser(t, resp.Body)
assert.Equal(t, "500", doc.Find(".error-code").Text())
@@ -42,7 +42,7 @@ func TestDevtestErrorpages(t *testing.T) {
t.Run("Page not found",
func(t *testing.T) {
- req := NewRequest(t, "GET", "/devtest/error/404").
+ req := NewRequest(t, "GET", "/-/demo/error/404").
// Without this header `notFoundInternal` returns plaintext error message
SetHeader("Accept", "text/html")
resp := MakeRequest(t, req, http.StatusNotFound)
@@ -53,7 +53,7 @@ func TestDevtestErrorpages(t *testing.T) {
t.Run("Quota exhaustion",
func(t *testing.T) {
- req := NewRequest(t, "GET", "/devtest/error/413")
+ req := NewRequest(t, "GET", "/-/demo/error/413")
resp := MakeRequest(t, req, http.StatusRequestEntityTooLarge)
doc := NewHTMLParser(t, resp.Body)
assert.Equal(t, "413", doc.Find(".error-code").Text())
diff --git a/tests/integration/navbar_test.go b/tests/integration/navbar_test.go
index 03e08a4314..86f4487aef 100644
--- a/tests/integration/navbar_test.go
+++ b/tests/integration/navbar_test.go
@@ -76,7 +76,7 @@ func TestNavbarItems(t *testing.T) {
defer test.MockVariableValue(&setting.IsProd, false)()
page := NewHTMLParser(t, regularUser.MakeRequest(t, NewRequest(t, "GET", testPage), http.StatusOK).Body)
- page.AssertElement(t, `details.dropdown a[href="/devtest"]`, true)
+ page.AssertElement(t, `details.dropdown a[href="/-/demo"]`, true)
testNavbarUserMenuActiveItem(t, regularUser, "/user/settings")
testNavbarUserMenuActiveItem(t, adminUser, "/admin")
@@ -95,7 +95,7 @@ func TestNavbarItems(t *testing.T) {
{`details.dropdown a[href="/notifications/subscriptions"]`, true},
{`details.dropdown a[href="/user/settings"]`, true},
{`details.dropdown a[href="/admin"]`, false},
- {`details.dropdown a[href="/devtest"]`, false},
+ {`details.dropdown a[href="/-/demo"]`, false},
{`details.dropdown a[href="https://forgejo.org/docs/latest/"]`, true},
{`details.dropdown a[data-url="/user/logout"]`, true},
}
@@ -114,7 +114,7 @@ func TestNavbarItems(t *testing.T) {
{`details.dropdown a[href="/notifications/subscriptions"]`, true},
{`details.dropdown a[href="/user/settings"]`, true},
{`details.dropdown a[href="/admin"]`, true},
- {`details.dropdown a[href="/devtest"]`, false},
+ {`details.dropdown a[href="/-/demo"]`, false},
{`details.dropdown a[href="https://forgejo.org/docs/latest/"]`, true},
{`details.dropdown a[data-url="/user/logout"]`, true},
}
diff --git a/tests/integration/signin_test.go b/tests/integration/signin_test.go
index 6db2b51aea..c9b2d6ed1c 100644
--- a/tests/integration/signin_test.go
+++ b/tests/integration/signin_test.go
@@ -171,9 +171,9 @@ func TestGlobalTwoFactorRequirement(t *testing.T) {
assert.Greater(t, htmlDoc.Find(".navbar-left > a.item").Length(), 1) // show the Logo, and other links
assert.Greater(t, htmlDoc.Find(".navbar-right details.dropdown a").Length(), 1)
- // 500 page
- reset := enableDevtest()
- req = NewRequest(t, "GET", "/devtest/error/500")
+ // demo pages are using ignSignIn and are expected to be accessible with loginAllowed
+ reset := enableDemoPages()
+ req = NewRequest(t, "GET", "/-/demo/error/500")
req.Header.Add("Accept", "text/html")
resp = session.MakeRequest(t, req, http.StatusInternalServerError)
htmlDoc = NewHTMLParser(t, resp.Body)
@@ -195,14 +195,12 @@ func TestGlobalTwoFactorRequirement(t *testing.T) {
assert.Equal(t, 1, userLinks.Length()) // only logout link
assert.Equal(t, "Sign out", strings.TrimSpace(userLinks.Text()))
- // 500 page
- reset := enableDevtest()
- req = NewRequest(t, "GET", "/devtest/error/500")
+ // demo pages are using ignSignIn and should redirect like any other pages if 2FA is required but missing
+ reset := enableDemoPages()
+ req = NewRequest(t, "GET", "/-/demo/error/500")
req.Header.Add("Accept", "text/html")
- resp = session.MakeRequest(t, req, http.StatusInternalServerError)
- htmlDoc = NewHTMLParser(t, resp.Body)
- assert.Equal(t, 1, htmlDoc.Find(".navbar-left > a.item").Length())
- htmlDoc.AssertElement(t, ".navbar-right", false)
+ resp = session.MakeRequest(t, req, http.StatusSeeOther)
+ assert.Equal(t, "/user/settings/security", resp.Header().Get("Location"))
reset()
// 2fa page
diff --git a/tests/integration/user_test.go b/tests/integration/user_test.go
index 50526ba65d..0109ab2435 100644
--- a/tests/integration/user_test.go
+++ b/tests/integration/user_test.go
@@ -117,7 +117,6 @@ func TestRenameReservedUsername(t *testing.T) {
"avatar",
"avatars",
"captcha",
- "devtest",
"explore",
"favicon.ico",
"ghost",
diff --git a/web_src/css/standalone/devtest.css b/web_src/css/standalone/demo.css
similarity index 100%
rename from web_src/css/standalone/devtest.css
rename to web_src/css/standalone/demo.css
diff --git a/web_src/js/standalone/devtest.js b/web_src/js/standalone/demo.js
similarity index 100%
rename from web_src/js/standalone/devtest.js
rename to web_src/js/standalone/demo.js
diff --git a/webpack.config.js b/webpack.config.js
index 7f5760833e..06c46dda0b 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -132,9 +132,9 @@ export default {
fileURLToPath(new URL('web_src/js/features/eventsource.sharedworker.js', import.meta.url)),
],
...(!isProduction && {
- devtest: [
- fileURLToPath(new URL('web_src/js/standalone/devtest.js', import.meta.url)),
- fileURLToPath(new URL('web_src/css/standalone/devtest.css', import.meta.url)),
+ demo: [
+ fileURLToPath(new URL('web_src/js/standalone/demo.js', import.meta.url)),
+ fileURLToPath(new URL('web_src/css/standalone/demo.css', import.meta.url)),
],
}),
...themes,
hello hello hello hello hello hello hello hello hello hello
- {{template "devtest/tmplerr-sub" .}}
+ {{template "demo/tmplerr-sub" .}}