diff --git a/.github/workflows/cli_test.yaml b/.github/workflows/cli_test.yaml index 9b24032..dde9ac4 100644 --- a/.github/workflows/cli_test.yaml +++ b/.github/workflows/cli_test.yaml @@ -1,42 +1,42 @@ -name: Test CLI Generated Project +# name: Test CLI Generated Project -on: [push] +# on: [push] -jobs: - test: - runs-on: ubuntu-latest - services: - postgres: - image: postgres:17.4-bookworm - env: - POSTGRES_PASSWORD: postgres - POSTGRES_USER: postgres - POSTGRES_DB: postgres - ports: - - 5432 - options: >- - --health-cmd "pg_isready" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - steps: - - uses: actions/checkout@v4 - - name: Install uv - uses: astral-sh/setup-uv@v5 - - name: "Set up Python" - uses: actions/setup-python@v5 - with: - python-version-file: "pyproject.toml" - - name: Install the project - run: uv sync --all-extras --dev - - name: Generate example project - run: uv run -m fastapi_forge start --use-example --no-ui --yes - - name: Run tests - working-directory: ./game_zone - env: - GAME_ZONE_PG_HOST: localhost - GAME_ZONE_PG_PORT: ${{ job.services.postgres.ports['5432'] }} - GAME_ZONE_PG_USER: postgres - GAME_ZONE_PG_PASSWORD: postgres - GAME_ZONE_PG_DATABASE: postgres - run: uv run pytest ./tests -v -s +# jobs: +# test: +# runs-on: ubuntu-latest +# services: +# postgres: +# image: postgres:17.4-bookworm +# env: +# POSTGRES_PASSWORD: postgres +# POSTGRES_USER: postgres +# POSTGRES_DB: postgres +# ports: +# - 5432 +# options: >- +# --health-cmd "pg_isready" +# --health-interval 10s +# --health-timeout 5s +# --health-retries 5 +# steps: +# - uses: actions/checkout@v4 +# - name: Install uv +# uses: astral-sh/setup-uv@v5 +# - name: "Set up Python" +# uses: actions/setup-python@v5 +# with: +# python-version-file: "pyproject.toml" +# - name: Install the project +# run: uv sync --all-extras --dev +# - name: Generate example project +# run: uv run -m fastapi_forge start --use-example --no-ui --yes +# - name: Run tests +# working-directory: ./game_zone +# env: +# GAME_ZONE_PG_HOST: localhost +# GAME_ZONE_PG_PORT: ${{ job.services.postgres.ports['5432'] }} +# GAME_ZONE_PG_USER: postgres +# GAME_ZONE_PG_PASSWORD: postgres +# GAME_ZONE_PG_DATABASE: postgres +# run: uv run pytest ./tests -v -s diff --git a/frontend/src/assets/main.css b/frontend/src/assets/main.css index 4a1c305..89dbaa4 100644 --- a/frontend/src/assets/main.css +++ b/frontend/src/assets/main.css @@ -6,7 +6,7 @@ body { :root { --color-primary: #5294fd; --color-secondary: #dcebfe; - --color-success: #b8fd9f; + --color-success: #7fbc8c; --color-danger: #ff6b6b; --color-background: #f4f4f0; } diff --git a/frontend/src/components/StepWizard.vue b/frontend/src/components/StepWizard.vue index ed8ff5c..61b73eb 100644 --- a/frontend/src/components/StepWizard.vue +++ b/frontend/src/components/StepWizard.vue @@ -91,7 +91,7 @@ const goToStep = (index) => { } .step.completed { - background-color: #7fbc8c; + background-color: var(--color-success); } .step-content { diff --git a/frontend/src/components/modal/AddEnumValueModal.vue b/frontend/src/components/modal/AddEnumValueModal.vue new file mode 100644 index 0000000..b113fa0 --- /dev/null +++ b/frontend/src/components/modal/AddEnumValueModal.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/frontend/src/components/modal/AddFieldModal.vue b/frontend/src/components/modal/AddFieldModal.vue index e7695d7..8aea2ad 100644 --- a/frontend/src/components/modal/AddFieldModal.vue +++ b/frontend/src/components/modal/AddFieldModal.vue @@ -16,12 +16,29 @@ + + + + +
+ +
- + +
@@ -42,6 +59,7 @@ import { ref } from "vue" import { useProjectStore } from "@/stores/useProjectStore" import { useModalStore } from "@/stores/useModalStore" +import type { EnumT, FieldType } from "@/types/types" const props = defineProps<{ id: string @@ -50,6 +68,8 @@ const props = defineProps<{ const projectStore = useProjectStore() const modalStore = useModalStore() +const selectedEnum = ref() + const fieldName = ref("") const type = ref("") const defaultValue = ref("") @@ -62,12 +82,13 @@ const saveField = () => { if (!fieldName.value || !type.value) return projectStore.addField(props.id, { name: fieldName.value, - type: type.value, - default: defaultValue.value || undefined, + type: type.value as FieldType, + typeEnum: selectedEnum.value?.name, isPrimaryKey: isPrimaryKey.value, isNullable: isNullable.value, isUnique: isUnique.value, isIndex: isIndex.value, + defaultValue: defaultValue.value || undefined, }) modalStore.close() } diff --git a/frontend/src/components/modal/EditEnumValueModal.vue b/frontend/src/components/modal/EditEnumValueModal.vue new file mode 100644 index 0000000..95ceafa --- /dev/null +++ b/frontend/src/components/modal/EditEnumValueModal.vue @@ -0,0 +1,103 @@ + + + + + diff --git a/frontend/src/components/modal/EditFieldModal.vue b/frontend/src/components/modal/EditFieldModal.vue index 032b147..4001328 100644 --- a/frontend/src/components/modal/EditFieldModal.vue +++ b/frontend/src/components/modal/EditFieldModal.vue @@ -16,12 +16,29 @@ + + + + +
+ +
- + +
@@ -40,32 +57,41 @@ diff --git a/frontend/src/components/schema_editor/SchemaEditor.vue b/frontend/src/components/schema_editor/SchemaEditor.vue index ad5f522..c8f6981 100644 --- a/frontend/src/components/schema_editor/SchemaEditor.vue +++ b/frontend/src/components/schema_editor/SchemaEditor.vue @@ -37,7 +37,23 @@ v-model="modelName" @keyup.enter="handleCreateClick" /> - +
+
@@ -222,7 +238,6 @@ const openEditRelationModal = (id: string, relation: RelationalRelationField) => .create-model-btn { height: 30px; - padding: 0 12px; border: 2px solid black; border-radius: 6px; cursor: pointer; diff --git a/frontend/src/components/schema_editor/Viewport.vue b/frontend/src/components/schema_editor/Viewport.vue index 428b133..f534da0 100644 --- a/frontend/src/components/schema_editor/Viewport.vue +++ b/frontend/src/components/schema_editor/Viewport.vue @@ -32,7 +32,7 @@ import { ref } from "vue" import SchemaEditor from "@/components/schema_editor/SchemaEditor.vue" import EnumEditor from "@/components/schema_editor/EnumEditor.vue" -const activeTab = ref<"models" | "enums">("models") +const activeTab = ref<"models" | "enums">("enums")