Skip to content

Commit

Permalink
Merge branch 'development' into Koushica_Dark_Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
CodewithKoushica committed Feb 3, 2025
2 parents a33ee12 + ff1e16b commit f46027c
Show file tree
Hide file tree
Showing 38 changed files with 963 additions and 649 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
command: 'sudo npm install'
- run:
name: Run react build
command: 'sudo REACT_APP_APIENDPOINT=$APIENDPOINT_PROD REACT_APP_DEF_PWD=$REACT_APP_DEF_PWD REACT_APP_SENTRY_URL=$SENTRY_URL_PROD SKIP_PREFLIGHT_CHECK=true NODE_OPTIONS=$NODE_OPTIONS npm run build && sudo mv build/index.html build/200.html'
command: 'sudo REACT_APP_APIENDPOINT=$APIENDPOINT_PROD REACT_APP_DEF_PWD=$REACT_APP_DEF_PWD REACT_APP_SENTRY_URL=$SENTRY_URL_PROD SKIP_PREFLIGHT_CHECK=true NODE_OPTIONS="$NODE_OPTIONS --max_old_space_size=4096" npm run build --prod && sudo mv build/index.html build/200.html'
- run:
name: Export error log if 'Build the React client' failed
command: |
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
command: npm install
- run:
name: Build the React client
command: export REACT_APP_APIENDPOINT=$APIENDPOINT_DEV REACT_APP_DEF_PWD=$REACT_APP_DEF_PWD REACT_APP_SENTRY_URL=$SENTRY_URL_DEV SKIP_PREFLIGHT_CHECK=true NODE_OPTIONS=$NODE_OPTIONS && npm run build
command: export REACT_APP_APIENDPOINT=$APIENDPOINT_DEV REACT_APP_DEF_PWD=$REACT_APP_DEF_PWD REACT_APP_SENTRY_URL=$SENTRY_URL_DEV SKIP_PREFLIGHT_CHECK=true NODE_OPTIONS="$NODE_OPTIONS --max_old_space_size=4096" && npm run build --prod
- run:
name: Export error log if 'Build the React client' failed
command: |
Expand All @@ -84,7 +84,7 @@ jobs:
name: Deploy compiled app to surge.sh on $SURGE_DOMAIN_DEV
command: ./node_modules/.bin/surge --domain $SURGE_DOMAIN_DEV --project ./build
- run:
name: Deploy compiled app to surge.sh on $SURGE_DOMAIN_DEV
name: Deploy compiled app to surge.sh on $SURGE_DOMAIN_DEV1
command: ./node_modules/.bin/surge --domain $SURGE_DOMAIN_DEV1 --project ./build
- save_cache:
key: v1.1-dependencies-{{ checksum "package-lock.json" }}
Expand All @@ -106,7 +106,7 @@ jobs:
command: npm install
- run:
name: Build the React client
command: export REACT_APP_APIENDPOINT=$APIENDPOINT_BETA REACT_APP_DEF_PWD=$REACT_APP_DEF_PWD SKIP_PREFLIGHT_CHECK=true NODE_OPTIONS=$NODE_OPTIONS && npm run build
command: export REACT_APP_APIENDPOINT=$APIENDPOINT_BETA REACT_APP_DEF_PWD=$REACT_APP_DEF_PWD SKIP_PREFLIGHT_CHECK=true NODE_OPTIONS="$NODE_OPTIONS --max_old_space_size=4096" && npm run build --prod
- run:
name: Export error log if 'Build the React client' failed
command: |
Expand Down
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ src/components/TaskEditSuggestions/**
src/components/TeamMemberTasks/**
src/components/Teams/**
src/components/TeamLocations/**
src/components/Timelog/**
src/components/UserManagement/**
src/components/UserProfile/**
src/components/Announcements/**
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '14'

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '14'

Expand All @@ -25,7 +25,7 @@ jobs:

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-results
path: test-results # Adjust the path to your test results if necessary
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ src/components/TaskEditSuggestions/**
src/components/TeamLocations/**
src/components/TeamMemberTasks/**
src/components/Teams/**
src/components/Timelog/**
src/components/UserManagement/**
src/components/UserProfile/**
src/components/Announcements/**
47 changes: 27 additions & 20 deletions src/components/Badge/BadgeHistory.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@ import { WEEK_DIFF } from '../../constants/badge';

function BadgeHistory({ badges, personalBestMaxHrs }) {
const filterBadges = allBadges => {
const filteredList = allBadges.filter(
value => Date.now() - new Date(value.lastModified).getTime() > WEEK_DIFF,
if (!Array.isArray(allBadges)) return [];

const filteredList = allBadges.filter(value =>
value && value.lastModified &&
(Date.now() - new Date(value.lastModified).getTime() > WEEK_DIFF)
);

filteredList.sort((a, b) => {
if (a.badge.ranking === 0) return 1;
if (b.badge.ranking === 0) return -1;
if (a.badge.ranking > b.badge.ranking) return 1;
if (a.badge.ranking < b.badge.ranking) return -1;
if (a.badge.badgeName > b.badge.badgeName) return 1;
if (a.badge.badgeName < b.badge.badgeName) return -1;

// If all conditions fail, return 0 to indicate that elements are equal
return 0;
const rankingA = a?.badge?.ranking ?? Infinity;
const rankingB = b?.badge?.ranking ?? Infinity;
const nameA = a?.badge?.badgeName ?? '';
const nameB = b?.badge?.badgeName ?? '';

if (rankingA === 0) return 1;
if (rankingB === 0) return -1;
if (rankingA > rankingB) return 1;
if (rankingA < rankingB) return -1;
return nameA.localeCompare(nameB);
});

return filteredList;
};

Expand All @@ -26,17 +31,19 @@ function BadgeHistory({ badges, personalBestMaxHrs }) {
return (
<div className="badge_history_container">
{filteredBadges.map((value, index) => (
<BadgeImage
personalBestMaxHrs={personalBestMaxHrs}
time="old"
count={value.count}
badgeData={value.badge}
index={index}
key={index}
/>
value && value.badge ? (
<BadgeImage
personalBestMaxHrs={personalBestMaxHrs}
time="old"
count={value.count}
badgeData={value.badge}
index={index}
key={value.badge._id || index}
/>
) : null
))}
</div>
);
}

export default BadgeHistory;
export default BadgeHistory;
14 changes: 7 additions & 7 deletions src/components/Header/Header.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
width: clamp(100vw, 0.1rem + 1vw, 100%);
}

.close-button {
close-button {
position: absolute;
top: 0;
left: 0;
padding: 12px;
padding: 12px; /* Add some padding for easier clicking */
}

