Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7085 ixstatus revamp revisited #7385

Merged
merged 32 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c0ef3db
WIP, fixtures rework for ix filters and aggregations
daneryl Aug 22, 2024
a60b08e
Begun flattening aggregations response
RafaPolit Aug 23, 2024
467f366
Flattened the Aggregations return
RafaPolit Sep 3, 2024
72a81e3
Complete refactor to aggregation results
RafaPolit Sep 4, 2024
57b6653
Removed unused variables
RafaPolit Sep 4, 2024
9182249
Removed unnecessary code
RafaPolit Sep 4, 2024
31f90de
Renamed as _deprecated previous factory implementation
RafaPolit Sep 4, 2024
f6fdc0d
Moved ixSuggestions factory to Factory
RafaPolit Sep 4, 2024
78e0afc
Changed filtering logic.
RafaPolit Sep 4, 2024
25255c0
Fixed Route validation and tests
RafaPolit Sep 4, 2024
ebaa8c0
Using updated component
konzz Sep 11, 2024
ab7d0c8
Merge branch 'development' into 7085-ix-statuses-revamp-dev
konzz Sep 11, 2024
b58cec7
removed accuracy from the filters untill the backend returns it
konzz Sep 11, 2024
77ec1ee
Merge branch '7085-ix-statuses-revamp-dev' of github.com:huridocs/uwa…
konzz Sep 11, 2024
48d680a
Merge branch 'development' into 7085-ix-statuses-revamp-dev
konzz Sep 12, 2024
5e3a7e0
Merge branch 'development' into 7085-ix-statuses-revamp-dev
konzz Sep 12, 2024
677c442
Changed labeled and match to be optional
RafaPolit Sep 17, 2024
f7e71b4
Removed optional parameters from factory
RafaPolit Sep 17, 2024
d4ced63
Changed logic to remove labeled and match if error or obsolete.
RafaPolit Sep 17, 2024
6f54bac
Disabled eslint to be able to look at code
RafaPolit Sep 17, 2024
4ccba41
Changed logic to ensure undefined values are not counted towards limits.
RafaPolit Sep 17, 2024
3d98873
Improved the conditions.
RafaPolit Sep 17, 2024
8392021
showing error and obsolete in the statuses
konzz Sep 18, 2024
302b495
changed filters structure
konzz Sep 20, 2024
e39b358
Merge remote-tracking branch 'origin/development' into 7085-ix-status…
konzz Sep 20, 2024
030dd2e
updated translations
konzz Sep 20, 2024
2459660
Added logic for processing to refelct obsolete
RafaPolit Sep 23, 2024
10bd030
Merge branch 'development' into 7085-ixstatus-revamp-revisited
RafaPolit Oct 18, 2024
f585b5e
Replaced text to show new logic
RafaPolit Oct 18, 2024
5521ccc
Fixed tests to reflect new logic
RafaPolit Oct 18, 2024
ff97ec2
Added condition for null to be excluded.
RafaPolit Oct 18, 2024
6371aac
Reinstated document implementation
RafaPolit Oct 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -759,12 +759,12 @@ describe('InformationExtraction', () => {
status: 'processing',
state: {
labeled: true,
match: null,
withValue: true,
withSuggestion: true,
match: false,
hasContext: true,
processing: true,
obsolete: false,
obsolete: true,
error: false,
},
})
Expand Down Expand Up @@ -1011,9 +1011,9 @@ describe('InformationExtraction', () => {
error: 'Issue calculation suggestion',
state: {
labeled: true,
match: null,
withValue: true,
withSuggestion: false,
match: false,
hasContext: false,
processing: false,
obsolete: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ const fixtures: DBFixture = {
fixtureFactory.ixExtractor('fungusKindExtractor', 'kind', ['fungusTemplate']),
],
ixsuggestions: [
fixtureFactory.ixSuggestion(
fixtureFactory.ixSuggestion_deprecated(
'sh1_en',
'existingExtractor',
'shared1',
'animalTemplate',
'F3',
'kind'
),
fixtureFactory.ixSuggestion(
fixtureFactory.ixSuggestion_deprecated(
'sh1_es',
'existingExtractor',
'shared1',
Expand All @@ -110,23 +110,23 @@ const fixtures: DBFixture = {
'kind',
{ language: 'es' }
),
fixtureFactory.ixSuggestion(
fixtureFactory.ixSuggestion_deprecated(
'sh3_en',
'existingExtractor',
'shared3',
'plantTemplate',
'F5',
'kind'
),
fixtureFactory.ixSuggestion(
fixtureFactory.ixSuggestion_deprecated(
'sh4_en',
'fungusKindExtractor',
'shared4',
'fungusTemplate',
'F7',
'kind'
),
fixtureFactory.ixSuggestion(
fixtureFactory.ixSuggestion_deprecated(
'sh4_es',
'fungusKindExtractor',
'shared4',
Expand Down
47 changes: 12 additions & 35 deletions app/api/suggestions/pipelineStages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,23 @@ export const baseQueryFragment = (extractorId: ObjectId, ignoreProcessing = true
};

export const filterFragments = {
labeled: {
_fragment: { 'state.labeled': true },
match: { 'state.labeled': true, 'state.match': true },
mismatch: { 'state.labeled': true, 'state.match': false },
},
nonLabeled: {
_fragment: { 'state.labeled': false },
withSuggestion: { 'state.labeled': false, 'state.withSuggestion': true },
noSuggestion: { 'state.labeled': false, 'state.withSuggestion': false },
noContext: { 'state.labeled': false, 'state.hasContext': false },
obsolete: { 'state.labeled': false, 'state.obsolete': true },
others: { 'state.labeled': false, 'state.error': true },
},
labeled: { 'state.labeled': true },
nonLabeled: { 'state.labeled': false },
match: { 'state.match': true },
mismatch: { 'state.match': false },
obsolete: { 'state.obsolete': true },
error: { 'state.error': true },
};

export const translateCustomFilter = (customFilter: SuggestionCustomFilter) => {
const orFilters = [];
if (customFilter.labeled.match) {
orFilters.push(filterFragments.labeled.match);
}
if (customFilter.labeled.mismatch) {
orFilters.push(filterFragments.labeled.mismatch);
}

if (customFilter.nonLabeled.withSuggestion) {
orFilters.push(filterFragments.nonLabeled.withSuggestion);
}
if (customFilter.labeled) orFilters.push(filterFragments.labeled);
if (customFilter.nonLabeled) orFilters.push(filterFragments.nonLabeled);
if (customFilter.match) orFilters.push(filterFragments.match);
if (customFilter.mismatch) orFilters.push(filterFragments.mismatch);
if (customFilter.obsolete) orFilters.push(filterFragments.obsolete);
if (customFilter.error) orFilters.push(filterFragments.error);

if (customFilter.nonLabeled.noSuggestion) {
orFilters.push(filterFragments.nonLabeled.noSuggestion);
}
if (customFilter.nonLabeled.noContext) {
orFilters.push(filterFragments.nonLabeled.noContext);
}
if (customFilter.nonLabeled.obsolete) {
orFilters.push(filterFragments.nonLabeled.obsolete);
}
if (customFilter.nonLabeled.others) {
orFilters.push(filterFragments.nonLabeled.others);
}
return orFilters;
};

Expand Down
Loading
Loading