Skip to content

Commit

Permalink
fix: type issues and bump versions of packages
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Feb 21, 2023
1 parent 6df0f8e commit 6206972
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@
"wait-on": "7.0.1"
},
"resolutions": {
"@graasp/sdk": "0.4.1",
"@graasp/ui": "0.11.1",
"@graasp/ui": "0.11.2",
"@mui/icons-material": "5.11.0",
"@mui/material": "5.11.6",
"ansi-html": "0.0.8",
Expand Down
4 changes: 2 additions & 2 deletions src/components/context/CurrentUserContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { MemberRecord } from '@graasp/sdk/frontend';
import i18n from '../../config/i18n';
import { hooks } from '../../config/queryClient';

type CurrentUserContextType = QueryObserverResult<MemberRecord> | null;
type CurrentUserContextType = QueryObserverResult<MemberRecord> | undefined;

const CurrentUserContext = createContext<CurrentUserContextType>(null);
const CurrentUserContext = createContext<CurrentUserContextType>(undefined);

type Props = {
children: JSX.Element | JSX.Element[];
Expand Down
2 changes: 1 addition & 1 deletion src/components/context/LayoutContext.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { createContext, useContext, useMemo, useState } from 'react';
import { createContext, useContext, useMemo, useState } from 'react';

import { DEFAULT_ITEM_LAYOUT_MODE } from '../../config/constants';
import { ChatStatus, ITEM_LAYOUT_MODES } from '../../enums';
Expand Down
6 changes: 5 additions & 1 deletion src/components/item/header/ItemHeaderActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ import { ChatboxButton } from '@graasp/ui';
import { ITEM_TYPES_WITH_CAPTIONS } from '../../../config/constants';
import { useBuilderTranslation } from '../../../config/i18n';
import { hooks } from '../../../config/queryClient';
import { ITEM_CHATBOX_BUTTON_ID } from '../../../config/selectors';
import { ItemActionTabs } from '../../../enums';
import { isItemUpdateAllowedForUser } from '../../../utils/membership';
import {
getHighestPermissionForMemberFromMemberships,
isItemUpdateAllowedForUser,
} from '../../../utils/membership';
import AnalyticsDashboardButton from '../../common/AnalyticsDashboardButton';
import EditItemCaptionButton from '../../common/EditItemCaptionButton';
import ItemMetadataButton from '../../common/ItemMetadataButton';
Expand Down
4 changes: 2 additions & 2 deletions src/utils/membership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const isItemUpdateAllowedForUser = ({
memberships,
memberId,
}: {
memberships: List<ItemMembershipRecord>;
memberships?: List<ItemMembershipRecord>;
memberId: string;
}): boolean =>
Boolean(
Expand Down Expand Up @@ -79,7 +79,7 @@ export const getMembershipsForItem = ({
items: List<ItemRecord>;
}): List<ItemMembershipRecord> | undefined => {
const index = items.findKey(({ id }) => id === itemId);
const m = manyMemberships?.get(index);
const m = manyMemberships?.get(index as number);
if (isError(m)) {
return undefined;
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2384,9 +2384,9 @@ __metadata:
languageName: node
linkType: hard

"@graasp/ui@npm:0.11.1":
version: 0.11.1
resolution: "@graasp/ui@https://github.com/graasp/graasp-ui.git#commit=08e149ac68d3eb50743606dad1a1d48b65e73b24"
"@graasp/ui@npm:0.11.2":
version: 0.11.2
resolution: "@graasp/ui@npm:0.11.2"
dependencies:
"@graasp/sdk": 0.4.1
clsx: 1.1.1
Expand Down Expand Up @@ -2419,7 +2419,7 @@ __metadata:
optional: true
ag-grid-react:
optional: true
checksum: 6763e4ef1aec40039a6faff99fec8a5fd856d3196d8c8494ff75155153805e05a04a5ac4516db7a9a57f3e4df24ec9ce2d8e49967c0f3a521a07ae2dca424c1a
checksum: f0732062e011dcd45c28657eb36aeb7fdcca80cf73835f9b759c998b195ec6fe26b0e7b942dde6a090e3dd93edbd974dbc6a050a6db06d8ecd557754c2fa3ade
languageName: node
linkType: hard

Expand Down

0 comments on commit 6206972

Please sign in to comment.