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

ISSUE-141: Remove potential matches from the Auto-matches screen #142

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Changes from all commits
Commits
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
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
Loading