Skip to content

Commit

Permalink
Merge branch 'release/1.1.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Dec 17, 2022
2 parents 6203021 + 59b1415 commit 3297145
Show file tree
Hide file tree
Showing 13 changed files with 139 additions and 147 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}

steps:
- uses: actions/checkout@v3
Expand All @@ -22,13 +24,14 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
node-version: 18
cache: npm

- run: npm install
- run: npm run test:coverage
- run: npm run build
- uses: SonarSource/sonarcloud-github-action@master
if: env.SONARCLOUD_TOKEN != null
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
SONAR_TOKEN: ${{ env.SONARCLOUD_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
node-version: 18
cache: npm

- run: npm install
- run: npm run test:unit
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@brdgm/monumental-solo-helper",
"version": "1.1.6",
"version": "1.1.7",
"private": true,
"description": "Monumental Solo Helper",
"scripts": {
Expand All @@ -14,7 +14,7 @@
"dependencies": {
"@popperjs/core": "~2.11.6",
"bootstrap": "~5.2.3",
"brdgm-commons": "github:brdgm/brdgm-commons#1.0.5",
"brdgm-commons": "github:brdgm/brdgm-commons#1.1.0",
"core-js": "~3.26.1",
"lodash": "~4.17.21",
"register-service-worker": "~1.7.2",
Expand Down
94 changes: 42 additions & 52 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,44 @@

<AppFooter :build-number="buildNumber" :credits-label="t('footer.credits')" credits-modal-id="creditsModal" zoom-enabled @zoomFontSize="zoomFontSize"/>

<div class="modal" tabindex="-1" id="errorMessage">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="btn-close" data-bs-dismiss="modal" :aria-label="t('action.close')"></button>
</div>
<div class="modal-body">
<div class="alert alert-danger" role="alert">{{errorMessage}}</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{t('action.close')}}</button>
</div>
</div>
</div>
</div>
<ModalDialog id="errorMessage">
<template #body>
<div class="alert alert-danger" role="alert">{{errorMessage}}</div>
</template>
</ModalDialog>

<div class="modal" id="creditsModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{t('footer.credits')}}</h5>
<button class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<h4><a href="https://boardgamegeek.com/boardgame/248125/monumental" target="_blank" rel="noopener">{{t('gameTitle')}}</a></h4>
<dl>
<dt>Game design</dt>
<dd>Matthew Dunstan</dd>
<dt>Graphic design</dt>
<dd>Funforge studio</dd>
<dt>Publisher</dt>
<dd><a href="https://funforge.fr/" target="_blank" rel="noopener">Funforge</a></dd>
</dl>
<h4 class="border-top pt-3">{{appTitle}}</h4>
<dl>
<dt>Application Development</dt>
<dd>Stefan Seifert</dd>
<dt>Version</dt>
<dd>{{buildNumber}}</dd>
<dt>Source Code (Apache-2.0 License)</dt>
<dd><a href="https://github.com/brdgm/monumental-solo-helper" target="_blank" rel="noopener">https://github.com/brdgm/monumental-solo-helper</a></dd>
</dl>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" data-bs-dismiss="modal">{{t('action.close')}}</button>
</div>
</div>
</div>
</div>
<ModalDialog id="serviceWorkerUpdatedRefresh" :title="t('serviceWorkerUpdatedRefresh.title')">
<template #body>
<p v-html="t('serviceWorkerUpdatedRefresh.notice')"></p>
</template>
<template #footer>
<button class="btn btn-primary" data-bs-dismiss="modal" @click="$router.go(0)">{{t('serviceWorkerUpdatedRefresh.title')}}</button>
<button class="btn btn-secondary" data-bs-dismiss="modal">{{t('action.close')}}</button>
</template>
</ModalDialog>

<ModalDialog id="creditsModal" :title="t('footer.credits')">
<template #body>
<h4><a href="https://boardgamegeek.com/boardgame/248125/monumental" target="_blank" rel="noopener">{{t('gameTitle')}}</a></h4>
<dl>
<dt>Game design</dt>
<dd>Matthew Dunstan</dd>
<dt>Graphic design</dt>
<dd>Funforge studio</dd>
<dt>Publisher</dt>
<dd><a href="https://funforge.fr/" target="_blank" rel="noopener">Funforge</a></dd>
</dl>
<h4 class="border-top pt-3">{{appTitle}}</h4>
<dl>
<dt>Application Development</dt>
<dd>Stefan Seifert</dd>
<dt>Version</dt>
<dd>{{buildNumber}}</dd>
<dt>Source Code (Apache-2.0 License)</dt>
<dd><a href="https://github.com/brdgm/monumental-solo-helper" target="_blank" rel="noopener">https://github.com/brdgm/monumental-solo-helper</a></dd>
</dl>
</template>
</ModalDialog>

</template>

Expand All @@ -65,14 +54,16 @@ import { useI18n } from 'vue-i18n'
import { useStore } from '@/store'
import AppHeader from 'brdgm-commons/src/components/structure/AppHeader.vue'
import AppFooter from 'brdgm-commons/src/components/structure/AppFooter.vue'
import { Modal } from 'bootstrap'
import ModalDialog from 'brdgm-commons/src/components/structure/ModalDialog.vue'
import getErrorMessage from 'brdgm-commons/src/util/error/getErrorMessage'
import showModal from 'brdgm-commons/src/util/modal/showModal'
export default defineComponent({
name: 'App',
components: {
AppHeader,
AppFooter
AppFooter,
ModalDialog
},
setup() {
const { t, locale } = useI18n({
Expand Down Expand Up @@ -107,8 +98,7 @@ export default defineComponent({
},
errorCaptured(err : unknown) {
this.errorMessage = getErrorMessage(err, translErr => this.t(translErr.key, translErr.named, translErr.plural))
const modal = new Modal(document.getElementById('errorMessage') as Element)
modal.show()
showModal('errorMessage')
}
})
</script>
Expand Down
27 changes: 11 additions & 16 deletions src/components/round/ActionText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,26 @@
<span v-else v-html="t(actionTextKey)"></span>
<span v-if="action.goldCost">{{' ' + t('roundBot.goldCost', {number: action.goldCost})}}</span>

<div v-if="showActionHelp" class="modal" :id="actionHelpId" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{t(actionHelpTitleKey)}}</h5>
<button class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div v-html="t(actionHelpTextKey)"></div>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" data-bs-dismiss="modal">{{t('action.close')}}</button>
</div>
</div>
</div>
</div>
<ModalDialog v-if="showActionHelp" :id="actionHelpId" :title="t(actionHelpTitleKey)"
:size-lg="true" :scrollable="true">
<template #body>
<div v-html="t(actionHelpTextKey)"></div>
</template>
</ModalDialog>

</template>

<script lang="ts">
import BotCardAction from '@/services/BotCardAction'
import { defineComponent } from 'vue'
import { useI18n } from 'vue-i18n'
import ModalDialog from 'brdgm-commons/src/components/structure/ModalDialog.vue'
export default defineComponent({
name: 'ActionText',
components: {
ModalDialog
},
setup() {
const { t } = useI18n()
return { t }
Expand Down
52 changes: 25 additions & 27 deletions src/components/round/BotActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,35 +61,31 @@
</div>
</div>

<div class="modal" id="chooseActionModal" tabindex="-1" v-if="nextAction">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><span v-html="t('cardAction.choose-action')"></span></h5>
<button class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="container">
<div class="action row" v-for="(action,index) in nextAction.actionOptions" :key="index">
<div class="col-8">
<i><span v-html="t('chooseAction.' + currentCardName + '.' + (index+1))"></span></i><br/>
<span v-html="t('cardAction.' + action)"></span>
</div>
<div class="col-2">
<GoldEarned v-if="nextAction.mayEarnGold(action)" v-model="currentActionGoldEarned"/>
</div>
<div class="col-2">
<button type="button" class="btn btn-success" data-bs-dismiss="modal" @click="complete(nextAction!, action)">{{t('roundBot.action.choose')}}</button>
</div>
</div>
<ModalDialog v-if="nextAction" id="chooseActionModal" :size-xl="true">
<template #header>
<h5 class="modal-title"><span v-html="t('cardAction.choose-action')"></span></h5>
<button class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</template>
<template #body>
<div class="container">
<div class="action row" v-for="(action,index) in nextAction.actionOptions" :key="index">
<div class="col-8">
<i><span v-html="t('chooseAction.' + currentCardName + '.' + (index+1))"></span></i><br/>
<span v-html="t('cardAction.' + action)"></span>
</div>
<div class="col-2">
<GoldEarned v-if="nextAction.mayEarnGold(action)" v-model="currentActionGoldEarned"/>
</div>
<div class="col-2">
<button type="button" class="btn btn-success" data-bs-dismiss="modal" @click="complete(nextAction!, action)">{{t('roundBot.action.choose')}}</button>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" data-bs-dismiss="modal">{{t('action.cancel')}}</button>
</div>
</div>
</div>
</div>
</template>
<template #footer>
<button class="btn btn-secondary" data-bs-dismiss="modal">{{t('action.cancel')}}</button>
</template>
</ModalDialog>

</template>

Expand All @@ -103,6 +99,7 @@ import Bot from '@/services/Bot'
import ActionText from "./ActionText.vue"
import GoldInfo from './GoldInfo.vue'
import GoldEarned from './GoldEarned.vue'
import ModalDialog from 'brdgm-commons/src/components/structure/ModalDialog.vue'
import CivilizationName from '@/services/enum/CivilizationName'
import BotCardAction from '@/services/BotCardAction'
import NavigationState from "@/util/NavigationState"
Expand All @@ -114,7 +111,8 @@ export default defineComponent({
components: {
ActionText,
GoldInfo,
GoldEarned
GoldEarned,
ModalDialog
},
setup() {
const { t } = useI18n()
Expand Down
Loading

0 comments on commit 3297145

Please sign in to comment.