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

Feature/repository links for webpages #863

Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
462f579
fix: Added footer contaning repo link for every webpage
shantanu-02 Sep 28, 2024
c223021
fix: Added footer contaning repo link for every webpage
shantanu-02 Sep 28, 2024
2c52438
Merge branch 'develop' into feature/repository-links-for-webpages
shantanu-02 Sep 30, 2024
98677bd
Enhancement: Added tests for new URLs
shantanu-02 Sep 30, 2024
8388345
Enhancement: Added tests for new URLs
shantanu-02 Sep 30, 2024
2008112
Fix: Removed Live URLs which do not have footer from testing
shantanu-02 Sep 30, 2024
6905bb3
Merge branch 'Real-Dev-Squad:develop' into feature/repository-links-f…
shantanu-02 Oct 1, 2024
91db11c
Merge branch 'Real-Dev-Squad:develop' into feature/repository-links-f…
shantanu-02 Oct 3, 2024
bbce207
Enhancement: Fixed position for footer
shantanu-02 Oct 6, 2024
1a7ee36
fix: removed commented content
shantanu-02 Oct 8, 2024
e403ba1
Enhancement: Used adata-test-id instead of class/id
shantanu-02 Oct 8, 2024
4bebd32
Fix: footer position styling
shantanu-02 Oct 8, 2024
6152ac4
Fix: changes using data-test-id
shantanu-02 Oct 8, 2024
3e13378
Fix: Prettier changes
shantanu-02 Oct 8, 2024
5a2b04e
Merge branch 'Real-Dev-Squad:develop' into feature/repository-links-f…
shantanu-02 Oct 8, 2024
28232fe
Fix: minor bug fixes
shantanu-02 Oct 9, 2024
44dce3b
Merge branch 'feature/repository-links-for-webpages' of https://githu…
shantanu-02 Oct 9, 2024
a7f0772
Merge branch 'Real-Dev-Squad:develop' into feature/repository-links-f…
shantanu-02 Oct 10, 2024
212e1e1
Enhancement: Made reusable footer component
shantanu-02 Oct 10, 2024
f272e59
Enhancement: Replaced footer of webpages with footer component
shantanu-02 Oct 10, 2024
8ba5ac6
Merge branch 'feature/repository-links-for-webpages' of https://githu…
shantanu-02 Oct 10, 2024
6c13574
Fix: Minor fixes
shantanu-02 Oct 11, 2024
11d6f12
Merge branch 'Real-Dev-Squad:develop' into feature/repository-links-f…
shantanu-02 Oct 11, 2024
d4d8868
Fix: Removed additional footers
shantanu-02 Oct 12, 2024
2e6b739
Merge branch 'feature/repository-links-for-webpages' of https://githu…
shantanu-02 Oct 12, 2024
74d4f03
Fix: Removed additional footers
shantanu-02 Oct 12, 2024
8ebf56f
Fix: Removed additional footers
shantanu-02 Oct 12, 2024
c87c090
Fix: Added styles in global stylesheet
shantanu-02 Oct 12, 2024
cc8be59
Merge branch 'Real-Dev-Squad:develop' into feature/repository-links-f…
shantanu-02 Oct 15, 2024
41845a9
Fix: Minor fix of stylesheet
shantanu-02 Oct 15, 2024
cd03f11
Merge branch 'feature/repository-links-for-webpages' of https://githu…
shantanu-02 Oct 15, 2024
363767b
Fix: Test timeout error
shantanu-02 Oct 15, 2024
fa11aad
Merge branch 'develop' into feature/repository-links-for-webpages
vinit717 Oct 16, 2024
71ab40a
Fix: Using data-test-id instead of classes
shantanu-02 Oct 16, 2024
f3b907d
Merge branch 'feature/repository-links-for-webpages' of https://githu…
shantanu-02 Oct 16, 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
31 changes: 31 additions & 0 deletions __tests__/applications/applications.test.js
shantanu-02 marked this conversation as resolved.
Show resolved Hide resolved
shantanu-02 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,35 @@ describe('Applications page', () => {
);
await page.waitForNetworkIdle();
});

