• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CBIIT / bento-c3dc-frontend / 21524299789

30 Jan 2026 05:16PM UTC coverage: 0.154% (-0.01%) from 0.167%
21524299789

Pull #478

github

web-flow
Merge 6c3c3828e into c99082bc6
Pull Request #478: C3DC-1912 & C3DC-1935, Restricted Constructed URL + Interop URL feature

6 of 4070 branches covered (0.15%)

Branch coverage included in aggregate %.

0 of 489 new or added lines in 14 files covered. (0.0%)

24 existing lines in 6 files now uncovered.

10 of 6301 relevant lines covered (0.16%)

0.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/pages/inventory/filterQueryBar/QueryBarUtils.js
1
import { CCDI_INTEROP_SERVICE_URL } from '../../../bento/cohortModalData';
×
2

3
export const generateUrl = async (queryStr, root, setUrlCallback) => {
×
4
    try {
×
5
      const graphqlQuery = `
×
6
        query storeManifest($manifestString: String!, $type: String!) {
7
          storeManifest(manifest: $manifestString, type: $type)
8
        }
9
      `;
10

11
      const response = await fetch(CCDI_INTEROP_SERVICE_URL, {
×
12
        method: 'POST',
13
        headers: {
14
          'Content-Type': 'application/json',
15
        },
16
        body: JSON.stringify({
17
          query: graphqlQuery,
18
          variables: {
19
            manifestString: JSON.stringify({ key: encodeURIComponent(queryStr) }),
20
            type: 'json',
21
          },
22
        }),
23
      });
24

25
      if (!response.ok) {
×
26
        throw new Error(`HTTP error! status: ${response.status}`);
×
27
      }
28

29
      const result = await response.json();
×
30

31
      if (result.errors) {
×
32
        const errorMessage = (result.errors[0] && result.errors[0].message) || 'Unknown error';
×
33
        throw new Error(`CCDI Interop Service Error: ${errorMessage}`);
×
34
      }
35

36
      // Process and open the URL
37
      const processedUrl = (result.data && result.data.storeManifest) || null;
×
38
      if (!processedUrl) {
×
39
        throw new Error('No valid URL returned from interop service');
×
40
      }
41

42
      // Extract only the pathname from root (strip existing query parameters)
43
      // root might be relative like "/explore?dbgap_accession=..." or absolute
44
      let cleanPath;
NEW
45
      if (root.startsWith('http://') || root.startsWith('https://')) {
×
NEW
46
        const url = new URL(root);
×
NEW
47
        cleanPath = url.origin + url.pathname;
×
48
      } else {
49
        // Handle relative URLs - just take the pathname before any query params
NEW
50
        cleanPath = root.split('?')[0];
×
51
      }
NEW
52
      setUrlCallback(`${cleanPath}?filterQuery=${processedUrl}`);
×
53
    } catch (error) {
54
      console.log('Error generating URL:', error);
×
55
    }
56
  };
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc