From 74b586a6f3695d02c0612fcbf172d68b7cb3c2bd Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Mon, 4 Nov 2024 20:20:50 -0500 Subject: [PATCH] fix: add properties to section activity --- src/components/Section/Section.vue | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/Section/Section.vue b/src/components/Section/Section.vue index 135d41d..438a053 100644 --- a/src/components/Section/Section.vue +++ b/src/components/Section/Section.vue @@ -24,7 +24,8 @@ v-on:setData="setResponse" :responses="responses" :selected_language="selected_language" - :showPassOptions="showPassOptions" + :showPassOptions="findPassOptions" + :individualPassList="individualPassList" :reprotermsUrl="reprotermsUrl" /> @@ -99,7 +100,8 @@ export default { visibility: {}, scores: {}, currentIndex: 0, - showModal: false + showModal: false, + individualPassList: [], }; }, components: { @@ -117,6 +119,7 @@ export default { // this.$store.dispatch('getActivityData'); jsonld.expand(this.srcUrl).then((resp) => { this.activity = resp[0]; + this.findIndividualPassOptions(); this.listShow = [0]; this.$nextTick(() => { const answered = _.filter(this.context, c => @@ -151,6 +154,17 @@ export default { return i; // }); }, + findIndividualPassOptions() { + if (this.activity['http://schema.repronim.org/addProperties']) { + this.individualPassList = _.filter(this.activity['http://schema.repronim.org/addProperties'], ap => { + // eslint-disable-next-line no-prototype-builtins + if (ap.hasOwnProperty('http://schema.repronim.org/allow')) { + return ap; + } + }); + // console.log(138, a); + } + }, getVisibility(responses) { const responseMapper = this.responseMapper(responses); if (!_.isEmpty(this.activity['http://schema.repronim.org/addProperties'])) {