Skip to content

Commit

Permalink
feat: fix frontend build & update screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitFicus committed Dec 11, 2024
1 parent 8b30fd0 commit 621a8ce
Show file tree
Hide file tree
Showing 84 changed files with 44 additions and 18 deletions.
4 changes: 2 additions & 2 deletions izanami-frontend/src/components/FeatureSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export function FeatureSelector(props: {
};

return creatable ? (
<CreatableSelect {...selectProps} />
<CreatableSelect {...(selectProps as any)} />
) : (
<Select {...selectProps} />
<Select {...(selectProps as any)} />
);
} else {
return <Loader message="Loading features..." />;
Expand Down
12 changes: 7 additions & 5 deletions izanami-frontend/src/pages/projectLogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ function extractSearchQueryFromUrlParams(
const logQueryKey = (
tenant: string,
project: string,
query: Omit<ProjectLogSearchQuery, "total", "pageSize">
) => {
query: Omit<Omit<ProjectLogSearchQuery, "total">, "pageSize">
): string[] => {
return [
projectLogQueryKey(tenant!, project!),
query.users.join(""),
query.types.join(""),
query.features.join(""),
query.begin,
query.end,
String(query.begin),
String(query.end),
query.order,
];
};
Expand Down Expand Up @@ -147,7 +147,9 @@ export function ProjectLogs() {
onSubmit={({ users, features, begin, end, types }) => {
totalRef.current = undefined;

queryClient.invalidateQueries(logQueryKey(tenant, project, query));
queryClient.invalidateQueries({
queryKey: logQueryKey(tenant!, project!, query),
});
navigate({
search: `?${createSearchParams({
users: users.join(","),
Expand Down
31 changes: 27 additions & 4 deletions izanami-frontend/src/utils/queries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1361,15 +1361,38 @@ export function importUsersFile(tenant: string, file: FileList): Promise<any> {
});
}

export function searchEntities(query: string): Promise<SearchResult[]> {
return handleFetchJsonResponse(fetch(`/api/admin/search?query=${query}`));
export function searchEntities(
query: string,
filter: string[] = []
): Promise<SearchResult[]> {
let filterString = "";
if (filter.length > 0) {
filterString = filter.map(encodeURIComponent).join("&filter=");
}
return handleFetchJsonResponse(
fetch(
`/api/admin/search?query=${encodeURIComponent(query)}${
filterString ? `&filter=${filterString}` : ""
}`
)
);
}

export function searchEntitiesByTenant(
tenant: string,
query: string
query: string,
filter: string[] = []
): Promise<SearchResult[]> {
let filterString = "";
if (filter.length > 0) {
filterString = filter.map(encodeURIComponent).join("&filter=");
}
return handleFetchJsonResponse(
fetch(`/api/admin/tenants/${tenant}/search?query=${query}`)
fetch(
`/api/admin/tenants/${tenant}/search?query=${encodeURIComponent(query)}${
filterString ? `&filter=${filterString}` : ""
}`
)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ export async function generate() {
await page.getByRole("link", { name: "Edit" }).click();
await page.getByRole("button", { name: "Add condition (OR)" }).click();
const secondConditionLocator = page
.locator("fieldset")
.filter({ hasText: "Activation condition #1" });
.getByRole("heading", {
name: "Activation condition #1",
})
.locator("..");
await secondConditionLocator.click();
await secondConditionLocator.getByLabel("Active only on specific").check();
await secondConditionLocator
.getByRole("combobox", { name: "Strategy to use" })
Expand Down
4 changes: 1 addition & 3 deletions izanami-frontend/tests/screenshots/non-boolean-features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ export async function generate() {

await featureAction(page, "Overloads");
await page.getByRole("button", { name: "Create new overload" }).click();
await page.getByRole("button", { name: "Delete" }).click();
await page.getByRole("button", { name: "Delete", exact: true }).click();
await page.getByRole("combobox", { name: "Context" }).click();
await page.getByText("dev", { exact: true }).click();
await page.getByLabel("Base value").fill("comments");
await screenshot("overload-form");
await page.getByRole("button", { name: "Save" }).click();
await screenshot("overload-in-project");
}

generate();
4 changes: 2 additions & 2 deletions izanami-frontend/tests/screenshots/remote-wasmo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export async function generate() {
await page.keyboard.press("Enter");
await page.keyboard.type(`return 0;`);
await screenshot("plugin-filled");
await page.getByRole("button", { name: "Save plugin" }).click();
await page.getByRole("button", { name: "Build", exact: true }).click();
await page.locator('button[tooltip="Save plugin"]').click();
await page.locator('button[tooltip="Build"]').click();
await page.waitForTimeout(2000);
await page
.getByText("[RELEASE] You can now use the")
Expand Down
Binary file modified manual/static/img/screenshots/api-keys/key-empty-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/api-keys/key-filled-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/api-keys/key-modal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/base64-wasm/active-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/base64-wasm/active-prod-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/base64-wasm/inactive-prod.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/bulk-modification/action-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/bulk-modification/final-state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/contextenv/context-creation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/contextenv/feature-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/contextenv/feature-overloads.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/contextenv/feature.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/contextenv/hover-test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/contextenv/link-generator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/contextenv/overload-creation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/contextenv/prod-inactive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/contextenv/qa-active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/export-import-v2/export-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/export-import-v2/import-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified manual/static/img/screenshots/gettingstarted/empty-landing-page.png
Binary file modified manual/static/img/screenshots/gettingstarted/feature-form.png
Binary file modified manual/static/img/screenshots/gettingstarted/feature-result.png
Binary file modified manual/static/img/screenshots/gettingstarted/first-feature.png
Binary file modified manual/static/img/screenshots/gettingstarted/first-key.png
Binary file modified manual/static/img/screenshots/gettingstarted/first-project.png
Binary file modified manual/static/img/screenshots/gettingstarted/first-tenant.png
Binary file modified manual/static/img/screenshots/gettingstarted/key-form.png
Binary file modified manual/static/img/screenshots/gettingstarted/key-screen.png
Binary file modified manual/static/img/screenshots/gettingstarted/key-secret.png
Binary file modified manual/static/img/screenshots/gettingstarted/project-form.png
Binary file modified manual/static/img/screenshots/gettingstarted/tenant-form.png
Binary file modified manual/static/img/screenshots/gettingstarted/test-form.png
Binary file modified manual/static/img/screenshots/gettingstarted/test-menu.png
Binary file modified manual/static/img/screenshots/gettingstarted/url-screen.png
Binary file modified manual/static/img/screenshots/import-v1/created-feature.png
Binary file modified manual/static/img/screenshots/import-v1/filled-form.png
Binary file modified manual/static/img/screenshots/import-v1/form-button-hover.png
Binary file modified manual/static/img/screenshots/import-v1/import-confirmed.png
Binary file modified manual/static/img/screenshots/query-builder/menu-item-hover.png
Binary file modified manual/static/img/screenshots/query-builder/test-result.png
Binary file modified manual/static/img/screenshots/remote-wasmo/mobile-active.png
Binary file modified manual/static/img/screenshots/remote-wasmo/plugin-builded.png
Binary file modified manual/static/img/screenshots/remote-wasmo/plugin-filled.png
Binary file modified manual/static/img/screenshots/remote-wasmo/prod-inactive.png
Binary file modified manual/static/img/screenshots/user-invitation/invitation-url.png
Binary file modified manual/static/img/screenshots/user-invitation/new-user-form.png
Binary file modified manual/static/img/screenshots/webhooks/webhook-form.png
Binary file modified manual/static/img/screenshots/webhooks/webhook-page.png

0 comments on commit 621a8ce

Please sign in to comment.