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

ProteinsWebTeam / interpro7-client / 9364632258

04 Jun 2024 09:26AM UTC coverage: 21.86% (-0.005%) from 21.865%
9364632258

Pull #619

github

web-flow
Merge 11ab114f2 into 86e2c1de8
Pull Request #619: Feedback for entries

635 of 3953 branches covered (16.06%)

Branch coverage included in aggregate %.

0 of 2 new or added lines in 1 file covered. (0.0%)

1 existing line in 1 file now uncovered.

1506 of 5841 relevant lines covered (25.78%)

62.11 hits per line

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

0.0
/src/subPages/index.js
1
import { createSelector } from 'reselect';
2
import { format } from 'url';
3

4
import loadable from 'higherOrder/loadable';
5
import loadData from 'higherOrder/loadData';
6
import descriptionToPath from 'utils/processDescription/descriptionToPath';
7
// Too small to be split.
8
import Proteome from './Proteome';
9

10
const List = loadable({
×
11
  loader: () => import(/* webpackChunkName: "list-subpage" */ './ListSubPage'),
×
12
});
13

14
const Sequence = loadable({
×
15
  loader: () => import(/* webpackChunkName: "sequence-subpage" */ './Sequence'),
×
16
});
17

18
const DomainArchitecture = loadable({
×
19
  loader: () =>
20
    import(
×
21
      /* webpackChunkName: "domain-architecture-subpage" */ './DomainArchitecture'
22
    ),
23
});
24
const InteractionsSubPage = loadable({
×
25
  loader: () =>
26
    import(
×
27
      /* webpackChunkName: "interactions-subpage" */ './InteractionsSubPage'
28
    ),
29
});
30
const PathwaysSubPage = loadable({
×
31
  loader: () => import(/* webpackChunkName: "pathways-subpage" */ './Pathways'),
×
32
});
NEW
33
const FeedbackSubPage = loadable({
×
NEW
34
  loader: () => import(/* webpackChunkName: "feedback-subpage" */ './Feedback'),
×
35
});
UNCOV
36
const SubfamiliesSubPage = loadable({
×
37
  loader: () =>
38
    import(/* webpackChunkName: "subfamilies-subpage" */ './Subfamilies'),
×
39
});
40

41
const HMMModel = loadable({
×
42
  loader: () =>
43
    import(/* webpackChunkName: "hmm-model-subpage" */ './HMMModel'),
×
44
});
45
const EntryAlignments = loadable({
×
46
  loader: () =>
47
    import(
×
48
      /* webpackChunkName: "entry-alignments-subpage" */ './EntryAlignments'
49
    ),
50
});
51
const SimilarProteins = loadable({
×
52
  loader: () =>
53
    import(
×
54
      /* webpackChunkName: "similar-proteins-subpage" */ './SimilarProteins'
55
    ),
56
});
57
const Curation = loadable({
×
58
  loader: () => import(/* webpackChunkName: "curation-subpage" */ './Curation'),
×
59
});
60
const AlphaFoldModelSubPage = loadable({
×
61
  loader: () =>
62
    import(
×
63
      /* webpackChunkName: "alphafold-model-subpage" */ './AlphaFoldModelSubPage'
64
    ),
65
});
66

67
const defaultMapStateToProps = createSelector(
×
68
  (state) => state.settings.api,
×
69
  (state) => state.settings.navigation.pageSize,
×
70
  (state) => state.customLocation.description,
×
71
  (state) => state.customLocation.search,
×
72
  (
73
    { protocol, hostname, port, root },
74
    settingsPageSize,
75
    description,
76
    _search,
77
  ) => {
78
    const search =
79
      description.main.key && description[description.main.key].accession
×
80
        ? {}
81
        : _search || {};
×
82
    search.page_size = search.page_size || settingsPageSize;
×
83
    const _description =
84
      description.main.key && description[description.main.key].accession
×
85
        ? {
86
            main: description.main,
87
            [description.main.key]: description[description.main.key],
88
          }
89
        : description;
90
    return format({
×
91
      protocol,
92
      hostname,
93
      port,
94
      pathname: root + descriptionToPath(_description),
95
      query: search,
96
    });
97
  },
98
);
99

100
const mapStateToPropsForHMMModel = createSelector(
×
101
  (state) => state.settings.api,
×
102
  (state) => state.customLocation.description,
×
103
  (state) => state.customLocation.search,
×
104
  ({ protocol, hostname, port, root }, description, search) => {
105
    // omit elements from search
106
    const { type, search: _, ...restOfSearch } = search;
×
107
    // modify search
108
    restOfSearch.annotation = 'logo';
×
109
    // omit elements from description
110
    const { ...copyOfDescription } = description;
×
111
    if (description.main.key) {
×
112
      copyOfDescription[description.main.key] = {
×
113
        ...description[description.main.key],
114
        detail: null,
115
      };
116
    }
117
    // build URL
118
    return format({
×
119
      protocol,
120
      hostname,
121
      port,
122
      pathname: root + descriptionToPath(copyOfDescription),
123
      query: restOfSearch,
124
    });
125
  },
126
);
127

128
const getDBModifierURL = (db, modifier) =>
×
129
  createSelector(
×
130
    (state) => state.settings.api,
×
131
    (state) => state.customLocation.description.entry,
×
132
    ({ protocol, hostname, port, root }, entry) => {
133
      const search = {};
×
134
      search[modifier] = '';
×
135
      const _description = {
×
136
        main: { key: 'entry' },
137
        entry: {
138
          db,
139
          accession: entry.accession,
140
        },
141
      };
142
      return format({
×
143
        protocol,
144
        hostname,
145
        port,
146
        pathname: root + descriptionToPath(_description),
147
        query: search,
148
      });
149
    },
150
  );
151

152
const subPages = new Map([
×
153
  ['entry', loadData(defaultMapStateToProps)(List)],
154
  ['protein', loadData(defaultMapStateToProps)(List)],
155
  ['structure', loadData(defaultMapStateToProps)(List)],
156
  ['taxonomy', loadData(defaultMapStateToProps)(List)],
157
  ['set', loadData(defaultMapStateToProps)(List)],
158
  ['sequence', Sequence],
159
  ['domain_architecture', DomainArchitecture],
160
  [
161
    'interactions',
162
    loadData(getDBModifierURL('InterPro', 'interactions'))(InteractionsSubPage),
163
  ],
164
  [
165
    'pathways',
166
    loadData(getDBModifierURL('InterPro', 'pathways'))(PathwaysSubPage),
167
  ],
168
  ['subfamilies', SubfamiliesSubPage],
169
  ['alphafold', AlphaFoldModelSubPage],
170
  ['entry_alignments', EntryAlignments],
171
  ['logo', loadData(mapStateToPropsForHMMModel)(HMMModel)],
172
  ['proteome', loadData()(Proteome)],
173
  ['similar_proteins', SimilarProteins],
174
  ['curation', Curation],
175
  ['feedback', FeedbackSubPage],
176
]);
177

178
export default subPages;
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

© 2025 Coveralls, Inc