Skip to content

Commit

Permalink
Merge pull request #42 from langaracpsc/pull-request
Browse files Browse the repository at this point in the history
fix exec positions not showing
  • Loading branch information
Highfire1 authored Apr 19, 2024
2 parents fa1fe0c + 01e2640 commit 6e10362
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions frontend/src/app/ExecProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface ExecProfileProps

ImageBuffer: string;

Position: string;
Position: Array<string>;

Description: string;
}
Expand Down Expand Up @@ -90,15 +90,15 @@ export default function ExecProfile({ID, Name, ImageBuffer, Position, Descriptio
<ProfileModal
ID={ID}
Name={Name}
Position={Position}
Position={Position.join(" & ")}
ImageBuffer={ImageBuffer}
Description={Description}
imageWidth={imageWidth} />
</Dialog.Content>
</Dialog.Overlay>
</Dialog.Portal>
</Dialog.Root>
<p>{Position}</p>
<p>{Position.join(" & ")}</p>
</div>
</div>
</div>
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/app/ExecProfiles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { selectProfile, ExecProfileObject } from './slices/execProfileSlice';
export default function ExecProfiles() {
const profiles = useAppSelector(selectProfile);

// TODO: don't hardcode the value of 1000
const profilesSorted = [...profiles].sort((a, b) => (a.Position.ID - b.Position.ID)).slice(0, 1000);
const profilesSorted = profiles;

const [profileSections, setProfileSections] = useState<ExecProfileObject[][]>([]);

Expand Down Expand Up @@ -74,7 +73,7 @@ export default function ExecProfiles() {
profiles.map(profile => (
<ExecProfile
key={profile.ID}
Position={profile.Position.Title}
Position={profile.Position}
ID={profile.ID}
Name={profile.Name}
ImageBuffer= {(profile.ImageBuffer != null) ? `https://api3.langaracs.tech/executives/image/${profile.ImageBuffer}` : "https://via.placeholder.com/200x200"}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/about/AboutPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function AboutPage({} : AboutPageProps)
const promise: UnknownAction = mainDispatch(loadProfilesAsync() as AppDispatch);

((await promise) as unknown as any[]).forEach((element) => {
mainDispatch(AddExecProfile({ ...element, Position: { ID: element.Position.ID, Title: element.Position.Name} } as ExecProfileObject));
mainDispatch(AddExecProfile({ ...element} as ExecProfileObject));
});
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/slices/execProfileSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface ExecProfileObject

ImageBuffer: string;

Position: ExecPosition;
Position: Array<string>;

Description: string;
}
Expand Down

0 comments on commit 6e10362

Please sign in to comment.