-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into SKYEDEN-3020-RetransmissionFix
- Loading branch information
Showing
18 changed files
with
295 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface TrackingUrl { | ||
name: string; | ||
url: string; | ||
} |
43 changes: 43 additions & 0 deletions
43
hermes-console/src/components/tracking-card/TrackingCard.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { expect } from 'vitest'; | ||
import { render } from '@/utils/test-utils'; | ||
import TrackingCard from '@/components/tracking-card/TrackingCard.vue'; | ||
|
||
describe('TrackingCard', () => { | ||
const props = { | ||
trackingUrls: [ | ||
{ name: 'url1', url: 'https://test-tracking-url1' }, | ||
{ name: 'url2', url: 'https://test-tracking-url2' }, | ||
], | ||
}; | ||
|
||
it('should render title properly', () => { | ||
// when | ||
const { getByText } = render(TrackingCard, { props }); | ||
|
||
// then | ||
const row = getByText('trackingCard.title'); | ||
expect(row).toBeVisible(); | ||
}); | ||
|
||
it('should render all tracking urls', () => { | ||
// when | ||
const { container } = render(TrackingCard, { props }); | ||
|
||
// then | ||
const elements = container.querySelectorAll('a')!!; | ||
expect(elements[0]).toHaveAttribute('href', 'https://test-tracking-url1'); | ||
expect(elements[0]).toHaveTextContent('url1'); | ||
expect(elements[1]).toHaveAttribute('href', 'https://test-tracking-url2'); | ||
expect(elements[1]).toHaveTextContent('url2'); | ||
}); | ||
|
||
it('should render message when no tracking urls', () => { | ||
// given | ||
const emptyProps = { trackingUrls: [] }; | ||
const { getByText } = render(TrackingCard, { emptyProps }); | ||
|
||
// then | ||
const row = getByText('trackingCard.noTrackingUrls'); | ||
expect(row).toBeVisible(); | ||
}); | ||
}); |
34 changes: 34 additions & 0 deletions
34
hermes-console/src/components/tracking-card/TrackingCard.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<script setup lang="ts"> | ||
import type { TrackingUrl } from '@/api/tracking-url'; | ||
const props = defineProps<{ | ||
trackingUrls: TrackingUrl[]; | ||
}>(); | ||
</script> | ||
|
||
<template> | ||
<v-card> | ||
<template #title> | ||
<div class="d-flex justify-space-between"> | ||
<p class="font-weight-bold"> | ||
{{ $t('trackingCard.title') }} | ||
</p> | ||
</div> | ||
</template> | ||
<v-card-item v-if="props.trackingUrls && props.trackingUrls.length > 0"> | ||
<p v-for="trackingUrl in props.trackingUrls" :key="trackingUrl.name"> | ||
<v-btn | ||
:href="trackingUrl.url" | ||
target="_blank" | ||
variant="text" | ||
color="blue" | ||
> | ||
{{ trackingUrl.name }} | ||
</v-btn> | ||
</p> | ||
</v-card-item> | ||
<v-card-item v-else> {{ $t('trackingCard.noTrackingUrls') }} </v-card-item> | ||
</v-card> | ||
</template> | ||
|
||
<style scoped lang="scss"></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { TrackingUrl } from '@/api/tracking-url'; | ||
|
||
export const dummyTrackingUrls: TrackingUrl[] = [ | ||
{ name: 'url1', url: 'https://test-url1' }, | ||
{ name: 'url2', url: 'https://test-url2' }, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.