Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: show layout list based on project #403

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions apps/web/src/app/[lang]/app/[type]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@ export default async function Layout({ children, params }: LayoutProps) {
const session = await auth();
const user = session?.user;

const arrayOf = ["identity"];
const arrayOf = [
"openiddict",
"admin",
"saas",
"identity",
"auditLogs",
"textTemplates",
];
const userNavigation = {
username: user?.userName ?? "undefined",
initials: user?.name?.substring(0, 2).toUpperCase(),
Expand Down Expand Up @@ -95,7 +102,7 @@ export default async function Layout({ children, params }: LayoutProps) {
params.lang,
),
type: "admin",
appType: "upwithcrowd",
appType: "admin",
icon: <Presentation className="text-slate-500 w-4" />,
}));

Expand All @@ -115,7 +122,7 @@ export default async function Layout({ children, params }: LayoutProps) {
icon: <Presentation className="text-slate-500 w-4" />,
submenu: dashboards,
type: "admin",
appType: "admin",
appType: "unirefund",
},
...dashboards,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async function Page({
true,
params.lang,
true,
params.type
params.type,
);

return (
Expand Down
12 changes: 6 additions & 6 deletions apps/web/src/app/api/company/[data]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ const clients: Clients = {

export async function GET(
request: NextRequest,
{ params }: { params: { data: string } }
{ params }: { params: { data: string } },
) {
if (!clients[params.data]) {
// return status 404
Expand All @@ -459,7 +459,7 @@ export async function GET(

export async function POST(
request: NextRequest,
{ params }: { params: { data: string } }
{ params }: { params: { data: string } },
) {
if (!clients[params.data]) {
return errorResponse("Invalid data type");
Expand All @@ -474,7 +474,7 @@ export async function POST(
const body = error.body as Volo_Abp_Http_RemoteServiceErrorResponse;
return errorResponse(
body.error?.message || "Something went wrong",
error.status
error.status,
);
}
return errorResponse("Something went wrong");
Expand All @@ -483,7 +483,7 @@ export async function POST(

export async function DELETE(
request: NextRequest,
{ params }: { params: { data: string } }
{ params }: { params: { data: string } },
) {
if (!clients[params.data]) {
return errorResponse("Invalid data type");
Expand All @@ -498,7 +498,7 @@ export async function DELETE(

export async function PUT(
request: NextRequest,
{ params }: { params: { data: string } }
{ params }: { params: { data: string } },
) {
if (!clients[params.data]) {
return errorResponse("Invalid data type");
Expand All @@ -516,7 +516,7 @@ export async function PUT(
const body = error.body as Volo_Abp_Http_RemoteServiceErrorResponse;
return errorResponse(
body.error?.message || "Something went wrong",
error.status
error.status,
);
}
return errorResponse("Something went wrong");
Expand Down
2 changes: 1 addition & 1 deletion apps/web/tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function loginAsAdmin(page: Page) {
// await page.getByRole("button", { name: "admin admin@abp.io" }).click();
// expect the previos button to be visible
await expect(
page.getByRole("button", { name: "admin admin@abp.io" })
page.getByRole("button", { name: "admin admin@abp.io" }),
).toBeVisible();
await page.waitForURL("**/");
}
Loading