Skip to content

Commit

Permalink
Update the UI and github actions to put it into github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
torabian committed Jul 22, 2024
1 parent 257c471 commit 6457707
Show file tree
Hide file tree
Showing 14 changed files with 681 additions and 344 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/fireback-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,19 +296,25 @@ jobs:
path: artifacts

fireback-react:
if: ${{ inputs.target == 'fireback-react' }}
# if: ${{ inputs.target == 'fireback-react' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18

- name: Build
run: cd clients/fireback-react && npm i --force && npm run build

- name: Build the front-end
run: cd modules/workspaces/codegen/react-new && npm i --force && npm run github

- name: Deploy to GitHub Pages
if: success()
run: |
cd modules/workspaces/codegen/react-new
npm install -g gh-pages
gh-pages -d build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
vscode-extension:
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 2 additions & 1 deletion modules/workspaces/codegen/react-new/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"private": true,
"scripts": {
"start": "env-cmd -f ./src/apps/projectname/.env.local craco start",
"build": "env-cmd -f ./src/apps/projectname/.env.bundle craco build"
"build": "env-cmd -f ./src/apps/projectname/.env.bundle craco build",
"github": "env-cmd -f ./src/apps/projectname/.env.githubpages craco build"
},
"overrides": {
"react-refresh": "0.11.0"
Expand Down
242 changes: 0 additions & 242 deletions modules/workspaces/codegen/react-new/public/md/en/AppMenu.json
Original file line number Diff line number Diff line change
@@ -1,112 +1,6 @@
{
"data": {
"items": [
{
"activeMatcher": null,
"applyType": null,
"capability": null,
"capabilityId": null,
"children": [
{
"activeMatcher": "/page-category/",
"applyType": null,
"capability": null,
"capabilityId": null,
"created": 1711043161308033000,
"createdFormatted": "2024/03/21 18:46:01",
"href": "/page-categories",
"icon": "$category",
"label": "Page Categories",
"parentId": "content_management",
"uniqueId": "cms_page_categories",
"updated": 1711043161308033000,
"visibility": "A"
},
{
"activeMatcher": "/page-tag/",
"applyType": null,
"capability": null,
"capabilityId": null,
"created": 1711043161306758000,
"createdFormatted": "2024/03/21 18:46:01",
"href": "/page-tags",
"icon": "$form",
"label": "Page Tags",
"parentId": "content_management",
"uniqueId": "cms_page_tags",
"updated": 1711043161306758000,
"visibility": "A"
},
{
"activeMatcher": "/page/",
"applyType": null,
"capability": null,
"capabilityId": null,
"created": 1711043161305091000,
"createdFormatted": "2024/03/21 18:46:01",
"href": "/pages",
"icon": "$form",
"label": "Pages",
"parentId": "content_management",
"uniqueId": "cms_pages",
"updated": 1711043161305091000,
"visibility": "A"
},
{
"activeMatcher": "/post-category/",
"applyType": null,
"capability": null,
"capabilityId": null,
"created": 1711043161303091000,
"createdFormatted": "2024/03/21 18:46:01",
"href": "/post-categories",
"icon": "$category",
"label": "Post Categories",
"parentId": "content_management",
"uniqueId": "cms_post_categories",
"updated": 1711043161303091000,
"visibility": "A"
},
{
"activeMatcher": "/post-tag/",
"applyType": null,
"capability": null,
"capabilityId": null,
"created": 1711043161301749000,
"createdFormatted": "2024/03/21 18:46:01",
"href": "/post-tags",
"icon": "$form",
"label": "Post Tags",
"parentId": "content_management",
"uniqueId": "cms_post_tags",
"updated": 1711043161301749000,
"visibility": "A"
},
{
"activeMatcher": "/post/",
"applyType": null,
"capability": null,
"capabilityId": null,
"created": 1711043161300328000,
"createdFormatted": "2024/03/21 18:46:01",
"href": "/posts",
"icon": "$form",
"label": "Posts",
"parentId": "content_management",
"uniqueId": "cms_posts",
"updated": 1711043161300328000,
"visibility": "A"
}
],
"created": 1711043161298179000,
"createdFormatted": "2024/03/21 18:46:01",
"href": null,
"icon": null,
"label": "Content Management",
"uniqueId": "content_management",
"updated": 1711043161298179000,
"visibility": "A"
},
{
"activeMatcher": null,
"applyType": null,
Expand Down Expand Up @@ -333,142 +227,6 @@
"uniqueId": "personal",
"updated": 1711043161323813000,
"visibility": "A"
},
{
"activeMatcher": null,
"applyType": null,
"capability": null,
"capabilityId": null,
"children": [
{
"activeMatcher": "/product-submission/",
"applyType": null,
"capability": null,
"capabilityId": null,
"created": 1711043161333670000,
"createdFormatted": "2024/03/21 18:46:01",
"href": "/product-submissions",
"icon": "$product",
"label": "Inventory",
"parentId": "shop_products",
"uniqueId": "product_Inventory",
"updated": 1711043161333670000,
"visibility": "A"
},
{
"activeMatcher": "/brand/",
"applyType": null,
"capability": null,
"capabilityId": null,
"created": 1711043161337868000,
"createdFormatted": "2024/03/21 18:46:01",
"href": "/brands",
"icon": "$brand",
"label": "Brands",
"parentId": "shop_products",
"uniqueId": "product_brands",
"updated": 1711043161337868000,
"visibility": "A"
},
{
"activeMatcher": "/category/",
"applyType": null,
"capability": null,
"capabilityId": null,
"created": 1711043161336550000,
"createdFormatted": "2024/03/21 18:46:01",
"href": "/categories",
"icon": "$category",
"label": "Categories",
"parentId": "shop_products",
"uniqueId": "product_categories",
"updated": 1711043161336550000,
"visibility": "A"
},
{
"activeMatcher": "/discount-code/",
"applyType": null,
"capability": null,
"capabilityId": null,
"created": 1711122770045374000,
"createdFormatted": "2024/03/22 16:52:50",
"href": "/discount-codes",
"icon": "$discount",
"label": "Discount Codes",
"parentId": "shop_products",
"uniqueId": "product_discount_codes",
"updated": 1711122770045374000,
"visibility": "A"
},
{
"activeMatcher": "/product/",
"applyType": null,
"capability": null,
"capabilityId": null,
"created": 1711043161331651000,
"createdFormatted": "2024/03/21 18:46:01",
"href": "/products",
"icon": "$form",
"label": "Forms",
"parentId": "shop_products",
"uniqueId": "product_forms",
"updated": 1711043161331651000,
"visibility": "A"
},
{
"activeMatcher": "/order/",
"applyType": null,
"capability": null,
"capabilityId": null,
"created": 1711126914905572000,
"createdFormatted": "2024/03/22 18:01:54",
"href": "/orders",
"icon": "$order",
"label": "Orders",
"parentId": "shop_products",
"uniqueId": "product_orders",
"updated": 1711126914905572000,
"visibility": "A"
},
{
"activeMatcher": "/shopping-cart/",
"applyType": null,
"capability": null,
"capabilityId": null,
"created": 1711125674335021000,
"createdFormatted": "2024/03/22 17:41:14",
"href": "/shopping-carts",
"icon": "$cart",
"label": "Shopping carts",
"parentId": "shop_products",
"uniqueId": "product_shopping_carts",
"updated": 1711125674335021000,
"visibility": "A"
},
{
"activeMatcher": "/tag/",
"applyType": null,
"capability": null,
"capabilityId": null,
"created": 1711043161335172000,
"createdFormatted": "2024/03/21 18:46:01",
"href": "/tags",
"icon": "$tag",
"label": "Tags",
"parentId": "shop_products",
"uniqueId": "product_tags",
"updated": 1711043161335172000,
"visibility": "A"
}
],
"created": 1711043161330180000,
"createdFormatted": "2024/03/21 18:46:01",
"href": null,
"icon": null,
"label": "Products",
"uniqueId": "shop_products",
"updated": 1711043161330180000,
"visibility": "A"
}
],
"itemsPerPage": 9999,
Expand Down
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
];
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { Context as C, JsonQuery } from "@/modules/fireback/definitions/definitions";
import {
Context as C,
JsonQuery,
} from "@/modules/fireback/definitions/definitions";
import { enTranslations } from "../translations/en";
import { withJsonQuery } from "./withJsonQuery";
import { RemoteRequestOption } from "../definitions/JSONStyle";
Expand Down
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,
};
}
}
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,
},
};
}
}
Loading

0 comments on commit 6457707

Please sign in to comment.