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 18, 2024
2 parents 1d20a7e + be543fa commit 6593549
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 44 deletions.
20 changes: 20 additions & 0 deletions documentation/html/components_Records_Record_Collections.vue.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,12 @@ <h1 class="page-title">Source: components/Records/Record/Collections.vue</h1>
v-for="(tabItem,tabItemIndex) in filterList"
:key="tabItem+'_'+tabItemIndex"
>
&lt;SavedSearches
v-if="tabItem.type === 'conforming_resources'"
/>

&lt;v-virtual-scroll
v-else
:items="tabItem.data"
height="400"
item-height="130"
Expand Down Expand Up @@ -210,6 +215,7 @@ <h1 class="page-title">Source: components/Records/Record/Collections.vue</h1>
&lt;script>
import {mapState} from "vuex";

import SavedSearches from '@/components/Records/Record/GeneralInfo/SavedSearches'
import SectionTitle from '@/components/Records/Record/SectionTitle';
import RecordStatus from "@/components/Records/Shared/RecordStatus";
import recordRelationShipsDefinitions from "@/data/RecordRelationShipsDefinitions.json";
Expand All @@ -221,6 +227,7 @@ <h1 class="page-title">Source: components/Records/Record/Collections.vue</h1>
components: {
RecordStatus,
SectionTitle,
SavedSearches
},
mixins: [stringUtils, recordTabUtils],
props:{
Expand Down Expand Up @@ -255,6 +262,12 @@ <h1 class="page-title">Source: components/Records/Record/Collections.vue</h1>
data: [],
count:0
}
_module.tabsData.tabs.conforming_resources = {
registry: ['Policy'],
data: [],
count:0,
type:'conforming_resources'
}
}
else {
_module.tabsData.tabs.in_policies = {
Expand Down Expand Up @@ -282,6 +295,13 @@ <h1 class="page-title">Source: components/Records/Record/Collections.vue</h1>
)
_module.tabsData.tabs[tabName].count = _module.tabsData.tabs[tabName].data.length;
}
//Save searches for the policy
else if (tabName === 'conforming_resources') {
_module.tabsData.tabs[tabName].data =
_module.currentRecord['fairsharingRecord'].savedSearches

_module.tabsData.tabs[tabName].count = _module.currentRecord['fairsharingRecord'].savedSearches.length;
}
// All incoming collections.
else {
_module.tabsData.tabs[tabName].data = _module.prepareAssociations(
Expand Down
39 changes: 39 additions & 0 deletions documentation/html/lib_Client_RESTClient.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,45 @@ <h1 class="page-title">Source: lib/Client/RESTClient.js</h1>
let response = await _client.executeQuery(request);
return response.data;
}

/**
* Save the advancedSearch results to the user
* @param {Object} saveSearchObj - save search object having required parameters
* @param {String} jwt - the user jwt
* @returns {Promise}
*/
/* Ignoring because of 401 access denied in test case */
/* istanbul ignore next */
async saveSearch(saveSearchObj, jwt) {
let _client = this;
const request = {
method: "post",
baseURL: _client.baseURL + "/saved_searches",
headers: this.auth_headers(jwt),
data: { saved_search: saveSearchObj },
};
let response = await _client.executeQuery(request);
return response.data;
}

/**
* Delete the saved search
* @param {Number} savedSearchId - the id of the savedSearch to remove
* @param {String} userToken - the user jwt
* @returns {Promise}
*/
/* Ignoring because of 401 access denied in test case */
/* istanbul ignore next */
async deleteSavedSearch(savedSearchId, jwt) {
let _client = this;
const request = {
method: "delete",
baseURL: _client.baseURL + "/saved_searches/" + savedSearchId,
headers: this.auth_headers(jwt),
};
let response = await _client.executeQuery(request);
return response.data;
}
}

export default RESTClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,21 @@ <h1 class="page-title">Source: views/AdvancedSearch/AdvancedSearchResultTable.vu
fluid
class="pa-5 mb-15"
>
&lt;v-btn
class="mb-2"
color="primary"
small
@click="downloadResults()"
&lt;div
:class="
$vuetify.breakpoint.mdAndUp ? 'buttonWrapper' : 'd-flex flex-column'
"
>
Download Results
&lt;/v-btn>

