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

fix(FSADT1-1086): Email Address Pattern Found #691

Merged
merged 32 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
aa8cace
fix(FSADT1-1086): Email Address Pattern Found
mamartinezmejia Dec 20, 2023
3cef441
fix(FSADT1-1086): Email Address Pattern Found
mamartinezmejia Dec 27, 2023
bf7e84c
Merge branch 'main' into fix/fe/FSADT1-1086
mamartinezmejia Dec 27, 2023
c249722
Added comments
mamartinezmejia Dec 27, 2023
6b305b3
fix(FSADT1-1086): Email Address Pattern Found
mamartinezmejia Dec 27, 2023
8d33a46
no message
mamartinezmejia Dec 27, 2023
d9e1a99
no message
mamartinezmejia Dec 27, 2023
d570106
no message
mamartinezmejia Dec 27, 2023
0c26129
Fixing Security Hotspots
mamartinezmejia Dec 27, 2023
1018ed1
fix(FSADT1-1086): Email Address Pattern Found
mamartinezmejia Dec 27, 2023
7ef2e50
Merge branch 'main' into fix/fe/FSADT1-1086
mamartinezmejia Dec 29, 2023
c51e54b
Merge branch 'main' into fix/fe/FSADT1-1086
fterra-encora Jan 2, 2024
6c11a4d
Merge branch 'main' into fix/fe/FSADT1-1086
paulushcgcj Jan 2, 2024
d1a1fcd
Merge branch 'main' into fix/fe/FSADT1-1086
paulushcgcj Jan 2, 2024
879cb63
Merge branch 'main' into fix/fe/FSADT1-1086
paulushcgcj Jan 2, 2024
80fd383
- Upgraded Cypress
mamartinezmejia Jan 2, 2024
ca3dd71
test: Updated test accordingly
mamartinezmejia Jan 2, 2024
bec282a
test: Updated test accordingly
mamartinezmejia Jan 3, 2024
db930f2
Merge branch 'main' into fix/fe/FSADT1-1086
mamartinezmejia Jan 3, 2024
acd10e4
Merge branch 'main' into fix/fe/FSADT1-1086
mamartinezmejia Jan 3, 2024
6175b13
Fixed package-lock.json
mamartinezmejia Jan 3, 2024
ab4b96a
Merge branch 'main' into fix/fe/FSADT1-1086
mamartinezmejia Jan 3, 2024
3c340c3
Downgraded vite as it is not fully supported by Cypress
mamartinezmejia Jan 3, 2024
e294f7d
Downgraded vite as it is not fully supported by Cypress
mamartinezmejia Jan 3, 2024
1921c4a
Rebuilt package-lock.json
mamartinezmejia Jan 3, 2024
92b5564
Merge branch 'main' into fix/fe/FSADT1-1086
mamartinezmejia Jan 3, 2024
4929e40
chore: reverting cypress version due to conflict
paulushcgcj Jan 4, 2024
d7fd2ad
chore: updating deps
paulushcgcj Jan 4, 2024
cdccd06
Merge branch 'main' into fix/fe/FSADT1-1086
paulushcgcj Jan 4, 2024
137ae23
- Upgraded Cypress version
mamartinezmejia Jan 4, 2024
cc903ed
Pushed package-json again
mamartinezmejia Jan 4, 2024
fa8e4f9
Merge branch 'main' into fix/fe/FSADT1-1086
mamartinezmejia Jan 4, 2024
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
14 changes: 14 additions & 0 deletions frontend/src/assets/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1807,3 +1807,17 @@ Useful for scrolling to the *start* of an HTML element without having it covered
max-width: calc(100vw - 21rem);
}
}

.link-button {
background: none;
border: 0;
padding: 0;
margin: 0;
color: var(--light-theme-link-link-primary, #005cb8);
text-decoration: underline;
cursor: pointer;
}

.link-button:hover {
color: var(--light-theme-link-link-primary-hover, #00478f);
}
10 changes: 9 additions & 1 deletion frontend/src/components/MainHeaderComponent.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<script setup lang="ts">
import { ref, watchEffect, getCurrentInstance } from "vue";
import { openMailtoLink, getObfuscatedEmail } from "@/services/ForestClientService";

// Carbon
import "@carbon/web-components/es/components/button/index";
import "@carbon/web-components/es/components/ui-shell/index";
import type { CDSHeaderPanel } from "@carbon/web-components";
import type CDSHeaderGlobalAction from "@carbon/web-components/es/components/ui-shell/header-global-action";

// Composables
import { isSmallScreen, isMediumScreen } from "@/composables/useScreenSize";
import { useRoute } from "vue-router";
Expand Down Expand Up @@ -90,6 +93,8 @@ const onClickLogout = () => {
logoutModalActive.value = true;
}
}

const adminEmail = "[email protected]";
</script>

<template>
Expand Down Expand Up @@ -237,7 +242,10 @@ const onClickLogout = () => {
</cds-modal-header>
<cds-modal-body>
<p>
Can’t proceed with your application? Let us know by emailing your issue to <a href='mailto:[email protected]'>[email protected]</a> and we’ll get back to you.
Can’t proceed with your application? Let us know by emailing your issue to
<button class="link-button" @click="openMailtoLink(adminEmail)" aria-label="Contact Admin via Email">
<span v-bind:innerHTML="getObfuscatedEmail(adminEmail)"></span>
</button>
</p>
</cds-modal-body>
</cds-modal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { submissionValidation } from "@/helpers/validators/SubmissionValidators"
import { retrieveClientType, exportAddress } from "@/helpers/DataConversors";
// Importing session
import ForestClientUserSession from "@/helpers/ForestClientUserSession";
import { getEnumKeyByEnumValue } from "@/services/ForestClientService";
import { getEnumKeyByEnumValue, openMailtoLink, getObfuscatedEmail } from "@/services/ForestClientService";

//Defining the props and emiter to reveice the data and emit an update
const props = defineProps<{ data: FormDataDto; active: boolean }>();
Expand Down Expand Up @@ -223,6 +223,8 @@ watch(showBirthDate, (value) => {
validation.birthdate = true;
}
});

const bcRegistryEmail = "[email protected]";
</script>

<template>
Expand Down Expand Up @@ -297,7 +299,9 @@ watch(showBirthDate, (value) => {
<li class="body-compact-01">
If your name isn’t there, call BC Registry toll free at
<a href="tel:18775261526">1-877-526-1526</a> or email them at
<a href="mailto:[email protected]">[email protected]</a>.
<button class="link-button" @click="openMailtoLink(bcRegistryEmail)" aria-label="Contact BC Registry via Email">
<span v-bind:innerHTML="getObfuscatedEmail(bcRegistryEmail)"></span>
</button>.
</li>
</ol>
</div>
Expand Down
16 changes: 16 additions & 0 deletions frontend/src/services/ForestClientService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,19 @@ export const getEnumKeyByEnumValue = <T extends Record<string, any>>(enumObject:
const key = Object.keys(enumObject).find((x) => enumObject[x] === enumValue);
return key ? String(key) : "Unknown";
};

export const getObfuscatedEmail = email => {
const obfuscatedEmail = email.replace('@', '&#64;');
return obfuscatedEmail;
};

export const getMailtoLink = email => {
const encodedEmail = encodeURIComponent(email);
return 'mailto:' + encodedEmail;
};

export const openMailtoLink = (email) => {
const encodedEmail = encodeURIComponent(email);
const mailtoLink = 'mailto:' + encodedEmail;
location.assign(mailtoLink);
}
Loading