Skip to content

Commit

Permalink
Merge pull request #1752 from Jahia/QA-15245
Browse files Browse the repository at this point in the history
QA-15245 Fixed usages query
  • Loading branch information
r3dm1ke authored Sep 17, 2024
2 parents e989728 + 846cc09 commit d61d1bb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<jahia-module-type>system</jahia-module-type>
<yarn.arguments>build:production</yarn.arguments>
<require-capability>osgi.extender;filter:="(osgi.extender=org.jahia.bundles.blueprint.extender.config)"</require-capability>
<jahia-module-signature>MCwCFB6EWbfkaZ5mcDwwtlKcQLhPHoMZAhR4xPRDDxOtQDDvH9opYiQz+pQ96g==</jahia-module-signature>
<jahia-module-signature>MCwCFD/TCIKGNSSOq8Iga3EphH2K/YE0AhQQMkqhiwmB8gZTgPTeIc7Hlkwe4Q==</jahia-module-signature>
<jahia-depends>app-shell=2.7,graphql-dxm-provider=2.19.1,jcontent=2.9</jahia-depends>
<jahia.plugin.version>6.9</jahia.plugin.version>
<import-package>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import gql from 'graphql-tag';
import {PredefinedFragments} from '@jahia/data-helper';

export const UsagesQuery = gql`query($path:String!, $language: String!, $pageSize: Int!, $currentPage: Int!) {
export const UsagesQuery = gql`query($path:String!, $language: String!, $pageSize: Int!, $currentPage: Int!, $fieldSorter: InputFieldSorterInput) {
jcr {
nodeByPath(path: $path) {
...NodeCacheRequiredFields
usages: references(fieldFilter: {filters: {fieldName: "node.visible", value: "true"}}, limit: $pageSize, offset: $currentPage) {
usages: usages(fieldFilter: {filters: {fieldName: "node.visible", value: "true"}}, limit: $pageSize, offset: $currentPage, fieldSorter: $fieldSorter) {
nodes {
name
language
properties {
name
language
}
node {
...NodeCacheRequiredFields
visible: isNodeType(type: {types: ["jnt:workflowTask"], multi: NONE})
Expand Down Expand Up @@ -61,13 +63,12 @@ export const UsagesCountQuery = gql`query($path:String!) {
jcr {
nodeByPath(path: $path) {
...NodeCacheRequiredFields
usages: references(fieldFilter: {filters: {fieldName: "node.visible", value: "true"}}) {
usages: usages(fieldFilter: {filters: {fieldName: "node.visible", value: "true"}}) {
nodes {
node {
...NodeCacheRequiredFields
visible: isNodeType(type: {types: ["jnt:workflowTask"], multi: NONE})
}
}
pageInfo {
nodesCount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const Usages = () => {
...acc,
[ref.node.uuid]: {
...ref.node,
locales: acc[ref.node.uuid] ? [...acc[ref.node.uuid]?.locales, ref.language] : [ref.language]
locales: ref.properties.map(property => property.language)
}
}
), {})) : [];
Expand Down

0 comments on commit d61d1bb

Please sign in to comment.