Skip to content

Commit

Permalink
Merge pull request #798 from OmarBrbutovic/existing_tags_ssp
Browse files Browse the repository at this point in the history
Enable server-side pagination existing_device_tags
  • Loading branch information
davidebriani authored Jan 14, 2025
2 parents 04560ac + d7b3820 commit 66642a9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
16 changes: 14 additions & 2 deletions frontend/src/api/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2875,14 +2875,26 @@ type RootQueryType {
"Retrieves the current tenant."
tenantInfo: TenantInfo!

"Returns Tags currently assigned to some device."
"Returns the list of device tags associated to some device group."
existingDeviceTags(
"How to sort the records in the response"
sort: [TagSortInput]

"A filter to limit the results"
filter: TagFilterInput
): [Tag!]!

"The number of records to return from the beginning. Maximum 250"
first: Int

"Show records before the specified keyset."
before: String

"Show records after the specified keyset."
after: String

"The number of records to return to the end. Maximum 250"
last: Int
): TagConnection

"Returns a single device group."
deviceGroup("The id of the record" id: ID!): DeviceGroup
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/pages/Device.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,11 @@ const REMOVE_DEVICE_TAGS_MUTATION = graphql`
const GET_TAGS_QUERY = graphql`
query Device_getExistingDeviceTags_Query {
existingDeviceTags {
name
edges {
node {
name
}
}
}
}
`;
Expand Down Expand Up @@ -1392,7 +1396,7 @@ const DeviceContent = ({

const tags = useMemo(
() =>
tagsData.existingDeviceTags.map(({ name: tag }) => ({
tagsData.existingDeviceTags?.edges?.map(({ node: { name: tag } }) => ({
label: tag,
value: tag,
})),
Expand Down

0 comments on commit 66642a9

Please sign in to comment.