Skip to content

Commit

Permalink
Merge pull request #426 from 51ngul4r1ty/story/000425/see-project-name
Browse files Browse the repository at this point in the history
See Selected Project Name
  • Loading branch information
51ngul4r1ty authored Aug 30, 2022
2 parents 79587d1 + f360d56 commit 0ed5a53
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "atoll",
"version": "0.60.1",
"version": "0.61.0",
"author": {
"name": "Kevin Berry",
"email": "[email protected]"
Expand Down Expand Up @@ -59,7 +59,7 @@
"check:prereqs": "ts-node ./scripts/check-prereqs.ts"
},
"dependencies": {
"@atoll/shared": "0.57.3",
"@atoll/shared": "0.61.0",
"@flopflip/memory-adapter": "1.6.0",
"@flopflip/react-broadcast": "10.1.11",
"axios": "0.26.1",
Expand Down
14 changes: 9 additions & 5 deletions src/server/api/handlers/views/planViewBff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import type { Request, Response } from "express";
import { StatusCodes } from "http-status-codes";

// libraries
import { ApiSprint, DateOnly, determineSprintStatus, mapApiItemsToSprints, SprintStatus } from "@atoll/shared";
import { ApiProject, ApiSprint, DateOnly, determineSprintStatus, mapApiItemsToSprints, SprintStatus } from "@atoll/shared";

// interfaces/types
import type { UserPreferencesItemResult } from "../fetchers/userPreferencesFetcher";
import type { SprintBacklogItemsResult } from "../fetchers/sprintBacklogItemFetcher";
import { isRestApiErrorResult, RestApiCollectionResult, RestApiErrorResult } from "../../utils/responseBuilder";
import { isRestApiErrorResult, RestApiCollectionResult, RestApiErrorResult, RestApiItemResult } from "../../utils/responseBuilder";

// utils
import { fetchBacklogItems } from "../fetchers/backlogItemFetcher";
Expand All @@ -24,14 +24,16 @@ import { fetchSprintBacklogItemsWithLinks } from "../fetchers/sprintBacklogItemF
import { getLoggedInAppUserId } from "../../utils/authUtils";
import { getUserPreferences } from "../fetchers/userPreferencesFetcher";
import { logError } from "../utils/serverLogger";
import { fetchProject } from "../fetchers/projectFetcher";

export const planViewBffGetHandler = async (req: Request, res: Response) => {
try {
const userPreferencesResult = await getUserPreferences("--self--", () => getLoggedInAppUserId(req));
const selectedProjectId = (userPreferencesResult as UserPreferencesItemResult).data.item.settings.selectedProject;

const archived = "N";
let [backlogItemsResult, sprintsResult] = await Promise.all([
const [projectResult, backlogItemsResult, sprintsResult] = await Promise.all([
fetchProject(selectedProjectId),
fetchBacklogItems(selectedProjectId),
fetchSprints(selectedProjectId, archived)
]);
Expand Down Expand Up @@ -71,15 +73,17 @@ export const planViewBffGetHandler = async (req: Request, res: Response) => {
isRestApiCollectionResult(backlogItemsResult) &&
isRestApiCollectionResult(sprintsResult) &&
isRestApiItemResult(userPreferencesResult) &&
isRestApiCollectionResult(sprintBacklogItemsResult)
isRestApiCollectionResult(sprintBacklogItemsResult) &&
isRestApiItemResult(projectResult)
) {
res.json(
buildResponseWithData({
backlogItems: backlogItemsResult.data?.items,
sprints,
sprintBacklogItems: sprintBacklogItemsResult?.data?.items || [],
userPreferences: (userPreferencesResult as UserPreferencesItemResult).data?.item,
expandedSprintId: expandedSprintId ?? null
expandedSprintId: expandedSprintId ?? null,
project: projectResult.data?.item
})
);
} else {
Expand Down

0 comments on commit 0ed5a53

Please sign in to comment.