Skip to content

Commit

Permalink
Merge branch 'main' into feature/api-fusion-apps-migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
kjetilhau committed Oct 22, 2024
2 parents 0217915 + 7e684b8 commit c2bbab0
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 26 deletions.
15 changes: 0 additions & 15 deletions .changeset/pr-806-2098564848.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/pr-808-2100756531.md

This file was deleted.

22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# fusion-project-portal

## 5.0.0

### Major Changes

- d96ab34: - BREAKING CHANGE: The previous proxy endpoint: `/bundles/apps/{appKey}/resources/{*resourcePath}` is no more. Instead use `/fusion-apps/{*wildcard*}` to make proxy calls against the whole Fusion Apps API. See Fusion Apps API Swagger documentation for more information about routes.
- Migrated proxy from Fusion Portal to Fusion Apps API
- Updated packages to latest version
- Refactored and simplified code
- Removed unused Project Portal variables in frontend
- Update frontend to use the new proxy endpoints
- Make frontend client use the new types provided by fusion core
- Update the legacy app loader to use the new proxy endpoints and and fix types
- Move legacy app code to apps folder for cleaner repository
- Setup build of legacy app loader in build pipeline for constant build an deployment.
- Update all Fusion dependencies for frontend client

### Patch Changes

- b3edf8a: Fix errors and add data owner on milestones
- cc5f76c: Rename meetings tab to meeting actions
- 4a4eba3: Update api version on meeting actions to the newest version.

## 4.1.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion client/packages/components/src/components/task/Tasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const Tasks: FC<TasksProps> = ({ height }) => {
<TabNav>
<Tabs.Tab>All ({assignments.length})</Tabs.Tab>
<Tabs.Tab>
Meetings
Meeting Actions
{isLoading.meetingsActions ? (
<Style.CircularProgress size={16} />
) : (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useFramework } from '@equinor/fusion-framework-react';
import { useQuery } from 'react-query';
import { getPimsTasks } from '../work-assigned/assignment-queries';
import { getMyMeetingsActions, getMyReviewActions } from '../queries/fusion-meetings-queries';
import { getMyMeetingsActions, getMyReviewActions, myMeetingsActionSelector } from '../queries/fusion-meetings-queries';
import { getQueryAndNCRequest } from '../queries/query-ncr-request-queries';
import { Task } from '../types/task';
import { getFusionTasks, getProCoSysAssignments } from '../queries/fusion-task-queries';
Expand Down Expand Up @@ -95,6 +95,7 @@ export function useMeetingsActionsQuery() {
return useQuery({
queryKey: ['Assignment', 'Meetings', 'Meetings-Actions'],
queryFn: async ({ signal }) => getMyMeetingsActions(await client, signal),
select: myMeetingsActionSelector,
cacheTime: 5000 * 60,
refetchInterval: 5000 * 60,
staleTime: 2000 * 60,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { IHttpClient } from '@equinor/fusion-framework-module-http';
import { Task } from '../types/task';

import { verifyDate } from '../utils/time';
import { ActionState, MeetingAction } from '../types/meetings-task';
import { ActionState, MeetingAction, MeetingType } from '../types/meetings-task';
import { isTaskOverdue } from './query-ncr-request-queries';

function stripHtml(html?: string) {
Expand All @@ -11,11 +11,14 @@ function stripHtml(html?: string) {
return tmp.textContent || tmp.innerText || '';
}

export async function getMyMeetingsActions(client: IHttpClient, signal?: AbortSignal): Promise<Task[]> {
const response = await client.fetch('/persons/me/actions', { signal });
export async function getMyMeetingsActions(client: IHttpClient, signal?: AbortSignal): Promise<MeetingAction[]> {
const response = await client.fetch('/persons/me/actions?api-version=4.0', { signal });

const tasks: MeetingAction[] = await response.json();
return tasks;
}

export function myMeetingsActionSelector(tasks: MeetingAction[]): Task[] {
return tasks
.filter((a) => a.state !== ActionState.Completed && a.state !== ActionState.NotCompleted)
.map((task) => ({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fusion-project-portal",
"version": "4.1.4",
"version": "5.0.0",
"license": "MIT",
"description": "Project Portal powered by Fusion",
"devDependencies": {
Expand Down

0 comments on commit c2bbab0

Please sign in to comment.