Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ on:
- 'main'

jobs:
typecheck-siteplan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Install dependencies
run: npm ci
working-directory: web/siteplan

- name: Run typecheck
run: npm run typecheck
working-directory: web/siteplan

test-siteplan:
runs-on: ubuntu-latest
steps:
Expand Down
86 changes: 85 additions & 1 deletion web/siteplan/package-lock.json

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

6 changes: 4 additions & 2 deletions web/siteplan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"build": "vite build --mode development",
"build-prod": "vite build --mode production",
"lint": "eslint src",
"test:e2e": "playwright test"
"test:e2e": "playwright test",
"typecheck": "vue-tsc --noEmit"
},
"dependencies": {
"@turf/boolean-disjoint": "^7.3.5",
Expand Down Expand Up @@ -42,6 +43,7 @@
"eslint-plugin-vue": "^10.8.0",
"tslib": "^2.8.1",
"typescript": "^6.0.3",
"vite": "^8.0.8"
"vite": "^8.0.8",
"vue-tsc": "^3.3.4"
}
}
101 changes: 49 additions & 52 deletions web/siteplan/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,73 +13,67 @@
</div>
</div>
</template>
<script lang="ts">
<script setup lang="ts">
import Menubar from '@/components/toolbar/Menubar.vue'
import Toolbar from '@/components/toolbar/Toolbar.vue'
import axios from 'axios'
import { Options, Vue } from 'vue-class-component'
import { onMounted, ref } from 'vue'
import SvgCatalogService from './service/SvgCatalogService'
import { store } from './store'
import Configuration from './util/Configuration'
import PlanProToolboxTest from './util/PlanProToolboxTest'
import { ToolboxConfiguration } from './util/ToolboxConfiguration'
@Options({
async created () {
store.commit('setLoading', true)
// Download the siteplan font
await axios({
method: 'GET',
url: 'font',
responseType: 'blob'
})
.then(response => {
const reader = new FileReader()
reader.onload = () => {
store.commit(
'setSiteplanfont',
`

const isShowMenu = ref(false)
const loading = ref(true)

function showMenu (value: boolean): void {
isShowMenu.value = value
}

onMounted (async () => {
store.commit('setLoading', true)
// Download the siteplan font
await axios({
method: 'GET',
url: 'font',
responseType: 'blob'
})
.then(response => {
const reader = new FileReader()
reader.onload = () => {
store.commit(
'setSiteplanfont',
`
@font-face {
font-family: 'siteplanfont';
src: url('${reader.result}') format('truetype');
}`
)
}
reader.readAsDataURL(new Blob([response.data]))
})
.catch(() => {
console.warn('Siteplan Font not available')
})
// Wait until the svg catalog service is ready
await SvgCatalogService.getInstance().isReady()
// Download the toolbox configuration
await axios
.get<ToolboxConfiguration>('/configuration.json')
.then(response => {
store.commit('setpptConfiguration', response.data)
store.commit('setSheetCutCRS', response.data.defaultSheetCutCRS)
store.commit('setPlanProModelType', response.data.planproModelType)
// run unit tests
if (Configuration.developmentMode()) {
PlanProToolboxTest.run()
}
)
}
reader.readAsDataURL(new Blob([response.data]))
})
.catch(() => {
console.warn('Siteplan Font not available')
})
// Wait until the svg catalog service is ready
await SvgCatalogService.getInstance().isReady()
// Download the toolbox configuration
await axios
.get<ToolboxConfiguration>('/configuration.json')
.then(response => {
store.commit('setpptConfiguration', response.data)
store.commit('setSheetCutCRS', response.data.defaultSheetCutCRS)
store.commit('setPlanProModelType', response.data.planproModelType)
// run unit tests
if (Configuration.developmentMode()) {
PlanProToolboxTest.run()
}

this.loading = false
})
},
components: {
Toolbar,
Menubar
}
loading.value = false
})
})
export default class App extends Vue {
isShowMenu = false
altClientHeight = 0
loading = true

showMenu (value: boolean): void {
this.isShowMenu = value
}
}
</script>
<style>
html,
Expand All @@ -95,13 +89,16 @@ body {
height: 100vh;
flex-direction: column;
}

#view {
display: flex;
flex: 1;
}

#menubar {
flex-grow: 1;
}

#mainView {
flex-grow: 5;
}
Expand Down
Loading
Loading