feat : buzz feedback
This commit is contained in:
@@ -144,11 +144,11 @@ jobs:
|
|||||||
migration_dir="$RUNNER_TEMP/buzz-sheet-migration-$revision_short"
|
migration_dir="$RUNNER_TEMP/buzz-sheet-migration-$revision_short"
|
||||||
migration_manifest="$RUNNER_TEMP/buzz-sheet-migration-$revision_short.yaml"
|
migration_manifest="$RUNNER_TEMP/buzz-sheet-migration-$revision_short.yaml"
|
||||||
cp -R k8s/migration "$migration_dir"
|
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#newName: .*#newName: $REGISTRY_IMAGE#" "$migration_dir/kustomization.yaml"
|
||||||
sed -i "s/newTag: .*/newTag: migrate-$REVISION/" "$migration_dir/kustomization.yaml"
|
sed -i "s/newTag: .*/newTag: migrate-$REVISION/" "$migration_dir/kustomization.yaml"
|
||||||
kubectl kustomize "$migration_dir" >"$migration_manifest"
|
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)"
|
migration_resource="$(kubectl --kubeconfig "$KUBECONFIG" --namespace "$DEPLOY_NAMESPACE" create --validate=false -f "$migration_manifest" -o name)"
|
||||||
if ! kubectl --kubeconfig "$KUBECONFIG" --namespace "$DEPLOY_NAMESPACE" wait \
|
if ! kubectl --kubeconfig "$KUBECONFIG" --namespace "$DEPLOY_NAMESPACE" wait \
|
||||||
--for=condition=complete \
|
--for=condition=complete \
|
||||||
|
|||||||
@@ -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 }) {
|
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;
|
const selected = items.find((item) => item.key === value) ?? null;
|
||||||
return (
|
return (
|
||||||
<Combobox items={items} value={selected} onValueChange={(next) => onChange(next?.key ?? "")} itemToStringLabel={(item) => item.name} itemToStringValue={(item) => item.key}>
|
<Combobox items={items} value={selected} onValueChange={(next) => onChange(next?.key ?? "")} itemToStringLabel={(item) => item.name} itemToStringValue={(item) => item.key} autoHighlight>
|
||||||
<ComboboxInput placeholder={placeholder} showClear />
|
<ComboboxInput className="w-full" placeholder={placeholder} showClear />
|
||||||
<ComboboxContent>
|
<ComboboxContent>
|
||||||
<ComboboxEmpty>ไม่พบรายการ</ComboboxEmpty>
|
<ComboboxEmpty>ไม่พบรายการ</ComboboxEmpty>
|
||||||
<ComboboxList>
|
<ComboboxList>
|
||||||
|
|||||||
@@ -6,9 +6,12 @@ describe("catalog rarity backgrounds", () => {
|
|||||||
it("maps every weapon and artifact rarity to its Tailwind gradient", () => {
|
it("maps every weapon and artifact rarity to its Tailwind gradient", () => {
|
||||||
expect(rarityGradientClass(1)).toContain("rgba(23,25,28,1)");
|
expect(rarityGradientClass(1)).toContain("rgba(23,25,28,1)");
|
||||||
expect(rarityGradientClass(2)).toContain("rgba(11,43,24,1)");
|
expect(rarityGradientClass(2)).toContain("rgba(11,43,24,1)");
|
||||||
expect(rarityGradientClass(3)).toContain("rgba(0,160,181,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)).toContain("from-[#a300b8]");
|
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)).toContain("rgba(138,90,0,1)");
|
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", () => {
|
it("uses the neutral equipment background when rarity is unavailable", () => {
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
const rarityGradientClasses: Record<number, string> = {
|
const rarityGradientClasses: Record<number, string> = {
|
||||||
1: "bg-[linear-gradient(90deg,rgba(23,25,28,1)_0%,rgba(19,20,23,1)_100%)]",
|
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%)]",
|
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%)]",
|
3: "bg-[#4D7691] bg-[linear-gradient(90deg,rgba(77,118,145,1)_0%,rgba(71,135,165,1)_100%)]",
|
||||||
4: "bg-gradient-to-r from-[#a300b8] to-black",
|
4: "bg-[#6D6A9C] bg-[linear-gradient(90deg,rgba(109,106,156,1)_0%,rgba(150,122,179,1)_100%)]",
|
||||||
5: "bg-[linear-gradient(90deg,rgba(138,90,0,1)_0%,rgba(15,8,0,1)_100%)]",
|
5: "bg-[#A67B34] bg-[linear-gradient(90deg,rgba(166,123,52,1)_0%,rgba(178,123,44,1)_100%)]",
|
||||||
};
|
};
|
||||||
|
|
||||||
const rarityGradients: Record<number, string> = {
|
const rarityGradients: Record<number, string> = {
|
||||||
1: "linear-gradient(90deg, rgba(23, 25, 28, 1) 0%, rgba(19, 20, 23, 1) 100%)",
|
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%)",
|
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%)",
|
3: "linear-gradient(90deg, rgba(77, 118, 145, 1) 0%, rgba(71, 135, 165, 1) 100%)",
|
||||||
4: "linear-gradient(90deg, rgba(163, 0, 184, 1) 0%, rgba(0, 0, 0, 1) 100%)",
|
4: "linear-gradient(90deg, rgba(109, 106, 156, 1) 0%, rgba(150, 122, 179, 1) 100%)",
|
||||||
5: "linear-gradient(90deg, rgba(138, 90, 0, 1) 0%, rgba(15, 8, 0, 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 {
|
export function rarityGradientClass(rarity: number | null | undefined): string | undefined {
|
||||||
|
|||||||
@@ -106,6 +106,14 @@ describe("production deployment contract", () => {
|
|||||||
"registry.neko-piranha.ts.net/astral/buzz-sheet",
|
"registry.neko-piranha.ts.net/astral/buzz-sheet",
|
||||||
);
|
);
|
||||||
expect(workflow).toContain("migrate-${{ gitea.sha }}");
|
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(
|
expect(workflow.indexOf("condition=complete")).toBeLessThan(
|
||||||
workflow.indexOf("set image"),
|
workflow.indexOf("set image"),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user