Skip to content

Commit

Permalink
Merge pull request #106 from bcgov/feature/frontend-model-selection-fix
Browse files Browse the repository at this point in the history
Feature/frontend model selection fix
  • Loading branch information
vividroyjeong authored Jan 18, 2025
2 parents ade53df + aa1a97d commit 3b5c38f
Show file tree
Hide file tree
Showing 21 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/common/AppMessageDialog.stories.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/vue3'
import AppMessageDialog from '@/components/common/AppMessageDialog.vue'
import AppMessageDialog from './AppMessageDialog.vue'

const meta: Meta<typeof AppMessageDialog> = {
title: 'components/common/AppMessageDialog',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/common/AppNotification.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createPinia, setActivePinia } from 'pinia'
import { useNotificationStore } from '@/stores/common/notificationStore'
import AppNotification from '@/components/common/AppNotification.vue'
import AppNotification from './AppNotification.vue'

describe('AppNotification.vue', () => {
let notificationStore: ReturnType<typeof useNotificationStore>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/common/AppNotification.stories.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/vue3'
import { createPinia, setActivePinia } from 'pinia'
import AppNotification from '@/components/common/AppNotification.vue'
import AppNotification from '.AppNotification.vue'
import { useNotificationStore } from '@/stores/common/notificationStore'

const pinia = createPinia()
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/common/AppSpinField.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mount } from 'cypress/vue'
import { createVuetify } from 'vuetify'
import 'vuetify/styles'
import AppSpinField from '@/components/common/AppSpinField.vue'
import AppSpinField from './AppSpinField.vue'

const vuetify = createVuetify()

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/core/AppButton.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import AppButton from '@/components/core/AppButton.vue'
import AppButton from './AppButton.vue'

describe('<AppButton />', () => {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/core/AppProgressCircular.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import AppProgressCircular from '@/components/core/AppProgressCircular.vue'
import AppProgressCircular from './AppProgressCircular.vue'

describe('<AppProgressCircular />', () => {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/core/AppSnackbar.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import AppSnackbar from '@/components/core/AppSnackbar.vue'
import AppSnackbar from './AppSnackbar.vue'

describe('AppSnackbar.vue', () => {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/core/AppTabs.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from 'cypress/vue'
import AppTabs from '@/components/core/AppTabs.vue'
import AppTabs from './AppTabs.vue'
import { createVuetify } from 'vuetify'
import 'vuetify/styles'

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/core/AppTabs.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const WithInitialTab: Story = {
tabs: [
{
label: MODEL_PARAM_TAB_NAME.MODEL_PARAM_SELECTION,
component: 'ModelParameterSelection',
component: 'SpeciesInfoPanel',
tabname: null,
},
{
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/input/ReportConfiguration.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mount } from 'cypress/vue'
import { createVuetify } from 'vuetify'
import 'vuetify/styles'
import ReportConfiguration from '@/components/input/ReportConfiguration.vue'
import ReportConfiguration from './ReportConfiguration.vue'
import { CONSTANTS } from '@/constants'

describe('ReportConfiguration.vue', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mount } from 'cypress/vue'
import { createVuetify } from 'vuetify'
import 'vuetify/styles'
import SpeciesListInput from '@/components/input/species-info/SpeciesListInput.vue'
import SpeciesListInput from './SpeciesListInput.vue'

const vuetify = createVuetify()

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/layout/TheHeader.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TheHeader from '@/components/layout/TheHeader.vue'
import TheHeader from './TheHeader.vue'
import { createPinia, setActivePinia } from 'pinia'
import { createVuetify } from 'vuetify'

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/layout/UserMenu.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import UserMenu from '@/components/layout/UserMenu.vue'
import UserMenu from './UserMenu.vue'
import { createPinia, setActivePinia } from 'pinia'
import { useAuthStore } from '@/stores/common/authStore'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ModelSelection from '@/components/projection-setup/ModelSelection.vue'
import ModelSelection from './ModelSelection.vue'
import { createVuetify } from 'vuetify'
import { MODEL_SELECTION } from '@/constants/constants'

Expand Down
7 changes: 3 additions & 4 deletions frontend/src/components/projection-setup/ModelSelection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<v-col cols="3" sm="3" md="3">
<span class="search-label">Model</span>
<v-select
:items="modelSelectionOptions"
:items="OPTIONS.modelSelectionOptions"
v-model="selectedModel"
item-title="label"
item-value="value"
Expand All @@ -20,12 +20,11 @@
</template>
<script setup lang="ts">
import { ref, watch } from 'vue'
import { modelSelectionOptions } from '@/constants/options'
import { MODEL_SELECTION } from '@/constants/constants'
import { DEFAULTS, OPTIONS } from '@/constants'
const emit = defineEmits(['update:modelSelection'])
const selectedModel = ref<string>(MODEL_SELECTION.FILE_UPLOAD)
const selectedModel = ref<string>(DEFAULTS.DEFAULT_VALUES.MODEL_SELECTION)
watch(selectedModel, (newValue) => {
emit('update:modelSelection', newValue)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from 'cypress/vue'
import ModelSelectionContainer from '@/components/projection-setup/ModelSelectionContainer.vue'
import ModelSelectionContainer from './ModelSelectionContainer.vue'
import { createVuetify } from 'vuetify'
import 'vuetify/styles'
import { MODEL_SELECTION, HEADER_SELECTION } from '@/constants/constants'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TopProjectYear from '@/components/projection-setup/TopProjectYear.vue'
import TopProjectYear from './TopProjectYear.vue'

describe('TopProjectYear.vue', () => {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/reporting/ReportingContainer.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ReportingContainer from '@/components/reporting/ReportingContainer.vue'
import ReportingContainer from './ReportingContainer.vue'
import { createPinia, setActivePinia } from 'pinia'
import { useProjectionStore } from '@/stores/projectionStore'
import { REPORTING_TAB } from '@/constants/constants'
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/constants/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ export const DEFAULT_VALUES = Object.freeze({
VOLUME_REPORTED: [CONSTANTS.VOLUME_REPORTED.WHOLE_STEM],
PROJECTION_TYPE: CONSTANTS.PROJECTION_TYPE.VOLUME,
REPORT_TITLE: 'A Sample Report Title',
MODEL_SELECTION: CONSTANTS.MODEL_SELECTION.INPUT_MODEL_PARAMETERS,
MODEL_SELECTION: CONSTANTS.MODEL_SELECTION.FILE_UPLOAD,
})
4 changes: 4 additions & 0 deletions frontend/src/constants/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ export const FILE_DOWNLOAD_ERR = Object.freeze({
NO_DATA: 'No data available to download.',
})

export const MODEL_PARAM_INPUT_ERR = Object.freeze({
FAIL_RUN_MODEL: 'Failed to run the projection model.',
})

export const PRINT_ERR = Object.freeze({
NO_DATA: 'No data available to download.',
})
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/ModelParameterInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const runModelHandler = async () => {
logSuccessMessage(MESSAGE.SUCESS_MSG.INPUT_MODEL_PARAM_RUN_RESULT)
} catch (error) {
handleApiError(error, MESSAGE.FILE_UPLOAD_ERR.FAIL_RUN_MODEL)
handleApiError(error, MESSAGE.MODEL_PARAM_INPUT_ERR.FAIL_RUN_MODEL)
} finally {
isProgressVisible.value = false
}
Expand Down

0 comments on commit 3b5c38f

Please sign in to comment.