.card-content {
padding: 5px;
padding: 5px; /* Add padding around the card content */
padding-left: 40px;
padding-right: 40px;
white-space: pre-line;
Expand All @@ -20,7 +20,7 @@
}

.navbar {
z-index: 100;
/* z-index: 100; */
white-space: nowrap;
/* margin-bottom: 20px; */
}
Expand Down Expand Up @@ -59,12 +59,12 @@
align-items: center;
}

.dropdown-item-hover:hover{
.dropdown-item-hover:hover {
background-color: #2f4157 !important;
}

@media (max-width: 1400px) {
.nav-links{
.nav-links {
flex-direction: column !important;
}
}
Expand Down Expand Up @@ -98,7 +98,7 @@
}

@media screen and (max-width: 769px) {
.responsive-spacing{
.responsive-spacing {
margin-right: 5px;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/LBDashboard/Auth/Auth.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
min-width: 250px;
}

.form-container {
.lb-auth-page .form-container {
background-color: white;
border: 1px solid #ccc;
border-radius: 8px;
Expand Down Expand Up @@ -68,7 +68,7 @@
min-width: 140px;
}

form {
.lb-auth-page form {
display: flex;
flex-direction: column;
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion src/components/LBDashboard/Auth/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function Login() {
};

return (
<div className="auth-page">
<div className="auth-page lb-auth-page">
<div className="logo-container">
<img src={logo} alt="One Community Logo" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/LBDashboard/Auth/Register.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function Register() {
};

return (
<div className="auth-page">
<div className="auth-page lb-auth-page">
<div className="logo-container">
<img src={logo} alt="One Community Logo" />
</div>
Expand Down
4 changes: 1 addition & 3 deletions src/components/Projects/WBS/WBSDetail/WBSTasks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,8 @@ function WBSTasks(props) {
</ol>
</nav>
<div
className='mb-2 button-group' // Grouping the buttons
className='mb-2 wbs-button-group' // Group the buttons
style={{
// display: 'flex',
// justifyContent: 'space-between'
}}>
{/* <span> */}
{canPostTask ? (
Expand Down
17 changes: 13 additions & 4 deletions src/components/Projects/WBS/WBSDetail/wbs.css
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,18 @@
.tasks-detail-actions { /* action column width reduced */
width: 6%;
}
@media (max-width: 768px) { /* arranging the buttons */
.button-group button {
margin-bottom: 10px;
}
.wbs-button-group {
justify-content: flex-start;
gap: 10px;
margin-top: 20px;
}

@media (max-width: 968px) {
.wbs-button-group {
align-items: flex-start;
margin-bottom: 10px;
}
.wbs-button-group button {
margin-bottom: 10px;
}
}
64 changes: 37 additions & 27 deletions src/components/Reports/BadgeSummaryViz.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,28 @@ function BadgeSummaryViz({ authId, userId, badges, dashboard }) {
useEffect(() => {
try {
if (badges && badges.length) {
const sortBadges = [...badges].sort((a, b) => {
if (a?.badge?.ranking === 0) return 1;
if (b?.badge?.ranking === 0) return -1;
if (a?.badge?.ranking > b?.badge?.ranking) return 1;
if (a?.badge?.ranking < b?.badge?.ranking) return -1;
if (a?.badge?.badgeName > b?.badge?.badgeName) return 1;
if (a?.badge?.badgeName < b?.badge?.badgeName) return -1;
return 0;
});
const sortBadges = badges
.filter(badge => badge && badge.badge) // Filter out null or undefined badges
.sort((a, b) => {
const rankingA = a.badge?.ranking ?? Infinity;
const rankingB = b.badge?.ranking ?? Infinity;
const nameA = a.badge?.badgeName ?? '';
const nameB = b.badge?.badgeName ?? '';

if (rankingA === 0) return 1;
if (rankingB === 0) return -1;
if (rankingA > rankingB) return 1;
if (rankingA < rankingB) return -1;
return nameA.localeCompare(nameB);
});
setSortedBadges(sortBadges);
} else {
setSortedBadges([]);
}
} catch (error) {
console.log(error);
console.error("Error sorting badges:", error);
setSortedBadges([]);
}

}, [badges]);

const toggle = () => setIsOpen(prev => !prev);
Expand Down Expand Up @@ -81,15 +88,16 @@ function BadgeSummaryViz({ authId, userId, badges, dashboard }) {
<tbody>
{badges && badges.length>0 ? (
sortedBadges &&
sortedBadges.map(value => value &&(
<tr key={value.badge._id}>
sortedBadges.map(value => value && value.badge && (
<tr key={value.badge._id || value._id}>
<td className="badge_image_sm">
{' '}
<img
src={value.badge.imageUrl}
id={`popover_${value.badge._id}`}
alt="badge"
/>
{value.badge.imageUrl && (
<img
src={value.badge.imageUrl}
id={`popover_${value.badge._id || value._id}`}
alt="badge"
/>
)}
</td>
<UncontrolledPopover
trigger="hover"
Expand Down Expand Up @@ -181,16 +189,18 @@ function BadgeSummaryViz({ authId, userId, badges, dashboard }) {
<tbody>
{badges && badges.length ? (
sortedBadges &&
sortedBadges.map(value => value &&(
<tr key={value._id}>
sortedBadges.map(value => value && value.badge && (
<tr key={value.badge._id || value._id}>
<td className="badge_image_sm">
{' '}
<img
src={value?.badge.imageUrl}
id={`popover_${value._id}`}
alt="badge"
/>
{value.badge.imageUrl && (
<img
src={value.badge.imageUrl}
id={`popover_${value.badge._id || value._id}`}
alt="badge"
/>
)}
</td>
// ... rest of the code
<UncontrolledPopover trigger="hover" target={`popover_${value._id}`}>
<Card className="text-center">
<CardImg className="badge_image_lg" src={value?.badge?.imageUrl} />
Expand Down
Loading

0 comments on commit f46027c

Please sign in to comment.