diff --git a/webiu-server/controllers/contributorController.js b/webiu-server/controllers/contributorController.js index d40a696..e637083 100644 --- a/webiu-server/controllers/contributorController.js +++ b/webiu-server/controllers/contributorController.js @@ -11,6 +11,8 @@ const getAllContributors = async (req, res) => { let finalResponse = {}; const orgName = 'c2siorg'; const repositories = await fetchRepositories(orgName); + console.log(repositories); + if (!repositories) { return res.status(500).json({ error: 'Failed to fetch repositories' }); diff --git a/webiu-ui/src/app/components/navbar/navbar.component.html b/webiu-ui/src/app/components/navbar/navbar.component.html index fb09a50..58f382f 100644 --- a/webiu-ui/src/app/components/navbar/navbar.component.html +++ b/webiu-ui/src/app/components/navbar/navbar.component.html @@ -1,8 +1,12 @@ - \ No newline at end of file + diff --git a/webiu-ui/src/app/components/navbar/navbar.component.scss b/webiu-ui/src/app/components/navbar/navbar.component.scss index 60be9c2..96a6649 100644 --- a/webiu-ui/src/app/components/navbar/navbar.component.scss +++ b/webiu-ui/src/app/components/navbar/navbar.component.scss @@ -1,7 +1,7 @@ .navbar { width: 100%; display: flex; - padding: 10px 50px; + padding: 10px 20px; justify-content: space-between; align-items: center; background: var(--navbar-bg); diff --git a/webiu-ui/src/app/components/navbar/navbar.component.ts b/webiu-ui/src/app/components/navbar/navbar.component.ts index f0c598d..0801bb7 100644 --- a/webiu-ui/src/app/components/navbar/navbar.component.ts +++ b/webiu-ui/src/app/components/navbar/navbar.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, HostListener, OnInit } from '@angular/core'; import { CommonModule } from '@angular/common'; import { Router, RouterModule } from '@angular/router'; import { ThemeService } from '../../services/theme.service'; @@ -68,4 +68,17 @@ export class NavbarComponent implements OnInit { window.location.href = 'http://localhost:5000/auth/github'; } + // Close login options if clicked outside + @HostListener('document:click', ['$event']) + onClickOutside(event: MouseEvent): void { + const loginOptionsElement = document.querySelector('.login-options'); + const loginButton = document.querySelector('.Login_Logout'); + + // If the click is outside of the login options or login button, close the login options + if (this.showLoginOptions && !loginOptionsElement?.contains(event.target as Node) && !loginButton?.contains(event.target as Node)) { + this.showLoginOptions = false; + } + } + } + diff --git a/webiu-ui/src/app/page/contributor-search/contributor-search.component.html b/webiu-ui/src/app/page/contributor-search/contributor-search.component.html index 8390646..b9259f0 100644 --- a/webiu-ui/src/app/page/contributor-search/contributor-search.component.html +++ b/webiu-ui/src/app/page/contributor-search/contributor-search.component.html @@ -1,27 +1,38 @@ -
+
+ +
+ +
+ -
+
-

Filter by repo

+

Filter by repo

@@ -29,9 +40,16 @@
- +

- No issues or pull requests found for this contributor. -

+ {{errorMessage}} +

diff --git a/webiu-ui/src/app/page/contributor-search/contributor-search.component.scss b/webiu-ui/src/app/page/contributor-search/contributor-search.component.scss index 2a3af90..e5f5ef9 100644 --- a/webiu-ui/src/app/page/contributor-search/contributor-search.component.scss +++ b/webiu-ui/src/app/page/contributor-search/contributor-search.component.scss @@ -1,61 +1,3 @@ -// .title { -// font-size: 24px; -// font-weight: 600; -// margin-bottom: 20px; -// text-align: center; -// } - -// .search-bar { -// display: flex; -// justify-content: center; -// margin-bottom: 20px; -// } - -// .search-input { -// padding: 10px; -// font-size: 16px; -// width: 300px; -// margin-right: 10px; -// border: 1px solid #ccc; -// border-radius: 4px; -// } - -// .search-button { -// padding: 10px 20px; -// background-color: #007bff; -// color: white; -// font-size: 16px; -// border: none; -// border-radius: 4px; -// cursor: pointer; -// transition: background-color 0.3s ease; -// } - -// .search-button:hover { -// background-color: #0056b3; -// } - -// .error-message { -// color: red; -// font-weight: bold; -// text-align: center; -// margin-top: 10px; -// } - -// .loading-message { -// text-align: center; -// font-size: 18px; -// font-weight: 500; -// color: #555; -// margin-top: 10px; -// } - -.no-data-message { - text-align: center; - font-size: 18px; - color: #777; - margin-top: 20px; -} .action-bar{ display: flex; justify-content: center; @@ -67,6 +9,7 @@ display: flex; justify-content: center; margin-top: 50px; + } .toggle-button { @@ -92,6 +35,7 @@ .filter-section { margin-top: 50px; margin-left: 50px; + width: 220px; color: #007bff; display: flex; justify-content: center; @@ -100,13 +44,12 @@ } @media (max-width: 768px) { - /* Adjust Action Bar */ .action-bar { - justify-content: center; + justify-content:end; margin: 0; } - + .toggle-buttons { flex-direction: column; align-items: center; @@ -207,12 +150,12 @@ .user-profile { display: flex; flex-direction: column; - align-items: center; width: fit-content; height: fit-content; margin: 0 auto; padding: 1rem; margin-top: -100px; + margin-left: 100px; } .profile-picture { @@ -257,6 +200,7 @@ width: 100px; height: 100px; margin-top: 70px; + margin-right: 100px; } .username { @@ -298,5 +242,68 @@ font-size: 0.7rem; } } +.hidden{ + display: none; +} +.no-data-message { + font-size: 18px; + color: #777; + margin-top: 20px; + font-weight: 500; + padding: 15px; + margin-right: 250px; + background: transparent; + text-align: center; +} +/* Responsive Styling */ +@media (max-width: 768px) { + .no-data-message { + margin-right: 0; + margin-left: 20px; + font-size: 16px; + padding: 12px; + } +} +@media (max-width: 480px) { + .no-data-message { + margin-left: 10px; + margin-right: 10px; + font-size: 14px; + padding: 10px; + } +} +.icon-gap { + color: #535252; +} + +.icon-closed { + color: #28a745; +} +.icon-open { + color: #007bff; +} + +.loadspinner { + color: #007bff; + display: flex; + justify-content: center; + margin-top: 100px; + font-size: 32px ; +} + +.center-container { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; /* Full viewport height */ +} +.error-message { + font-size: 1.2rem; + color: red; + text-align: center; +} +.filter-name{ + width: 410px; +} \ No newline at end of file diff --git a/webiu-ui/src/app/page/contributor-search/contributor-search.component.ts b/webiu-ui/src/app/page/contributor-search/contributor-search.component.ts index 49a2ae1..7713b0a 100644 --- a/webiu-ui/src/app/page/contributor-search/contributor-search.component.ts +++ b/webiu-ui/src/app/page/contributor-search/contributor-search.component.ts @@ -116,4 +116,10 @@ export class ContributorSearchComponent { const updatedAt = new Date(date); return formatDistanceToNow(updatedAt, { addSuffix: true }); } + get hasData(): boolean { + return this.filteredIssues.length > 0 || this.filteredPullRequests.length > 0; + } + } + + diff --git a/webiu-ui/src/app/page/contributors/contributors.component.html b/webiu-ui/src/app/page/contributors/contributors.component.html index 6f7a033..5a2c7c5 100644 --- a/webiu-ui/src/app/page/contributors/contributors.component.html +++ b/webiu-ui/src/app/page/contributors/contributors.component.html @@ -1,4 +1,3 @@ -
@@ -16,7 +15,7 @@
- filter by repository + Filter by repository
- +
- - - -
@for (profile of displayProfiles; track $index) { - - - }
-
\ No newline at end of file +

+ No contributors found matching the search criteria +

+ diff --git a/webiu-ui/src/app/page/contributors/contributors.component.scss b/webiu-ui/src/app/page/contributors/contributors.component.scss index 70d40ab..9132a1f 100644 --- a/webiu-ui/src/app/page/contributors/contributors.component.scss +++ b/webiu-ui/src/app/page/contributors/contributors.component.scss @@ -251,11 +251,15 @@ } -.loading-spinner { - +i { color: #007bff; - - + display: flex; + justify-content: center; } - +.no-contributors-message { + text-align: center; + color: #888; + font-size: 1.2em; + margin-top: 20px; +}