Skip to content

Commit

Permalink
PB-1080: PR fixes
Browse files Browse the repository at this point in the history
- added a counter to the feedbacks messages, telling the user how many errors / warnings there are
- removed useless logs
  • Loading branch information
ltkum committed Nov 14, 2024
1 parent 146c216 commit 6a49d74
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ const dispatcher = { dispatcher: 'App.vue' }
let debouncedOnResize
const showFeedbackPopup = computed(() => {
console.error(store.state.ui.errors)
console.error(store.state.ui.warnings)
return store.state.ui.errors.size + store.state.ui.warnings.size > 0
})
Expand Down
8 changes: 7 additions & 1 deletion src/utils/components/ErrorWindow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ const store = useStore()
const showBody = ref(true)
const hasDevSiteWarning = computed(() => store.getters.hasDevSiteWarning)
const errorCount = computed(() =>
store.state.ui.errors.size > 1 ? `(${store.state.ui.errors.size})` : ''
)
const i18n = useI18n()
const emit = defineEmits(['close'])
Expand All @@ -40,7 +44,9 @@ const emit = defineEmits(['close'])
class="card-header d-flex align-items-center justify-content-sm-end"
data-cy="window-header"
>
<span v-if="title" class="me-auto text-truncate">{{ i18n.t(title) }}</span>
<span v-if="title" class="me-auto text-truncate"
>{{ i18n.t(title) }}{{ errorCount }}</span
>
<span v-else class="me-auto" />
<button
class="btn btn-light btn-sm btn-outline-danger me-2"
Expand Down
8 changes: 7 additions & 1 deletion src/utils/components/WarningWindow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ const store = useStore()
const showBody = ref(true)
const hasDevSiteWarning = computed(() => store.getters.hasDevSiteWarning)
const warningCount = computed(() =>
store.state.ui.warnings.size > 1 ? `(${store.state.ui.warnings.size})` : ''
)
const i18n = useI18n()
const emit = defineEmits(['close'])
Expand All @@ -40,7 +44,9 @@ const emit = defineEmits(['close'])
class="card-header d-flex align-items-center justify-content-sm-end"
data-cy="window-header"
>
<span v-if="title" class="me-auto text-truncate">{{ i18n.t(title) }}</span>
<span v-if="title" class="me-auto text-truncate"
>{{ i18n.t(title) }}{{ warningCount }}</span
>
<span v-else class="me-auto" />
<button class="btn btn-sm btn-light me-2" @click.stop="showBody = !showBody">
<FontAwesomeIcon :icon="`caret-${showBody ? 'down' : 'right'}`" />
Expand Down

0 comments on commit 6a49d74

Please sign in to comment.