Skip to content

Commit

Permalink
Merge branch 'saved-search-2140' of https://github.com/FAIRsharing/fa…
Browse files Browse the repository at this point in the history
…irsharing.github.io into saved-search-2140
  • Loading branch information
prakhyatox committed Jul 23, 2024
2 parents 1139e60 + 08fe960 commit adab05c
Show file tree
Hide file tree
Showing 70 changed files with 177 additions and 108 deletions.
2 changes: 1 addition & 1 deletion documentation/html/ExternalRESTClients.html
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion documentation/html/GraphQLClient.html
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
30 changes: 27 additions & 3 deletions documentation/html/RESTClient.html
Original file line number Diff line number Diff line change
Expand Up @@ -8323,7 +8323,7 @@ <h5>Returns:</h5>

<hr>
<dt>
<h4 class="name" id="updateSaveSearch"><span class="type-signature">&lt;async> </span>updateSaveSearch(saveSearchObj, jwt)</h4>
<h4 class="name" id="updateSaveSearch"><span class="type-signature">&lt;async> </span>updateSaveSearch(saveSearchId, saveSearchObj, jwt)</h4>


</dt>
Expand Down Expand Up @@ -8364,6 +8364,30 @@ <h5>Parameters:</h5>
<tbody>


<tr>

<td class="name"><code>saveSearchId</code></td>


<td class="type">


<span class="param-type">Number</span>




</td>





<td class="description last"><p>save search id</p></td>
</tr>



<tr>

