Skip to content

Commit

Permalink
Merge pull request #94 from bcgov/feature/frontend
Browse files Browse the repository at this point in the history
Implement Reporting Tabs and their Storybook
  • Loading branch information
vividroyjeong authored Dec 23, 2024
2 parents c206e36 + e81d5ff commit 4e17cbd
Show file tree
Hide file tree
Showing 40 changed files with 1,399 additions and 1,585 deletions.
10 changes: 2 additions & 8 deletions frontend/.storybook/StoryWrapper.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
<template>
<v-app :theme="themeName">
<v-app>
<v-main>
<slot name="story"></slot>
</v-main>
</v-app>
</template>

<script>
export default {
props: {
themeName: String,
},
}
</script>
<script></script>
39 changes: 6 additions & 33 deletions frontend/.storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ import type { Preview } from '@storybook/vue3'
import { setup } from '@storybook/vue3'
import { registerPlugins } from '../src/plugins'
import { withVuetifyTheme } from './withVeutifyTheme.decorator'
import type { App } from 'vue'
import '@bcgov/bc-sans/css/BCSans.css'
import '../src/styles/style.scss'

setup((app) => {
registerPlugins(app)
})

export const decorators = [withVuetifyTheme]

const preview: Preview = {
parameters: {
controls: {
Expand All @@ -15,37 +19,6 @@ const preview: Preview = {
},
},
},
// Add global theme types
globalTypes: {
theme: {
name: 'Theme',
description: 'Global theme for components',
toolbar: {
icon: 'paintbrush',
items: [
{ value: 'light', title: 'Light', left: '🌞' },
{ value: 'dark', title: 'Dark', left: '🌛' },
],
dynamicTitle: true,
},
},
},
decorators: [
withVuetifyTheme,
(story) => ({
components: { story },
template: `
<div style="font-family: 'BCSans', 'Noto Sans', Verdana, Arial, sans-serif;">
<story />
</div>
`,
}),
],
}

export default preview

// Setup function to register plugins
setup((app: App) => {
registerPlugins(app)
})
5 changes: 1 addition & 4 deletions frontend/.storybook/withVeutifyTheme.decorator.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import { h } from 'vue'
import StoryWrapper from './StoryWrapper.vue'

export const DEFAULT_THEME = 'light'