it('should display the footer with the correct repo link', async () => {
const footer = await page.$('[data-test-id="footer"]');
expect(footer).toBeTruthy();

const infoRepo = await footer.$('[data-test-id="info-repo"]');
expect(infoRepo).toBeTruthy();

const repoLink = await infoRepo.$('[data-test-id="repo-link"]');
expect(repoLink).toBeTruthy();

const repoLinkHref = await page.evaluate((el) => el.href, repoLink);
expect(repoLinkHref).toBe(
'https://github.com/Real-Dev-Squad/website-dashboard',
);

const repoLinkTarget = await page.evaluate((el) => el.target, repoLink);
expect(repoLinkTarget).toBe('_blank');

const repoLinkRel = await page.evaluate((el) => el.rel, repoLink);
expect(repoLinkRel).toBe('noopener noreferrer');

const repoLinkText = await page.evaluate((el) => el.innerText, repoLink);
expect(repoLinkText).toBe('open sourced repo');

const repoLinkClass = await page.evaluate((el) => el.className, repoLink);
expect(repoLinkClass).toBe('');

const repoLinkStyle = await page.evaluate((el) => el.style, repoLink);
expect(repoLinkStyle).toBeTruthy();
});
});
31 changes: 31 additions & 0 deletions __tests__/groups/group.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,35 @@ describe('Discord Groups Page', () => {

expect(noGroupDiv).toBeTruthy();
});

it('should display the footer with the correct repo link', async () => {
const footer = await page.$('[data-test-id="footer"]');
expect(footer).toBeTruthy();

const infoRepo = await footer.$('[data-test-id="info-repo"]');
expect(infoRepo).toBeTruthy();

const repoLink = await infoRepo.$('[data-test-id="repo-link"]');
expect(repoLink).toBeTruthy();

const repoLinkHref = await page.evaluate((el) => el.href, repoLink);
expect(repoLinkHref).toBe(
'https://github.com/Real-Dev-Squad/website-dashboard',
);

const repoLinkTarget = await page.evaluate((el) => el.target, repoLink);
expect(repoLinkTarget).toBe('_blank');

const repoLinkRel = await page.evaluate((el) => el.rel, repoLink);
expect(repoLinkRel).toBe('noopener noreferrer');

const repoLinkText = await page.evaluate((el) => el.innerText, repoLink);
expect(repoLinkText).toBe('open sourced repo');

const repoLinkClass = await page.evaluate((el) => el.className, repoLink);
expect(repoLinkClass).toBe('');

const repoLinkStyle = await page.evaluate((el) => el.style, repoLink);
expect(repoLinkStyle).toBeTruthy();
});
});
6 changes: 3 additions & 3 deletions __tests__/home/home.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,13 @@ describe('Home Page', () => {
});

it('should display the footer with the correct repo link', async () => {
const footer = await page.$('footer');
const footer = await page.$('[data-test-id="footer"]');
expect(footer).toBeTruthy();

const infoRepo = await footer.$('.info-repo');
const infoRepo = await footer.$('[data-test-id="info-repo"]');
expect(infoRepo).toBeTruthy();

const repoLink = await infoRepo.$('a');
const repoLink = await infoRepo.$('[data-test-id="repo-link"]');
expect(repoLink).toBeTruthy();

const repoLinkHref = await page.evaluate((el) => el.href, repoLink);
Expand Down
7 changes: 7 additions & 0 deletions applications/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,12 @@ <h2>Status</h2>
<div class="loader hidden">Loading...</div>
<div id="page_bottom_element"></div>
</div>
<script src="../footer/footerComponent.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
const href = 'https://github.com/Real-Dev-Squad/website-dashboard';
loadFooter(href);
});
</script>
</body>
</html>
7 changes: 7 additions & 0 deletions applications/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ body {
text-align: center;
}

