diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d48a7da..ba74612 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -144,11 +144,11 @@ jobs: migration_dir="$RUNNER_TEMP/buzz-sheet-migration-$revision_short" migration_manifest="$RUNNER_TEMP/buzz-sheet-migration-$revision_short.yaml" cp -R k8s/migration "$migration_dir" - sed -i "s/name: buzz-sheet-migrate$/name: buzz-sheet-migrate-$revision_short/" "$migration_dir/job.yaml" sed -i "s#newName: .*#newName: $REGISTRY_IMAGE#" "$migration_dir/kustomization.yaml" sed -i "s/newTag: .*/newTag: migrate-$REVISION/" "$migration_dir/kustomization.yaml" kubectl kustomize "$migration_dir" >"$migration_manifest" + kubectl --kubeconfig "$KUBECONFIG" --namespace "$DEPLOY_NAMESPACE" delete job buzz-sheet-migrate --ignore-not-found migration_resource="$(kubectl --kubeconfig "$KUBECONFIG" --namespace "$DEPLOY_NAMESPACE" create --validate=false -f "$migration_manifest" -o name)" if ! kubectl --kubeconfig "$KUBECONFIG" --namespace "$DEPLOY_NAMESPACE" wait \ --for=condition=complete \ diff --git a/components/admin/guide-section-editor.tsx b/components/admin/guide-section-editor.tsx index f8bcb43..7ffe0cd 100644 --- a/components/admin/guide-section-editor.tsx +++ b/components/admin/guide-section-editor.tsx @@ -75,8 +75,8 @@ const DEFAULT_TARGET_STATS = ["ATK", "EM", "ER", "CRIT Rate", "CRIT DMG"] as con function CatalogPicker({ items, value, onChange, placeholder, rarityBackground = false }: { items: CatalogItem[]; value: string; onChange: (value: string) => void; placeholder: string; rarityBackground?: boolean }) { const selected = items.find((item) => item.key === value) ?? null; return ( - onChange(next?.key ?? "")} itemToStringLabel={(item) => item.name} itemToStringValue={(item) => item.key}> - + onChange(next?.key ?? "")} itemToStringLabel={(item) => item.name} itemToStringValue={(item) => item.key} autoHighlight> + ไม่พบรายการ diff --git a/lib/catalog/rarity.test.ts b/lib/catalog/rarity.test.ts index 8be5fcb..f186eb1 100644 --- a/lib/catalog/rarity.test.ts +++ b/lib/catalog/rarity.test.ts @@ -6,9 +6,12 @@ describe("catalog rarity backgrounds", () => { it("maps every weapon and artifact rarity to its Tailwind gradient", () => { expect(rarityGradientClass(1)).toContain("rgba(23,25,28,1)"); expect(rarityGradientClass(2)).toContain("rgba(11,43,24,1)"); - expect(rarityGradientClass(3)).toContain("rgba(0,160,181,1)"); - expect(rarityGradientClass(4)).toContain("from-[#a300b8]"); - expect(rarityGradientClass(5)).toContain("rgba(138,90,0,1)"); + expect(rarityGradientClass(3)).toBe("bg-[#4D7691] bg-[linear-gradient(90deg,rgba(77,118,145,1)_0%,rgba(71,135,165,1)_100%)]"); + expect(rarityGradientClass(4)).toBe("bg-[#6D6A9C] bg-[linear-gradient(90deg,rgba(109,106,156,1)_0%,rgba(150,122,179,1)_100%)]"); + expect(rarityGradientClass(5)).toBe("bg-[#A67B34] bg-[linear-gradient(90deg,rgba(166,123,52,1)_0%,rgba(178,123,44,1)_100%)]"); + expect(rarityGradient(3)).toBe("linear-gradient(90deg, rgba(77, 118, 145, 1) 0%, rgba(71, 135, 165, 1) 100%)"); + expect(rarityGradient(4)).toBe("linear-gradient(90deg, rgba(109, 106, 156, 1) 0%, rgba(150, 122, 179, 1) 100%)"); + expect(rarityGradient(5)).toBe("linear-gradient(90deg, rgba(166, 123, 52, 1) 0%, rgba(178, 123, 44, 1) 100%)"); }); it("uses the neutral equipment background when rarity is unavailable", () => { diff --git a/lib/catalog/rarity.ts b/lib/catalog/rarity.ts index 8b6d026..9d42655 100644 --- a/lib/catalog/rarity.ts +++ b/lib/catalog/rarity.ts @@ -1,17 +1,17 @@ const rarityGradientClasses: Record = { 1: "bg-[linear-gradient(90deg,rgba(23,25,28,1)_0%,rgba(19,20,23,1)_100%)]", 2: "bg-[linear-gradient(90deg,rgba(11,43,24,1)_0%,rgba(7,18,13,1)_100%)]", - 3: "bg-[linear-gradient(90deg,rgba(0,160,181,1)_0%,rgba(0,0,0,1)_100%)]", - 4: "bg-gradient-to-r from-[#a300b8] to-black", - 5: "bg-[linear-gradient(90deg,rgba(138,90,0,1)_0%,rgba(15,8,0,1)_100%)]", + 3: "bg-[#4D7691] bg-[linear-gradient(90deg,rgba(77,118,145,1)_0%,rgba(71,135,165,1)_100%)]", + 4: "bg-[#6D6A9C] bg-[linear-gradient(90deg,rgba(109,106,156,1)_0%,rgba(150,122,179,1)_100%)]", + 5: "bg-[#A67B34] bg-[linear-gradient(90deg,rgba(166,123,52,1)_0%,rgba(178,123,44,1)_100%)]", }; const rarityGradients: Record = { 1: "linear-gradient(90deg, rgba(23, 25, 28, 1) 0%, rgba(19, 20, 23, 1) 100%)", 2: "linear-gradient(90deg, rgba(11, 43, 24, 1) 0%, rgba(7, 18, 13, 1) 100%)", - 3: "linear-gradient(90deg, rgba(0, 160, 181, 1) 0%, rgba(0, 0, 0, 1) 100%)", - 4: "linear-gradient(90deg, rgba(163, 0, 184, 1) 0%, rgba(0, 0, 0, 1) 100%)", - 5: "linear-gradient(90deg, rgba(138, 90, 0, 1) 0%, rgba(15, 8, 0, 1) 100%)", + 3: "linear-gradient(90deg, rgba(77, 118, 145, 1) 0%, rgba(71, 135, 165, 1) 100%)", + 4: "linear-gradient(90deg, rgba(109, 106, 156, 1) 0%, rgba(150, 122, 179, 1) 100%)", + 5: "linear-gradient(90deg, rgba(166, 123, 52, 1) 0%, rgba(178, 123, 44, 1) 100%)", }; export function rarityGradientClass(rarity: number | null | undefined): string | undefined { diff --git a/tests/deployment-contract.test.ts b/tests/deployment-contract.test.ts index 7d63a17..fde7b2d 100644 --- a/tests/deployment-contract.test.ts +++ b/tests/deployment-contract.test.ts @@ -106,6 +106,14 @@ describe("production deployment contract", () => { "registry.neko-piranha.ts.net/astral/buzz-sheet", ); expect(workflow).toContain("migrate-${{ gitea.sha }}"); + const deleteMigrationJob = workflow.indexOf( + 'delete job buzz-sheet-migrate --ignore-not-found', + ); + const createMigrationJob = workflow.indexOf( + 'create --validate=false -f "$migration_manifest"', + ); + expect(deleteMigrationJob).toBeGreaterThan(-1); + expect(deleteMigrationJob).toBeLessThan(createMigrationJob); expect(workflow.indexOf("condition=complete")).toBeLessThan( workflow.indexOf("set image"), );