Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bump ui to 2.4.3 #627

Merged
merged 2 commits into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions cypress/e2e/header.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { getCurrentSession } from '@graasp/sdk';
import { Platform } from '@graasp/ui';

import { SIGN_IN_PATH } from '../../src/config/constants';
import { HOME_PATH } from '../../src/config/paths';
Expand All @@ -21,9 +20,8 @@ describe('Header', () => {
cy.setUpApi();
cy.visit(HOME_PATH);
// check navigation and display and interface doesn't crash
cy.get(
`#${APP_NAVIGATION_PLATFORM_SWITCH_BUTTON_IDS[Platform.Builder]}`,
).click();
// todo: this is less robust than using the Platform contant from ui, but it was making cypress compile ui which is unnecessary.
cy.get(`#${APP_NAVIGATION_PLATFORM_SWITCH_BUTTON_IDS.Builder}`).click();
cy.get(`#${APP_NAVIGATION_PLATFORM_SWITCH_ID}`).should('exist');
});

Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
"@emotion/styled": "11.10.5",
"@graasp/chatbox": "1.2.1",
"@graasp/query-client": "0.4.1",
"@graasp/sdk": "0.10.1",
"@graasp/sdk": "0.12.0",
"@graasp/translations": "1.11.0",
"@graasp/ui": "2.3.1",
"@graasp/ui": "2.4.3",
"@mui/icons-material": "5.11.16",
"@mui/lab": "5.0.0-alpha.117",
"@mui/material": "5.12.0",
"@sentry/react": "7.44.2",
"@sentry/tracing": "7.44.2",
"@sentry/react": "7.51.0",
"@sentry/tracing": "7.51.0",
"@uppy/core": "3.0.4",
"@uppy/dashboard": "3.2.0",
"@uppy/drag-drop": "3.0.1",
Expand Down Expand Up @@ -98,9 +98,9 @@
"@babel/eslint-parser": "7.19.1",
"@babel/eslint-plugin": "7.19.1",
"@babel/preset-react": "7.18.6",
"@commitlint/cli": "17.4.2",
"@commitlint/config-conventional": "17.4.2",
"@cypress/code-coverage": "3.10.0",
"@commitlint/cli": "17.6.3",
"@commitlint/config-conventional": "17.6.3",
"@cypress/code-coverage": "3.10.4",
"@cypress/instrument-cra": "1.4.0",
"@graasp/plugin-websockets": "1.0.0",
"@testing-library/jest-dom": "^5.16.3",
Expand Down Expand Up @@ -142,7 +142,7 @@
"@mui/icons-material": "5.11.16",
"@mui/material": "5.12.0",
"immer": "9.0.6",
"@graasp/sdk": "0.10.1",
"@graasp/sdk": "0.12.0",
"immutable": "4.3.0",
"@types/react": "17.0.2",
"@svgr/webpack": "6.5.1"
Expand Down
23 changes: 18 additions & 5 deletions src/components/item/ItemContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { UseQueryResult } from 'react-query';

import { Api, MUTATION_KEYS } from '@graasp/query-client';
import {
DEFAULT_LANG,
DocumentItemExtraProperties,
ItemType,
PermissionLevel,
Expand Down Expand Up @@ -268,17 +269,28 @@ const AppContent = ({
<AppItem
isResizable
item={item}
apiHost={API_HOST}
editCaption={isEditing}
onSaveCaption={onSaveCaption}
onCancelCaption={onCancelCaption}
saveButtonId={saveButtonId}
cancelButtonId={cancelButtonId}
member={member}
height={ITEM_DEFAULT_HEIGHT}
permission={permission}
requestApiAccessToken={Api.requestApiAccessToken}
context={CONTEXT_BUILDER}
requestApiAccessToken={(payload) =>
Api.requestApiAccessToken(payload, { API_HOST })
}
contextPayload={{
apiHost: API_HOST,
spaenleh marked this conversation as resolved.
Show resolved Hide resolved
itemId: item.id,
spaenleh marked this conversation as resolved.
Show resolved Hide resolved
memberId: member.id,
permission,
settings: item.settings,
spaenleh marked this conversation as resolved.
Show resolved Hide resolved
lang:
// todo: remove once it is added in ItemSettings type in sdk
(item.settings?.lang as string | undefined) ||
member.extra?.lang ||
DEFAULT_LANG,
context: CONTEXT_BUILDER,
}}
/>
);

Expand Down Expand Up @@ -339,6 +351,7 @@ const H5PContent = ({ item }: { item: H5PItemTypeRecord }): JSX.Element => {
return (
<H5PItem
itemId={item.id}
itemName={item.name}
spaenleh marked this conversation as resolved.
Show resolved Hide resolved
contentId={contentId}
integrationUrl={H5P_INTEGRATION_URL}
/>
Expand Down
11 changes: 6 additions & 5 deletions src/config/selectors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Platform } from '@graasp/ui';
// todo: this makes tests slow because it compiles ui everytime
// import { Platform } from '@graasp/ui';

export const ITEM_DELETE_BUTTON_CLASS = 'itemDeleteButton';
export const ITEM_COPY_BUTTON_CLASS = 'itemCopyButton';
Expand Down Expand Up @@ -230,10 +231,10 @@ export const ITEM_VALIDATION_BUTTON_ID = 'itemValidationButton';
export const ITEM_VALIDATION_REFRESH_BUTTON_ID = 'itemValidationRefreshButton';
export const APP_NAVIGATION_PLATFORM_SWITCH_ID = 'appNavigationPlatformSwitch';
export const APP_NAVIGATION_PLATFORM_SWITCH_BUTTON_IDS = {
[Platform.Builder]: 'appNavigationPlatformSwitchButtonBuilder',
[Platform.Player]: 'appNavigationPlatformSwitchButtonPlayer',
[Platform.Library]: 'appNavigationPlatformSwitchButtonLibrary',
[Platform.Analytics]: 'appNavigationPlatformSwitchButtonAnalytics',
Builder: 'appNavigationPlatformSwitchButtonBuilder',
Player: 'appNavigationPlatformSwitchButtonPlayer',
Library: 'appNavigationPlatformSwitchButtonLibrary',
Analytics: 'appNavigationPlatformSwitchButtonAnalytics',
};

export const ITEM_PUBLISH_BUTTON_ID = 'itemPublishButton';
Expand Down
Loading