From 126de02ea247964d1abb22e32eec983cd1eace44 Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Mon, 5 Oct 2026 16:18:56 +0200 Subject: [PATCH] Reuse auction controls for pending bids and distinguish phase actions --- viewer/babel.config.js | 10 +- viewer/package.json | 2 +- viewer/src/components/Calculator.vue | 4 +- viewer/src/components/Game.vue | 118 ++++++++---------- .../components/boards/PowerPlantMarket.vue | 5 +- viewer/src/components/buttons/PassButton.vue | 30 ++++- viewer/src/components/buttons/UndoButton.vue | 23 +++- viewer/src/localization/da.json | 9 +- viewer/src/localization/de.json | 9 +- viewer/src/localization/el.json | 9 +- viewer/src/localization/en.json | 9 +- viewer/src/localization/fa.json | 9 +- viewer/src/localization/fr.json | 9 +- viewer/src/localization/hi.json | 9 +- viewer/src/localization/it.json | 9 +- viewer/src/localization/ko.json | 9 +- viewer/src/localization/nl.json | 9 +- viewer/src/localization/pl.json | 9 +- viewer/src/localization/pt-BR.json | 9 +- viewer/src/localization/ro.json | 9 +- viewer/src/localization/ru.json | 9 +- viewer/src/localization/vi.json | 9 +- viewer/src/localization/zh-TW.json | 9 +- viewer/tests/unit/choice-revision-ui.spec.ts | 80 ++++++++++++ viewer/vue.config.js | 9 ++ 25 files changed, 335 insertions(+), 90 deletions(-) create mode 100644 viewer/tests/unit/choice-revision-ui.spec.ts diff --git a/viewer/babel.config.js b/viewer/babel.config.js index 218963b..9b3fbbf 100644 --- a/viewer/babel.config.js +++ b/viewer/babel.config.js @@ -1,3 +1,11 @@ module.exports = { - presets: ['@vue/cli-plugin-babel/preset'], + // Webpack 4 cannot parse these forms even when modern browsers support them. + presets: [ + [ + '@vue/cli-plugin-babel/preset', + { + include: ['@babel/plugin-transform-numeric-separator', '@babel/plugin-transform-export-namespace-from'], + }, + ], + ], }; diff --git a/viewer/package.json b/viewer/package.json index d4998ee..a4cc50e 100644 --- a/viewer/package.json +++ b/viewer/package.json @@ -1,6 +1,6 @@ { "name": "powergrid-viewer", - "version": "2.3.4", + "version": "2.3.5", "repository": { "type": "git", "url": "git+https://github.com/boardgamers/powergrid.git", diff --git a/viewer/src/components/Calculator.vue b/viewer/src/components/Calculator.vue index dc4eb4e..8310e22 100644 --- a/viewer/src/components/Calculator.vue +++ b/viewer/src/components/Calculator.vue @@ -22,7 +22,7 @@ import { Vue, Component, Prop, Watch } from 'vue-property-decorator'; @Component({ created(this: Calculator) { - this.value = this.minValue; + this.value = Math.min(this.maxValue, Math.max(this.minValue, this.initialValue ?? this.minValue)); }, }) export default class Calculator extends Vue { @@ -32,6 +32,8 @@ export default class Calculator extends Vue { @Prop() maxValue; + @Prop() initialValue?: number; + value: number = 0; // The legal floor can rise while the calculator is open (e.g. a rival bid in a diff --git a/viewer/src/components/Game.vue b/viewer/src/components/Game.vue index aeba16c..7162fa1 100644 --- a/viewer/src/components/Game.vue +++ b/viewer/src/components/Game.vue @@ -4,29 +4,6 @@
{{ getStatusMessage() }}
-
- - -
0; if (!this.canMove()) return false; const currentPlayer = this.G!.players[this.player!]; @@ -3121,38 +3145,6 @@ export default class Game extends Vue { }