&lt;v-btn
class="mb-2"
color="primary"
small
@click="downloadResults()"
>
Download Results
&lt;/v-btn>
&lt;SaveSearchButton />
&lt;/div>
&lt;p class="body-2 mb-0">
&lt;v-icon
x-small
Expand Down Expand Up @@ -253,14 +259,15 @@ <h1 class="page-title">Source: views/AdvancedSearch/AdvancedSearchResultTable.vu
&lt;script>
import { mapActions, mapGetters } from "vuex";

import SaveSearchButton from "@/components/Records/Search/SaveSearch/SaveSearchButton.vue";
import RecordStatus from "@/components/Records/Shared/RecordStatus.vue";
import TagChips from "@/components/Records/Shared/TagChips.vue";
import advancedSearch from "@/store";
import recordsCardUtils from "@/utils/recordsCardUtils";
import ErrorPage from "@/views/Errors/404.vue";
export default {
name: "AdvancedSearchResultTable",
components: { RecordStatus, TagChips, ErrorPage },
components: { RecordStatus, TagChips, ErrorPage, SaveSearchButton },
mixins: [recordsCardUtils],
data() {
return {
Expand Down Expand Up @@ -396,13 +403,20 @@ <h1 class="page-title">Source: views/AdvancedSearch/AdvancedSearchResultTable.vu
},
};
&lt;/script>
&lt;style scoped>
&lt;style lang="scss" scoped>
.infoIcon {
border: 1px solid;
border-radius: 50%;
padding: 3px 6px;
margin: -2px 2px 0 0;
}
.buttonWrapper {
position: relative;
.saveSearchResults {
position: absolute;
left: 40%;
}
}
&lt;/style>
</pre>
</article>
Expand Down
91 changes: 57 additions & 34 deletions documentation/html/views_Users_Login_Login.vue.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h1 class="page-title">Source: views/Users/Login/Login.vue</h1>
id="loginPage"
ref="loginPage"
v-model="formValid"
class="login"
class="login mb-9"
style="background: white"
>
&lt;v-container>
Expand All @@ -105,12 +105,14 @@ <h1 class="page-title">Source: views/Users/Login/Login.vue</h1>
&lt;v-col
cols="12"
sm="12"
:md="!popUp ? '8' : '12' "
:lg="!popUp ? '8' : '12' "
:xl="!popUp ? '5' : '12' "
:md="!popUp ? '8' : '12'"
:lg="!popUp ? '8' : '12'"
:xl="!popUp ? '5' : '12'"
>
&lt;v-card :flat="popUp">
&lt;v-card-title :class="{'blue white--text mb-5': !popUp, 'py-0 mb-5': popUp}">
&lt;v-card-title
:class="{ 'blue white--text mb-5': !popUp, 'py-0 mb-5': popUp }"
>
&lt;h2 class="ma-0">
{{ currentPanel | capitalize }}
&lt;/h2>
Expand All @@ -128,7 +130,11 @@ <h1 class="page-title">Source: views/Users/Login/Login.vue</h1>
&lt;v-btn
class="text-center teal white--text px-2"
href="/users/resendConfirmation"
@click="()=>{$emit('ClosePopup', true)}"
@click="
() => {
$emit('ClosePopup', true);
}
"
>
Resend me the confirmation email
&lt;/v-btn>
Expand Down Expand Up @@ -156,7 +162,7 @@ <h1 class="page-title">Source: views/Users/Login/Login.vue</h1>
left
class="mr-5"
>
{{ 'fab fa-' + provider.name.toLowerCase() }}
{{ "fab fa-" + provider.name.toLowerCase() }}
&lt;/v-icon>
&lt;v-layout>with {{ provider.name }}&lt;/v-layout>
&lt;/v-layout>
Expand All @@ -165,7 +171,6 @@ <h1 class="page-title">Source: views/Users/Login/Login.vue</h1>
&lt;/v-list>
&lt;/v-card-text>


&lt;!-- card content // Form -->
&lt;v-card-text v-if="currentPanel === 'login'">
&lt;v-form
Expand Down Expand Up @@ -199,24 +204,42 @@ <h1 class="page-title">Source: views/Users/Login/Login.vue</h1>

&lt;v-card-text class="text-center py-1">
&lt;router-link to="/accounts/forgotPassword">
&lt;span @click="()=>{$emit('ClosePopup', true)}">Forgotten your password?&lt;/span>
&lt;span
@click="
() => {
$emit('ClosePopup', true);
}
"
>Forgotten your password?&lt;/span>
&lt;/router-link>
&lt;v-divider />
&lt;router-link to="/accounts/signup">
&lt;span @click="()=>{$emit('ClosePopup', true)}">Need to create a new account?&lt;/span>
&lt;span
@click="
() => {
$emit('ClosePopup', true);
}
"
>Need to create a new account?&lt;/span>
&lt;/router-link>
&lt;v-divider />
&lt;a
href="https://fairsharing.gitbook.io/fairsharing/#accessing-fairsharing-through-3rd-party-accounts"
target="_blank"
>
&lt;span @click="()=>{$emit('ClosePopup', true)}">Can't login with ORCID?&lt;/span>
&lt;span
@click="
() => {
$emit('ClosePopup', true);
}
"
>Can't login with ORCID?&lt;/span>
&lt;/a>
&lt;/v-card-text>

&lt;v-card-actions class="mt-2 justify-center">
&lt;v-btn
class=" px-4"
class="px-4"
light
color="primary"
:disabled="!formValid"
Expand Down Expand Up @@ -246,7 +269,7 @@ <h1 class="page-title">Source: views/Users/Login/Login.vue</h1>
*/
export default {
name: "Login",
components: {MessageHandler},
components: { MessageHandler },
mixins: [stringUtils],
props: {
redirect: {
Expand Down Expand Up @@ -282,30 +305,33 @@ <h1 class="page-title">Source: views/Users/Login/Login.vue</h1>
name: "GitHub",
color: "black white--text",
callback: process.env.VUE_APP_API_ENDPOINT + "/users/auth/github",
}
},
],
rules: {
isRequired: function(){return isRequired()},
isRequired: function () {
return isRequired();
},
},
formValid: false
}
formValid: false,
};
},
computed: {
...mapState("users", ["messages", "user"]),
},
methods: {
...mapActions('users', ['login', 'logout']),
...mapActions("users", ["login", "logout"]),
async logUser() {
const _module = this;
const user = {
"name": _module.loginData.name,
"password": _module.loginData.password
name: _module.loginData.name,
password: _module.loginData.password,
};
_module.$emit('ClosePopup',false);
_module.$emit("ClosePopup", false);
await _module.login(user);

if (_module.messages().login.error) {
const confirmationError = "You have to confirm your email address before continuing.";
const confirmationError =
"You have to confirm your email address before continuing.";
if (_module.messages().login.message === confirmationError) {
_module.resendButton = true;
}
Expand All @@ -315,13 +341,12 @@ <h1 class="page-title">Source: views/Users/Login/Login.vue</h1>
if (_module.redirect) {
if (goTo) {
_module.$router.push({
path: goTo
})
}
else {
path: goTo,
});
} else {
_module.$router.push({
path: "/accounts/profile"
})
path: "/accounts/profile",
});
}
}
}
Expand All @@ -332,7 +357,7 @@ <h1 class="page-title">Source: views/Users/Login/Login.vue</h1>
if (goTo) {
return `?return_to=${goTo}`;
}
return '';
return "";
},
getCurrentLocation() {
let loc = this.$router.currentRoute.path;
Expand All @@ -347,20 +372,18 @@ <h1 class="page-title">Source: views/Users/Login/Login.vue</h1>
}
return `?origin=${origin}`;
}
}
}
},
};
&lt;/script>

&lt;style scoped>
#loginPage a {
text-decoration: none !important;
}

.v-card__text
{
.v-card__text {
width: auto;
}

&lt;/style>
</pre>
</article>
Expand Down

0 comments on commit 6593549

Please sign in to comment.