Skip to content

Commit

Permalink
Merge pull request #254 from chingu-x/dev
Browse files Browse the repository at this point in the history
1.0.0-alpha.4
  • Loading branch information
Dan-Y-Ko authored Sep 11, 2024
2 parents 870de55 + e11cec6 commit d87f2a0
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 21 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/).

## [1.0.0-alpha.4] - 2024-09-10

### Added


### Changed
- Updated how we're retrieving the discord id to display in the directory page


### Fixed
- Fixed issue with dark mode images being different size https://github.com/chingu-x/chingu-dashboard/issues/200
- Fixed issue with meeting notes section becoming scrollable instead of expanding when saved https://github.com/chingu-x/chingu-dashboard/issues/248


## [1.0.0-alpha.3] - 2024-09-05

### Added
Expand Down
Binary file modified public/img/empty_ideation_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/empty_ideation_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/empty_resources_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/empty_resources_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,18 @@ export async function fetchTeamDirectory({

if (res) {
updateDirectoryWithCurrentTime(res);
const teamMember = res.voyageTeamMembers;
const elementToSort = teamMember.find(
(element) => element.member.discordId === user?.discordId,
const teamMembers = res.voyageTeamMembers;
const userDiscordId = user?.oAuthProfiles.find(
(profile) => profile.provider.name === "discord",
)?.providerUsername;
const elementToSort = teamMembers.find(
(element) =>
element.member.oAuthProfiles.find(
(profile) => profile.provider.name === "discord",
)?.providerUsername === userDiscordId,
);
moveElementToFirst(teamMember, elementToSort);

moveElementToFirst(teamMembers, elementToSort);
}

return [res, error];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ interface TeamMemberProps {

export default function TeamMember({ teamMember }: TeamMemberProps) {
const user = useUser().voyageTeamMembers;
const { firstName, lastName, discordId, currentTime } = teamMember.member;
const { firstName, lastName, oAuthProfiles, currentTime } = teamMember.member;
const { id, hrPerSprint, voyageRole } = teamMember;
const isCurrentUser = user.some((user) => user.id === id);
const [isEditing, setIsEditing] = useState<boolean>(false);
const newRef = useRef<HTMLDivElement>(null);

const discordId =
oAuthProfiles.find((profile) => profile.provider.name === "discord")
?.providerUsername || "";

useEffect(() => {
document.addEventListener("mousedown", handleOutsideClick);
return () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export default function Notes() {
rows={2}
{...register("notes")}
errorMessage={errors.notes?.message}
defaultValue={data ?? ""}
/>
<Button
type="submit"
Expand Down
24 changes: 16 additions & 8 deletions src/store/features/directory/directorySlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
type VoyageStatus,
} from "@/store/features/user/userSlice";

type providerType = "discord";

interface VoyageTier {
id: number;
name: string;
Expand All @@ -20,10 +22,12 @@ interface VoyageMember {
firstName: string;
lastName: string;
avatar: string;
githubId: string | null;
discordId: string | null;
twitterId: string | null;
linkedinId: string | null;
oAuthProfiles: {
provider: {
name: providerType;
};
providerUsername: string;
}[];
countryCode: string;
timezone: string;
currentTime: string;
Expand Down Expand Up @@ -73,10 +77,14 @@ const initialState: DirectoryState = {
firstName: "",
lastName: "",
avatar: "",
githubId: null,
discordId: null,
twitterId: null,
linkedinId: null,
oAuthProfiles: [
{
provider: {
name: "discord",
},
providerUsername: "",
},
],
countryCode: "",
timezone: "",
currentTime: "",
Expand Down
24 changes: 16 additions & 8 deletions src/store/features/user/userSlice.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { type PayloadAction, createSlice } from "@reduxjs/toolkit";
import { clientSignOut } from "@/store/features/auth/authSlice";

type providerType = "discord";

export interface VoyageStatus {
name: string;
}
Expand Down Expand Up @@ -31,10 +33,12 @@ export interface User {
firstName: string;
lastName: string;
countryCode: string;
discordId: string;
githubId: string;
twitterId: string;
linkedinId: string;
oAuthProfiles: {
provider: {
name: providerType;
};
providerUsername: string;
}[];
email: string;
timezone: string;
avatar: string;
Expand All @@ -48,10 +52,14 @@ const initialState: User = {
firstName: "",
lastName: "",
countryCode: "",
discordId: "",
githubId: "",
twitterId: "",
linkedinId: "",
oAuthProfiles: [
{
provider: {
name: "discord",
},
providerUsername: "",
},
],
email: "",
timezone: "",
avatar: "",
Expand Down

0 comments on commit d87f2a0

Please sign in to comment.