Skip to content

Commit

Permalink
Merge pull request #5266 from kiva/MP-67-fe-borrower-application-nav-…
Browse files Browse the repository at this point in the history
…item-not-showing-up-in-new-pages

feat: show link to borrower application
  • Loading branch information
dyersituations authored Apr 24, 2024
2 parents 8c5007d + 196525b commit fc0ebd4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
9 changes: 8 additions & 1 deletion server/util/getSessionCookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ const decodeCookieValue = value => {

function getSessionCookies(url = '', requestCookies = {}) {
return new Promise((resolve, reject) => {
if (url.length && (!requestCookies.kv || !requestCookies.kvis || !requestCookies.kvbskt)) {
if (url.length
&& (
!requestCookies.kv
|| !requestCookies.kvis
|| !requestCookies.kvbskt
|| !requestCookies.kvborrowerapplicant
)
) {
fetch(url, {
headers: {
Cookie: getCookieString(requestCookies),
Expand Down
26 changes: 25 additions & 1 deletion src/components/WwwFrame/Menus/TheMyKivaSecondaryMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@
<the-settings-tertiary-menu />
</kv-dropdown>
</li>
<li class="tw-inline-block" v-if="isBorrowerApplicant">
<router-link
to="/my/borrower/application"
active-class="tw-underline"
class="desktop-link"
v-kv-track-event="['SecondaryNav','click-MyKiva-Borrower-application']"
>
Borrower application
</router-link>
</li>
<li class="tw-inline-block" v-if="isBorrower">
<router-link
to="/my/borrower"
Expand Down Expand Up @@ -139,6 +149,15 @@
Settings
</router-link>
</li>
<li v-if="isBorrowerApplicant">
<router-link
to="/my/borrower/application"
class="mobile-link"
v-kv-track-event="['SecondaryNav','click-MyKiva-Borrower-application']"
>
Borrower application
</router-link>
</li>
<li v-if="isBorrower">
<router-link
to="/my/borrower"
Expand Down Expand Up @@ -179,6 +198,8 @@ import TheSettingsTertiaryMenu from '@/components/WwwFrame/Menus/TheSettingsTert
import KvMaterialIcon from '~/@kiva/kv-components/vue/KvMaterialIcon';
import KvPageContainer from '~/@kiva/kv-components/vue/KvPageContainer';
const BORROWER_APPLICANT_COOKIE_NAME = 'kvborrowerapplicant';
export default {
name: 'TheMyKivaSecondaryMenu',
components: {
Expand Down Expand Up @@ -220,7 +241,10 @@ export default {
computed: {
myKivaCategory() {
return this.$route.path.split('/')[1];
}
},
isBorrowerApplicant() {
return !this.isBorrower && this.cookieStore.get(BORROWER_APPLICANT_COOKIE_NAME)?.toLowerCase() === 'true';
},
},
methods: {
toggle() {
Expand Down

0 comments on commit fc0ebd4

Please sign in to comment.