.footer {
width: 100vw;
text-align: center;
position: fixed;
bottom: 4px;
}

shantanu-02 marked this conversation as resolved.
Show resolved Hide resolved
.container {
max-width: 1100px;
margin: 0 auto;
Expand Down
23 changes: 23 additions & 0 deletions footer/footerComponent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// footerComponent.js

// Define the loadFooter function that takes an href argument
function loadFooter(href) {
const footerHTML = `
<footer class="footer" data-test-id="footer">
<p class="info-repo" data-test-id="info-repo">
The contents of this website are deployed from this
<a
href="${href}"
target="_blank"
rel="noopener noreferrer"
data-test-id="repo-link"
>
open sourced repo
</a>
</p>
</footer>
`;

// Insert the footer into the DOM
document.body.insertAdjacentHTML('beforeend', footerHTML);
}
shantanu-02 marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions footerTest.js
shantanu-02 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
const puppeteer = require('puppeteer');
const EventEmitter = require('events');

EventEmitter.defaultMaxListeners = 15;
shantanu-02 marked this conversation as resolved.
Show resolved Hide resolved

let config = {
launchOptions: {
Expand Down
18 changes: 7 additions & 11 deletions goal/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,13 @@ <h2>Page not found</h2>
<a href="/">Go to homepage</a>
</div>
</div>
<footer>
<p class="info-repo">
The contents of this website are deployed from this
<a
href="https://github.com/Real-Dev-Squad/website-dashboard"
target="_blank"
rel="noopener noreferrer"
>open sourced repo</a
>
</p>
</footer>
<script>
document.addEventListener('DOMContentLoaded', () => {
const href = 'https://github.com/Real-Dev-Squad/website-dashboard';
loadFooter(href);
});
</script>
<script src="../../footer/footerComponent.js"></script>
<script src="script.js"></script>
</body>
</html>
9 changes: 8 additions & 1 deletion groups/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,19 @@
<div class="create-group">
<button class="button">
<span class="button__text">Create Group</span>
<img src="assets/plus.svg" class="button__icon" />
<img src="assets/plus.svg" alt="+" class="button__icon" />
</button>
</div>
</section>
<div class="group-container"></div>
</main>
<script src="../footer/footerComponent.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
const href = 'https://github.com/Real-Dev-Squad/website-dashboard';
shantanu-02 marked this conversation as resolved.
Show resolved Hide resolved
loadFooter(href);
});
</script>
</body>
<div class="toast">
<div class="toast__message"></div>
Expand Down
5 changes: 5 additions & 0 deletions groups/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ body {
flex-direction: column;
}

.footer {
shantanu-02 marked this conversation as resolved.
Show resolved Hide resolved
position: fixed;
bottom: 4px;
}

.container {
flex-grow: 1;
width: clamp(300px, 100%, 1000px);
Expand Down
19 changes: 7 additions & 12 deletions identity-service-logs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,12 @@ <h1>Identity Service Logs</h1>
<div class="wrapperDiv"></div>
<p id="loader">Loading...</p>
<div id="page_bottom_element"></div>
<footer id="footer">
<p class="info-repo">
The contents of this website are deployed from this
<a
href="https://github.com/Real-Dev-Squad/website-dashboard"
target="_blank"
rel="noopener noreferrer"
>
open sourced repo
</a>
</p>
</footer>
<script>
document.addEventListener('DOMContentLoaded', () => {
const href = 'https://github.com/Real-Dev-Squad/website-dashboard';
loadFooter(href);
});
</script>
<script src="../../footer/footerComponent.js"></script>
</body>
</html>
5 changes: 5 additions & 0 deletions identity-service-logs/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ nav h1::before {
background-color: #000000;
}

.footer {
position: fixed;
bottom: 4px;
}

.wrapperDiv {
display: flex;
flex-direction: column;
Expand Down
20 changes: 7 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,12 @@
</div>
</div>
</section>

<footer>
<p class="info-repo">
The contents of this website are deployed from this
<a
href="https://github.com/Real-Dev-Squad/website-dashboard"
target="_blank"
rel="noopener noreferrer"
>
open sourced repo
</a>
</p>
</footer>
<script src="../footer/footerComponent.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
const href = 'https://github.com/Real-Dev-Squad/website-dashboard';
loadFooter(href);
});
</script>
</body>
</html>
19 changes: 7 additions & 12 deletions online-members/online-members.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,12 @@
<!-- Members -->
<div class="users-container" id="users-container"></div>
</div>
<footer>
<p class="info-repo">
The contents of this website are deployed from this
<a
href="https://github.com/Real-Dev-Squad/website-dashboard"
target="_blank"
rel="noopener noreferrer"
>
open sourced repo
</a>
</p>
</footer>
<script>
document.addEventListener('DOMContentLoaded', () => {
const href = 'https://github.com/Real-Dev-Squad/website-dashboard';
loadFooter(href);
});
</script>
<script src="../../footer/footerComponent.js"></script>
</body>
</html>
20 changes: 7 additions & 13 deletions profile/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,12 @@ <h1>PROFILE DIFFERENCES</h1>
</nav>

<p id="loader">Loading...</p>

<footer id="footer">
<p class="info-repo">
The contents of this website are deployed from this
<a
href="https://github.com/Real-Dev-Squad/website-dashboard"
target="_blank"
rel="noopener noreferrer"
>
open sourced repo
</a>
</p>
</footer>
<script>
document.addEventListener('DOMContentLoaded', () => {
const href = 'https://github.com/Real-Dev-Squad/website-dashboard';
loadFooter(href);
});
</script>
<script src="../../footer/footerComponent.js"></script>
</body>
</html>
5 changes: 5 additions & 0 deletions profile/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ nav h1::before {
background-color: #000000;
}

.footer {
position: fixed;
bottom: 5px;
}

.wrapperDiv {
display: flex;
flex-direction: column;
Expand Down
21 changes: 7 additions & 14 deletions standup/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,13 @@ <h1 class="user-standup-nav">User Standup</h1>

<section class="table-container" id="table-container"></section>
</main>

<footer>
<p class="info-repo">
The contents of this website are deployed from this
<a
class="info-repo-link"
href="https://github.com/Real-Dev-Squad/website-dashboard"
target="_blank"
rel="noopener noreferrer"
>
Open sourced repo
</a>
</p>
</footer>
<script>
document.addEventListener('DOMContentLoaded', () => {
const href = 'https://github.com/Real-Dev-Squad/website-dashboard';
loadFooter(href);
});
</script>
<script src="../../footer/footerComponent.js"></script>
<script src="/helpers/loadENV.js"></script>
<script src="/constants.js"></script>
<script src="/standup/utils.js"></script>
Expand Down
19 changes: 7 additions & 12 deletions task/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -287,21 +287,16 @@ <h4 class="suggested-users-title">Suggested users</h4>
/>
</div>
</form>

<footer>
<p class="info-repo">
The contents of this website are deployed from this
<a
href="https://github.com/Real-Dev-Squad/website-dashboard"
target="_blank"
rel="noopener noreferrer"
>open sourced repo</a
>
</p>
</footer>
<script>
document.addEventListener('DOMContentLoaded', () => {
const href = 'https://github.com/Real-Dev-Squad/website-dashboard';
loadFooter(href);
});
</script>
<div class="hidden" id="submit-loader">
<div class="loader"></div>
</div>
<script src="../../footer/footerComponent.js"></script>
<script src="/helpers/loadENV.js"></script>
<script src="/task/script.js"></script>
</div>
Expand Down
Loading
Loading