-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the UI and github actions to put it into github pages
- Loading branch information
Showing
14 changed files
with
681 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
modules/workspaces/codegen/react-new/src/apps/projectname/mockServer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import { AbacModuleMockProvider } from "@/modules/fireback/modules/AbacMockProvider"; | ||
|
||
// ~ auto:useMockImport | ||
|
||
import { RoleMockServer } from "@/modules/fireback/mock/api/roles"; | ||
import { SidebarMockServer } from "@/modules/fireback/mock/api/sidebar"; | ||
|
||
export const FirebackMockServer = [ | ||
new AbacModuleMockProvider(), | ||
new SidebarMockServer(), | ||
new RoleMockServer(), | ||
|
||
// ~ auto:useMocknew | ||
]; |
5 changes: 4 additions & 1 deletion
5
modules/workspaces/codegen/react-new/src/modules/fireback/hooks/mock-tools.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
modules/workspaces/codegen/react-new/src/modules/fireback/mock/api/roles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { | ||
Context, | ||
DeepPartial, | ||
method, | ||
uriMatch, | ||
} from "@/modules/fireback/hooks/mock-tools"; | ||
import { IResponse, IResponseList } from "../../sdk/core/http-tools"; | ||
import { RoleEntity } from "../../sdk/modules/workspaces/RoleEntity"; | ||
import { MockRoles } from "./../database/role.db"; | ||
|
||
export class RoleMockServer { | ||
@uriMatch("roles") | ||
@method("get") | ||
async getRoles( | ||
ctx: Context | ||
): Promise<IResponseList<DeepPartial<RoleEntity>>> { | ||
return { | ||
data: { | ||
items: MockRoles.items(), | ||
}, | ||
}; | ||
} | ||
|
||
@uriMatch("role/:uniqueId") | ||
@method("get") | ||
async getRoleByUniqueId( | ||
ctx: Context | ||
): Promise<IResponseList<DeepPartial<RoleEntity>>> { | ||
return { | ||
data: MockRoles.getOne(ctx.paramValues[0]), | ||
}; | ||
} | ||
|
||
@uriMatch("role") | ||
@method("patch") | ||
async patchRoleByUniqueId( | ||
ctx: Context | ||
): Promise<IResponseList<DeepPartial<RoleEntity>>> { | ||
return { | ||
data: MockRoles.patchOne(ctx.body), | ||
}; | ||
} | ||
|
||
@uriMatch("role") | ||
@method("post") | ||
async postRole(ctx: Context): Promise<IResponse<DeepPartial<RoleEntity>>> { | ||
const entity = MockRoles.create(ctx.body as Partial<RoleEntity>); | ||
|
||
return { | ||
data: entity, | ||
}; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
modules/workspaces/codegen/react-new/src/modules/fireback/mock/api/sidebar.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { | ||
Context, | ||
DeepPartial, | ||
method, | ||
uriMatch, | ||
} from "@/modules/fireback/hooks/mock-tools"; | ||
import { IResponseList } from "../../sdk/core/http-tools"; | ||
import { UserEntity } from "../../sdk/modules/workspaces/UserEntity"; | ||
import { AppMenuEntities } from "../database/app-menu"; | ||
|
||
export class SidebarMockServer { | ||
@uriMatch("cte-app-menus") | ||
@method("get") | ||
async getAppMenu( | ||
ctx: Context | ||
): Promise<IResponseList<DeepPartial<UserEntity>>> { | ||
return { | ||
data: { | ||
items: AppMenuEntities, | ||
}, | ||
}; | ||
} | ||
} |
Oops, something went wrong.