Skip to content

Commit

Permalink
Merge pull request #142 from reagan-meant/ISSUE-141
Browse files Browse the repository at this point in the history
ISSUE-141: Remove potential matches from the Auto-matches screen
  • Loading branch information
ashaban authored Jun 13, 2024
2 parents 45a891f + d1fedb3 commit 59546fe
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions ui/src/views/Resolve.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
<h5 class="text-uppercase">Scores</h5>
</v-list-item>
<v-list-item
v-for="(score,source_id) in data.scores"
v-for="(score,source_id) in filteredScores(data.scores)"
:key="data.source_id+'-'+source_id"
>
<v-list-item-content>{{getSource(source_id)}}</v-list-item-content>
Expand Down Expand Up @@ -318,11 +318,20 @@ export default {
created: function() {
this.$store.state.progress.enable = true;
this.$store.state.progress.width = "300px";
this.$store.state.progress.title = this.$t('loading_potential');
this.$store.state.progress.title = this.$route.query.flagType === 'autoMatches' ? this.$t('loading_auto') : this.$t('loading_potential');
axios.get(`/ocrux/match/potential-matches/${this.$route.params.clientId}`).then((resp) => {
let responseData = resp.data;
if(this.$route.query.flagType === 'autoMatches'){
this.$store.state.progress.title = this.$t('loading_auto');
const parentObject = responseData.find(item => item.id === this.$route.params.clientId);
if (parentObject) {
responseData = responseData.filter(item => item.uid === parentObject.uid);
}
}
axios.get(`/ocrux/match/potential-matches/${this.$route.params.clientId}`).then((resp) => {
let extRegexPattern = /^extension_/;
let matchingKeys = [];
Expand Down Expand Up @@ -364,6 +373,19 @@ export default {
cridHeader: function() {
return this.useNickname ? this.$t('Temporary_cr_id') + ( this.includeCRID ? " / Actual CR ID" : "") : "CR ID"
},
filteredScores(scores) {
return (data) => {
const filteredScores = {};
Object.entries(data)
.forEach(([source_id, value]) => {
if (this.getSource(source_id) !== null && this.getSource(source_id) !== '') {
filteredScores[source_id] = value;
}
});
return filteredScores;
}
},
bucketsModified () {
for(let matrix of this.resolves) {
if(matrix.uid !== matrix.ouid) {
Expand Down Expand Up @@ -416,7 +438,8 @@ export default {
return this.useNickname ? this.nickname[crid] + ( this.includeCRID ? " ("+crid+")" : "" ): crid
},
getSource: function(source_id) {
return this.resolves.find( resolve => resolve.source_id === source_id ).source
const resolvedObject = this.resolves.find(resolve => resolve.source_id === source_id);
return resolvedObject ? resolvedObject.source : '';
},
moveClient: function(val,item) {
this.copyCohortInfo = { old_id: item.uid, new_id: val, item: item }
Expand Down

0 comments on commit 59546fe

Please sign in to comment.