Use GitHub environments for deploy action

This commit is contained in:
thiloho
2024-10-26 23:12:56 +02:00
parent 668322224a
commit 9d24340867
6 changed files with 22 additions and 20 deletions

View File

@@ -39,7 +39,7 @@
</tr>
</thead>
<tbody>
{#each data.usersWithWebsites as { id, created_at, username, max_number_websites, website }}
{#each data.usersWithWebsites as { id, created_at, username, max_number_websites, website } (id)}
<tr>
<td>
<DateTime date={created_at} />
@@ -73,7 +73,7 @@
{#if website.length > 0}
<h4>Websites</h4>
{#each website as { id, title, max_storage_size }}
{#each website as { id, title, max_storage_size } (id)}
<details>
<summary>{title}</summary>
<div>

View File

@@ -56,7 +56,7 @@
</h2>
<ul class="unpadded">
{#each data.categories as { id, website_id, user_id, category_name, category_weight } (`${website_id}-${id}`)}
{#each data.categories as { id, user_id, category_name, category_weight } (id)}
<li class="category-card">
<p>
<strong>{category_name} ({category_weight})</strong>

View File

@@ -65,7 +65,7 @@
</h2>
<ul class="unpadded">
{#each data.collaborators as { website_id, user_id, permission_level, user } (`${website_id}-${user_id}`)}
{#each data.collaborators as { user_id, permission_level, user } (user_id)}
<li class="collaborator-card">
<p>
<strong>{user?.username} ({permission_level})</strong>

View File

@@ -111,7 +111,7 @@
</tr>
</thead>
<tbody>
{#each data.changeLog as { id, table_name, operation, tstamp, old_value, new_value, user_id, username }}
{#each data.changeLog as { id, table_name, operation, tstamp, old_value, new_value, user_id, username } (id)}
<tr>
<td>
<span style:text-decoration={user_id ? "" : "line-through"}>

View File

@@ -1,21 +1,25 @@
import { test } from "@playwright/test";
import { test, expect } from "@playwright/test";
import { password, authenticate, userOwner } from "./shared";
test.beforeEach(async ({ page }) => {
await authenticate(userOwner, page);
});
/* test("Delete all regular users", async ({ page }) => {
test("Delete all regular users", async ({ page }) => {
await page.getByRole("link", { name: "Manage" }).click();
await page.waitForSelector("tbody");
const userRows = await page.locator("tbody > tr").filter({ hasNotText: userOwner }).all();
const userRows = page.locator("tbody > tr").filter({ hasNotText: userOwner });
for (const row of userRows) {
await row.getByRole("button", { name: "Manage" }).click();
while ((await userRows.count()) > 0) {
const currentCount = await userRows.count();
await userRows.first().getByRole("button", { name: "Manage" }).click();
const modalName = page.url().split("#")[1];
await page.locator(`#${modalName}`).locator('summary:has-text("Delete")').click();
await page.locator(`#${modalName}`).getByRole("button", { name: "Delete user" }).click();
await expect(userRows).toHaveCount(currentCount - 1);
}
});
@@ -28,4 +32,4 @@ test("Delete admin account", async ({ page }) => {
.locator("#delete-account-modal")
.getByRole("button", { name: "Delete account" })
.click();
}); */
});