export const withVuetifyTheme = (storyFn, context) => {
const themeName = context.globals.theme || DEFAULT_THEME
const story = storyFn()

return () => {
return h(
StoryWrapper,
{ themeName },
{},
{
story: () => h(story, { ...context.args }),
},
Expand Down
50 changes: 13 additions & 37 deletions frontend/package-lock.json

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

21 changes: 10 additions & 11 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"@tsconfig/node20": "20.1.4",
"@vitejs/plugin-vue": "5.0.5",
"@vue/tsconfig": "0.5.1",
"@vuepic/vue-datepicker": "8.8.0",
"axios": "1.7.7",
"file-saver": "2.0.5",
"http-status-codes": "2.3.0",
Expand All @@ -41,25 +40,25 @@
"vuetify": "3.6.14"
},
"devDependencies": {
"@chromatic-com/storybook": "^3.2.2",
"@chromatic-com/storybook": "3.2.2",
"@rushstack/eslint-patch": "1.8.0",
"@storybook/addon-essentials": "^8.4.7",
"@storybook/addon-interactions": "^8.4.7",
"@storybook/addon-onboarding": "^8.4.7",
"@storybook/blocks": "^8.4.7",
"@storybook/test": "^8.4.7",
"@storybook/vue3": "^8.4.7",
"@storybook/vue3-vite": "^8.4.7",
"@storybook/addon-essentials": "8.4.7",
"@storybook/addon-interactions": "8.4.7",
"@storybook/addon-onboarding": "8.4.7",
"@storybook/blocks": "8.4.7",
"@storybook/test": "8.4.7",
"@storybook/vue3": "8.4.7",
"@storybook/vue3-vite": "8.4.7",
"@types/node": "20.14.5",
"@vue/eslint-config-prettier": "9.0.0",
"@vue/eslint-config-typescript": "13.0.0",
"eslint": "8.57.0",
"eslint-plugin-storybook": "^0.11.1",
"eslint-plugin-storybook": "0.11.1",
"npm-run-all2": "6.2.0",
"prettier": "3.3.3",
"sass": "1.77.6",
"sass-loader": "14.2.1",
"storybook": "^8.4.7",
"storybook": "8.4.7",
"typescript": "5.6.3",
"vite": "5.4.8",
"vite-plugin-vuetify": "2.0.3",
Expand Down
29 changes: 29 additions & 0 deletions frontend/public/test-data/ErrorLog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
- I SUCCESS - Substitution of Supplied BA/TPH as Projected values has been disabled.
092H014 0 0 600 (Rcrd ID: 2493719 ) 1 - I INVALIDSITEINFO - Height 0.0 at Projection Year 1876 is too short to generate yields for species 'FDC'
092H014 0 0 600 (Rcrd ID: 2493719 ) 1 - I SPECIESNOTFOUND - Projected data for species 'FDC' was not generated at stand age 0.0 (Calendar Year: 1876)
092H014 0 0 600 (Rcrd ID: 2493719 ) 1 - I INVALIDSITEINFO - Height 0.0 at Projection Year 1876 is too short to generate yields for species 'PLI'
092H073 0 0 2185 (Rcrd ID: 2558002 ) 1 - I SUCCESS - Directly assigning Estimated SI of 20.00 to Species 'BA' and recomputing input height.
092H073 0 0 2185 (Rcrd ID: 2558002 ) 1 - I SUCCESS - Assigning converted Estimated SI of 20.00 to Species 'HW' and recomputing input height.
092H073 0 0 2185 (Rcrd ID: 2558002 ) 1 - I SUCCESS - Based on Estimated SI of 20.00, recomputed input height for species 'BA' at reference age 20.0 to be 4.93m
092H073 0 0 2185 (Rcrd ID: 2558002 ) 1 - I SUCCESS - Based on Estimated SI of 22.28, recomputed input height for species 'HW' at reference age 20.0 to be 7.01m
092H073 0 0 2185 (Rcrd ID: 2558002 ) 1 - I INVALIDSITEINFO - Height 0.0 at Projection Year 1976 is too short to generate yields for species 'BA'
092H073 0 0 2185 (Rcrd ID: 2558002 ) 1 - I SPECIESNOTFOUND - Projected data for species 'BA' was not generated at stand age 0.0 (Calendar Year: 1976)
092H073 0 0 2185 (Rcrd ID: 2558002 ) 1 - I INVALIDSITEINFO - Height 0.0 at Projection Year 1976 is too short to generate yields for species 'HW'
092H025 0 0 388 (Rcrd ID: 6212668 ) 1 - I INVALIDSITEINFO - Height 0.0 at Projection Year 1876 is too short to generate yields for species 'FDC'
092H025 0 0 388 (Rcrd ID: 6212668 ) 1 - I SPECIESNOTFOUND - Projected data for species 'FDC' was not generated at stand age 0.0 (Calendar Year: 1876)
092H025 0 0 388 (Rcrd ID: 6212668 ) 1 - I INVALIDSITEINFO - Height 0.0 at Projection Year 1876 is too short to generate yields for species 'HW'
092G089 0 0 51042508 (Rcrd ID: 8489172 ) 1 - I INVALIDSITEINFO - Height 0.0 at Projection Year 1755 is too short to generate yields for species 'FDC'
092G089 0 0 51042508 (Rcrd ID: 8489172 ) 1 - I SPECIESNOTFOUND - Projected data for species 'FDC' was not generated at stand age 0.0 (Calendar Year: 1755)
092G089 0 0 51042508 (Rcrd ID: 8489172 ) 1 - I INVALIDSITEINFO - Height 0.0 at Projection Year 1755 is too short to generate yields for species 'HW'
083D056 0 0 30790200 (Rcrd ID: 9884561 ) 1 - I INVALIDSITEINFO - Height 0.0 at Projection Year 1761 is too short to generate yields for species 'SX'
083D056 0 0 30790200 (Rcrd ID: 9884561 ) 1 - I SPECIESNOTFOUND - Projected data for species 'SX' was not generated at stand age 0.0 (Calendar Year: 1761)
083D056 0 0 30790200 (Rcrd ID: 9884561 ) 1 - I INVALIDSITEINFO - Height 0.0 at Projection Year 1761 is too short to generate yields for species 'BL'
093C085 0 0 3402903 (Rcrd ID: 13727877 ) 1 - I INVALIDSITEINFO - Height 0.0 at Projection Year 1853 is too short to generate yields for species 'SX'
093C085 0 0 3402903 (Rcrd ID: 13727877 ) 1 - I SPECIESNOTFOUND - Projected data for species 'SX' was not generated at stand age 0.0 (Calendar Year: 1853)
093G045 0 0 85306886 (Rcrd ID: 14330826 ) 1 - I INVALIDSITEINFO - Height 0.0 at Projection Year 1913 is too short to generate yields for species 'SB'
093G045 0 0 85306886 (Rcrd ID: 14330826 ) 1 - I SPECIESNOTFOUND - Projected data for species 'SB' was not generated at stand age 0.0 (Calendar Year: 1913)
092G028 0 0 7489355 (Rcrd ID: 14473383 ) 1 - I INVALIDSITEINFO - Height 0.0 at Projection Year 1907 is too short to generate yields for species 'CW'
092G028 0 0 7489355 (Rcrd ID: 14473383 ) 1 - I SPECIESNOTFOUND - Projected data for species 'CW' was not generated at stand age 0.0 (Calendar Year: 1907)
092G028 0 0 7489355 (Rcrd ID: 14473383 ) 1 - I INVALIDSITEINFO - Height 0.0 at Projection Year 1907 is too short to generate yields for species 'HW'
093C080 0 0 42373828 (Rcrd ID: 15138818 ) 1 - I INVALIDSITEINFO - Height 0.0 at Projection Year 1913 is too short to generate yields for species 'PLI'
093C080 0 0 42373828 (Rcrd ID: 15138818 ) 1 - I SPECIESNOTFOUND - Projected data for species 'PLI' was not generated at stand age 0.0 (Calendar Year: 1913)
39 changes: 39 additions & 0 deletions frontend/public/test-data/ProgressLog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

VDYP7 Console version: '7.17d'

INI File: 'C:\Data_YC\VDYP7\ver7.33b\VDYP7\VDYP.ini'
Input Path: ''
HCSV Poly Inp: 'C:\Data_YC\VDYP7\console_instruction\virtual_tour\VDYP7_INPUT_POLY.csv'
HCSV Layer Inp: 'C:\Data_YC\VDYP7\console_instruction\virtual_tour\VDYP7_INPUT_LAYER.csv'
Output Path: 'C:\Data_YC\VDYP7\console_instruction\virtual_tour\VDYP7_OUTPUT_YLDTBL.csv'
Error File: 'C:\Data_YC\VDYP7\console_instruction\virtual_tour\VDYP7_OUTPUT_ERRMSG.txt'
Log File: 'C:\Data_YC\VDYP7\console_instruction\virtual_tour\VDYP7_OUTPUT_LOG.txt'
Debug Folder: ''
Debug Mode: 'Inactive'
Start Age: 0
End Age: 250
Start Year: N/A
End Year: N/A
Increment: 10
Inc. Ref Year: No
Inc. Crnt Year: No
Inc. Spcl Year: Yes (-9)
Back Grow Enabled: Yes
Forward Grow Enabled: Yes

Processing Polygon 2493719: '' '092H014'-600
Processing Polygon 2558002: '' '092H073'-2185
Processing Polygon 6212668: '' '092H025'-388
Processing Polygon 8489172: '' '092G089'-51042508
Processing Polygon 9884561: '' '083D056'-30790200
Processing Polygon 13727877: '' '093C085'-3402903
Processing Polygon 14330826: '' '093G045'-85306886
Processing Polygon 14473383: '' '092G028'-7489355
Processing Polygon 15138818: '' '093C080'-42373828

Processing Summary:
Polygons Processed: 9
Polygons Skipped: 0
-------
9

Loading

0 comments on commit 4e17cbd

Please sign in to comment.