<td class="name"><code>saveSearchObj</code></td>
Expand Down Expand Up @@ -8452,7 +8476,7 @@ <h5>Parameters:</h5>
<ul class="dummy">
<li>
<a href="lib_Client_RESTClient.js.html">lib/Client/RESTClient.js</a>,
<a href="lib_Client_RESTClient.js.html#sunlight-1-line-1063">line 1063</a>
<a href="lib_Client_RESTClient.js.html#sunlight-1-line-1064">line 1064</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -9077,7 +9101,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion documentation/html/Static.html
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion documentation/html/classes.list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2771,7 +2771,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ <h1 class="page-title">Source: components/Records/Record/Collections.vue</h1>
}
//Save searches for the policy
else if (tabName === 'conforming_resources') {
console.log("Hi")
_module.tabsData.tabs[tabName].data =
_module.currentRecord['fairsharingRecord'].savedSearches

Expand Down Expand Up @@ -377,7 +378,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,41 +144,41 @@ <h1 class="page-title">Source: components/Records/Record/GeneralInfo/SavedSearch
v-if="user().is_super_curator"
rounded
text
@click="confirmDeleteSavedSearch(search)"
@click="confirmunlinkSavedSearch(search)"
>
&lt;v-icon>mdi-delete&lt;/v-icon>
&lt;v-icon>mdi-link-off&lt;/v-icon>
&lt;/v-btn>
&lt;/div>


&lt;!-- Delete dialog box -->
&lt;!-- Unlink dialog box -->
&lt;v-dialog
v-model="confirmDelete"
v-model="confirmUnlink"
max-width="700px"
persistent
>
&lt;!-- Delete saved search -->
&lt;v-card v-if="deleteSavedSearchCard">
&lt;!-- Unlink saved search -->
&lt;v-card v-if="unlinkSavedSearchCard">
&lt;v-card-title class="text-h5">
Deleting saved search
Unlinking saved search
&lt;/v-card-title>
&lt;v-card-text>
This is will delete all instances of the search from FAIRsharing
This is will unlink instance of the search from this policy record.
&lt;/v-card-text>
&lt;v-card-actions>
&lt;v-spacer />
&lt;v-btn
class="white--text"
color="accent3"
@click="deleteSavedSearch(false)"
@click="unlinkSavedSearch(false)"
>
Cancel
&lt;/v-btn>
&lt;v-btn
class="white--text"
color="success"
:loading="deleteLoader"
@click="deleteSavedSearch(true)"
:loading="unlinkLoader"
@click="unlinkSavedSearch(true)"
>
OK
&lt;/v-btn>
Expand All @@ -194,6 +194,7 @@ <h1 class="page-title">Source: components/Records/Record/GeneralInfo/SavedSearch

import RecordStatus from "@/components/Records/Shared/RecordStatus.vue";
import RestClient from "@/lib/Client/RESTClient.js";
import saveSearch from "@/store";

const restClient = new RestClient();
export default {
Expand All @@ -202,10 +203,10 @@ <h1 class="page-title">Source: components/Records/Record/GeneralInfo/SavedSearch
data: () => {
return {
getSavedSearches: [],
confirmDelete: false,
deleteSavedSearchCard: false,
confirmUnlink: false,
unlinkSavedSearchCard: false,
selectedItem: {},
deleteLoader: false,
unlinkLoader: false,
};
},
computed: {
Expand All @@ -219,36 +220,78 @@ <h1 class="page-title">Source: components/Records/Record/GeneralInfo/SavedSearch
methods: {
...mapActions("record", ["fetchRecord"]),
/**
* Confirmation dialog to delete the saved search
* Confirmation dialog to unlink the saved search
*/
confirmDeleteSavedSearch(item) {
confirmunlinkSavedSearch(item) {
this.selectedItem = item;
this.confirmDelete = true;
this.deleteSavedSearchCard = true;
console.log("this.selectedItem::", this.selectedItem)
this.confirmUnlink = true;
this.unlinkSavedSearchCard = true;
},

/**
* Delete the saved search
* Unlink the saved search
* @param del - Boolean
*/
async deleteSavedSearch(del) {
async unlinkSavedSearch(del) {
if (del) {
this.deleteLoader = true;
let data = await restClient.deleteSavedSearch(
this.selectedItem["id"],
this.user().credentials.token
this.unlinkLoader = true;
//Filter the currentRecord to unlink
let linkRecord = this.selectedItem.fairsharingRecords.filter(({id}) => id !== this.currentRecord.fairsharingRecord.id);

//Array of id of the remaining record
linkRecord = linkRecord.map(({id}) => id)

let saveSearchObj = {
fairsharing_record_ids: linkRecord,
};

let updatedSearchResult = await restClient.updateSaveSearch(
this.selectedItem["id"],
saveSearchObj,
this.user().credentials.token
);
if (data["message"] === "success") {
await this.fetchRecord({
id: this.currentRecord.fairsharingRecord.id,
token: this.user().credentials.token,
});
this.getSavedSearches = this.getField("savedSearches");
}

//Commit the updated result to store
saveSearch.commit("saveSearch/setSaveSearchResult", updatedSearchResult);

//Update the page after unlinking the savedSearch
await this.fetchRecord({
id: this.currentRecord.fairsharingRecord.id,
token: this.user().credentials.token,
});

this.getSavedSearches = this.getField("savedSearches");
}
this.deleteLoader = false;
this.deleteSavedSearchCard = false;
this.confirmDelete = false;
this.unlinkLoader = false;
this.unlinkSavedSearchCard = false;
this.confirmUnlink = false;

},

// /**
// * Delete the saved search
// * @param del - Boolean
// */
// async unlinkSavedSearch(del) {
// if (del) {
// this.unlinkLoader = true;
// let data = await restClient.unlinkSavedSearch(
// this.selectedItem["id"],
// this.user().credentials.token
// );
// if (data["message"] === "success") {
// await this.fetchRecord({
// id: this.currentRecord.fairsharingRecord.id,
// token: this.user().credentials.token,
// });
// this.getSavedSearches = this.getField("savedSearches");
// }
// }
// this.unlinkLoader = false;
// this.unlinkSavedSearchCard = false;
// this.confirmUnlink = false;
// },
},
};
&lt;/script></pre>
Expand Down Expand Up @@ -296,7 +339,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a>

on Thu Jul 18th 2024
on Fri Jul 19th 2024

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
Loading

0 comments on commit adab05c

Please sign in to comment.