Skip to content

Commit

Permalink
[UXE-5459] feat: enhance edge node list view with fetch table block (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpaulo-azion authored Feb 5, 2025
1 parent 3e1d5a5 commit a24b106
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const adapt = (httpResponse) => {

return {
body: parsedEdgeNodes,
count: httpResponse.body.count,
statusCode: httpResponse.statusCode
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { makeEdgeNodeBaseUrl } from '@/services/edge-node-services/v4/make-edge-node-base-url'
import { assert, describe, it } from 'vitest'

const makeSut = () => {
const sut = makeEdgeNodeBaseUrl

return {
sut
}
}

describe('EdgeNodeServices', () => {
it('should return the API base url to edge node service', () => {
const { sut } = makeSut()
const version = 'v4'
const correctApiUrl = `${version}/edge_orchestrator/edge_nodes`

const baseUrl = sut()

assert.strictEqual(baseUrl, correctApiUrl)
})
})
7 changes: 5 additions & 2 deletions src/views/EdgeNode/ListView.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup>
import ContentBlock from '@/templates/content-block'
import EmptyEdgeNode from '@/templates/empty-results-block/empty-edge-node'
import ListTableBlock from '@/templates/list-table-block'
import FetchListTableBlock from '@/templates/list-table-block/with-fetch-ordering-and-pagination.vue'
import { columnBuilder } from '@/templates/list-table-block/columns/column-builder'
import PageHeadingBlock from '@/templates/page-heading-block'
import Authorize from '@/views/EdgeNode/Dialog/Authorize'
Expand Down Expand Up @@ -75,15 +75,18 @@
}
}
]
const EDGE_NODE_API_FIELDS = ['id', 'name', 'hash_id', 'status']
</script>
<template>
<ContentBlock>
<template #heading>
<PageHeadingBlock pageTitle="Edge Nodes"></PageHeadingBlock>
</template>
<template #content>
<ListTableBlock
<FetchListTableBlock
v-if="hasContentToList"
:apiFields="EDGE_NODE_API_FIELDS"
:listService="listEdgeNodeService"
:columns="getColumns"
editPagePath="edge-node/edit"
Expand Down

0 comments on commit a24b106

Please sign in to comment.