Skip to content

Commit

Permalink
rename filteredmap to mapcomponent 2nd
Browse files Browse the repository at this point in the history
  • Loading branch information
bonham committed Jan 3, 2024
1 parent 6b1a0c4 commit 7fc7a6c
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 39 deletions.
7 changes: 7 additions & 0 deletions client/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ declare module 'vue' {
DropField: typeof import('./src/components/DropField.vue')['default']
EditableText: typeof import('./src/components/EditableText.vue')['default']
FilteredMap: typeof import('./src/components/FilteredMap.vue')['default']
IBiArrowDownCircleFill: typeof import('~icons/bi/arrow-down-circle-fill')['default']
IBiArrowLeft: typeof import('~icons/bi/arrow-left')['default']
IBiArrowRightCircle: typeof import('~icons/bi/arrow-right-circle')['default']
IBiChevronRight: typeof import('~icons/bi/chevron-right')['default']
IBiPencilFill: typeof import('~icons/bi/pencil-fill')['default']
IBiTrash: typeof import('~icons/bi/trash')['default']
LoginForm: typeof import('./src/components/auth/LoginForm.vue')['default']
LogoutForm: typeof import('./src/components/auth/LogoutForm.vue')['default']
MapComponent: typeof import('./src/components/MapComponent.vue')['default']
RegistrationForm: typeof import('./src/components/auth/RegistrationForm.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
Expand Down
60 changes: 30 additions & 30 deletions client/package-lock.json

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

File renamed without changes.
3 changes: 3 additions & 0 deletions client/src/lib/getconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ async function getConfig(sid: string, conftype: string, confkey: string): Promis

const url = `/api/config/get/sid/${sid}/${conftype}/${confkey}`
const r = await fetch(url)
if (!r.ok) {
throw Error("Retrieving config not successful", { cause: { url, status: r.status } })
}
const rJson = await r.json() as unknown

if (!!rJson && typeof (rJson) === 'object' && 'value' in rJson) {
Expand Down
6 changes: 3 additions & 3 deletions client/src/views/TrackDetailPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<h1 class="mt-4 mb-4">
Track {{ id }} Details
</h1>
<FilteredMap :sid="sid" />
<MapComponent :sid="sid" />
</div>
</track-manager-nav-bar>
</template>

<script lang="ts" setup>
import FilteredMap from '@/components/FilteredMap.vue';
import MapComponent from '@/components/MapComponent.vue';
import TrackManagerNavBar from '@/components/TrackManagerNavBar.vue'
import { useMapStateStore } from '@/stores/mapstate'
import { nextTick } from 'vue';
Expand All @@ -30,7 +30,7 @@ const props = defineProps({
})
nextTick(() => {
// send command to FilteredMap to load a single track
// send command to MapComponent to load a single track
mapStateStore.loadCommand = {
command: 'track',
payload: Number.parseInt(props.id),
Expand Down
4 changes: 2 additions & 2 deletions client/src/views/TrackMapPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
</b-button>
</div>
<div class="d-flex flex-column flex-grow-1">
<filtered-map :sid="sid" />
<map-component :sid="sid" />
</div>
</track-manager-nav-bar>
</template>

<script lang="ts" setup>
import { BButton } from 'bootstrap-vue-next'
import TrackManagerNavBar from '@/components/TrackManagerNavBar.vue'
import FilteredMap from '@/components/FilteredMap.vue'
import MapComponent from '@/components/MapComponent.vue'
import { TrackCollection } from '@/lib/Track'
import { getAllTracks } from '@/lib/trackServices'
import { useMapStateStore } from '@/stores/mapstate'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { render } from '@testing-library/vue'
import { mount, DOMWrapper } from '@vue/test-utils'

import FilteredMap from '@/components/FilteredMap.vue'
import MapComponent from '@/components/MapComponent.vue'
import { ManagedMap } from '@/lib/mapservices/ManagedMap'

import { createTestingPinia } from '@pinia/testing'
import { vi, test, beforeEach, describe, expect } from 'vitest'
import ResizeObserverMock from './__mocks__/ResizeObserver'

describe('Basic store test with FilteredMap', () => {
describe('Basic store test with MapComponent', () => {
beforeEach(() => {
vi.stubGlobal('ResizeObserver', ResizeObserverMock)
})
test('Trivial mount', () => {
render(FilteredMap, {
render(MapComponent, {
global: {
plugins: [createTestingPinia()]
}
Expand All @@ -22,7 +22,7 @@ describe('Basic store test with FilteredMap', () => {
})

test('Low level', () => {
const wrapper = mount(FilteredMap, {
const wrapper = mount(MapComponent, {
global: {
plugins: [createTestingPinia()]
}
Expand Down

0 comments on commit 7fc7a6c

Please sign in to comment.