How to use @arranger/components - 4 common examples

To help you get started, we’ve selected a few @arranger/components examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kids-first / kf-portal-ui / src / components / FamilyManifestModal / FamilyManifestModal.js View on Github external
...(sqon ? [{ op: 'not', content: [sqon] }] : []),
        ],
      },
    },
  })),
  withProps(({ familyMemberWithoutParticipantIdAggregation: { data } }) => ({
    familyMemberWithoutParticipantIds: (
      get(data, 'file.aggregations.participants__family__family_members__kf_id.buckets') || []
    ).map(b => b.key),
  })),
  withProps(({ familyMemberIds, familyMemberWithoutParticipantIds }) => ({
    finalFamilyMemberIds: familyMemberWithoutParticipantIds.length
      ? familyMemberWithoutParticipantIds
      : familyMemberIds,
  })),
  withQuery(
    ({ sqon, projectId, finalFamilyMemberIds, familyMemberWithoutParticipantIdAggregation }) => ({
      shouldFetch: !familyMemberWithoutParticipantIdAggregation.loading,
      renderError: true,
      projectId,
      key: 'dataTypesAggregation',
      query: `
      query dataTypes($sqon: JSON) {
        file {
          aggregations(filters: $sqon) {
            data_type {
              buckets {
                doc_count
                key
              }
            }
          }
github kids-first / kf-portal-ui / src / components / FamilyManifestModal / FamilyManifestModal.js View on Github external
content: { field: 'data_type', value: selectedDataTypes },
              },
              {
                op: 'in',
                content: { field: 'participants.kf_id', value: familyMemberIds },
              },
            ],
          },
        ],
      }
    : sqon;
};

const enhance = compose(
  injectState,
  withQuery(({ sqon, projectId }) => ({
    renderError: true,
    projectId,
    key: 'familyMemberIdAggregation',
    query: `
      query dataTypes($sqon: JSON) {
        file {
          aggregations(filters: $sqon) {
            participants__family__family_members__kf_id {
              buckets {
                doc_count
                key
              }
            }
          }
        }
      }
github kids-first / kf-portal-ui / src / components / FamilyManifestModal / FamilyManifestModal.js View on Github external
doc_count
                key
              }
            }
          }
        }
      }
    `,
    variables: { sqon },
  })),
  withProps(({ familyMemberIdAggregation: { data } }) => ({
    familyMemberIds: (
      get(data, 'file.aggregations.participants__family__family_members__kf_id.buckets') || []
    ).map(b => b.key),
  })),
  withQuery(({ sqon, projectId, familyMemberIds, familyMemberIdAggregation }) => ({
    shouldFetch: !familyMemberIdAggregation.loading,
    renderError: true,
    projectId,
    key: 'familyMemberWithoutParticipantIdAggregation',
    query: `
      query dataTypes($sqon: JSON) {
        file {
          aggregations(filters: $sqon) {
            participants__family__family_members__kf_id {
              buckets {
                doc_count
                key
              }
            }
          }
        }
github kids-first / kf-portal-ui / src / components / FileRepo / FileRepo.js View on Github external
render={props => {
                const selectionSQON = props.selectedTableRows.length
                  ? replaceSQON({
                      op: 'and',
                      content: [
                        {
                          op: 'in',
                          content: { field: 'kf_id', value: props.selectedTableRows },
                        },
                      ],
                    })
                  : url.sqon;
                return (

@arranger/components

Data Portal Components

AGPL-3.0
Latest version published 1 year ago

Package Health Score

54 / 100
Full package analysis

Similar packages