diff --git a/public/graasp.svg b/app/icon.svg similarity index 82% rename from public/graasp.svg rename to app/icon.svg index 0dc7adce9..76b0fc3c9 100644 --- a/public/graasp.svg +++ b/app/icon.svg @@ -5,31 +5,7 @@ viewBox="0 0 200 200" version="1.1" id="svg3" - sodipodi:docname="graasp.svg" - inkscape:version="1.2.2 (b0a84865, 2022-12-01)" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns="http://www.w3.org/2000/svg" - xmlns:svg="http://www.w3.org/2000/svg"> - +> { -// describe('Current user', () => { -// // check if title and headings are displayed correctly -// it('display published items', () => { -// cy.setUpApi({ currentMember: CURRENT_USER, items: PUBLISHED_ITEMS }); -// cy.visit(MY_LIST_ROUTE); - -// // click my publishment tab -// cy.get( -// `#${buildMyListNavigationTabId(MY_LIST_TAB_NAMES.MY_PUBLISHMENTS)}`, -// ).click(); - -// cy.get(`#${MY_PUBLISHED_COLLECTIONS_ID}`) -// .children() -// .should('have.length', getNumberOfOwnPublishedItems(CURRENT_USER.id)); -// }); -// }); -// }); diff --git a/public/defaultAvatar.png b/public/defaultAvatar.png deleted file mode 100644 index e46312020..000000000 Binary files a/public/defaultAvatar.png and /dev/null differ diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index ea18d7313..000000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/homePageIcon.png b/public/homePageIcon.png deleted file mode 100644 index 4e38680cb..000000000 Binary files a/public/homePageIcon.png and /dev/null differ diff --git a/public/icon.png b/public/icon.png deleted file mode 100644 index 0fe4a09ff..000000000 Binary files a/public/icon.png and /dev/null differ diff --git a/src/components/collection/CopyButton.tsx b/src/components/collection/CopyButton.tsx index afc326863..a7e62cbc1 100644 --- a/src/components/collection/CopyButton.tsx +++ b/src/components/collection/CopyButton.tsx @@ -5,7 +5,6 @@ import CircularProgress from '@mui/material/CircularProgress'; import IconButton from '@mui/material/IconButton'; import Tooltip from '@mui/material/Tooltip'; -import { ROOT_ID } from '../../config/constants'; import { useLibraryTranslation } from '../../config/i18n'; import { TREE_MODAL_MY_ITEMS_ID, @@ -42,11 +41,10 @@ export const useCopyAction = (id?: string) => { ids: [id], }; - payload.to = [ - ROOT_ID, - TREE_MODAL_MY_ITEMS_ID, - TREE_MODAL_SHARED_ITEMS_ID, - ].includes(to) + // if the location to copy the item is MyItems or SharedItems root, then set the payload.to argument to be undefined + payload.to = [TREE_MODAL_MY_ITEMS_ID, TREE_MODAL_SHARED_ITEMS_ID].includes( + to, + ) ? undefined : to; diff --git a/src/components/collection/summary/Summary.tsx b/src/components/collection/summary/Summary.tsx index b50b7dee3..85652292e 100644 --- a/src/components/collection/summary/Summary.tsx +++ b/src/components/collection/summary/Summary.tsx @@ -6,12 +6,9 @@ import { Stack, Typography } from '@mui/material'; import Box from '@mui/material/Box'; import Container from '@mui/material/Container'; -import { DiscriminatedItem, ItemPublished } from '@graasp/sdk'; +import { DiscriminatedItem, ItemPublished, ItemType } from '@graasp/sdk'; -import { - ITEM_TYPES, - MAX_COLLECTION_NAME_LENGTH, -} from '../../../config/constants'; +import { MAX_COLLECTION_NAME_LENGTH } from '../../../config/constants'; import { useLibraryTranslation } from '../../../config/i18n'; import LIBRARY from '../../../langs/constants'; import { QueryClientContext } from '../../QueryClientContext'; @@ -88,7 +85,7 @@ const Summary = ({ truncatedName={truncatedName} totalViews={totalViews} /> - {collection?.type === ITEM_TYPES.FOLDER && ( + {collection?.type === ItemType.FOLDER && ( <> diff --git a/src/config/constants.ts b/src/config/constants.ts index 2afce1e82..dade3a74f 100644 --- a/src/config/constants.ts +++ b/src/config/constants.ts @@ -1,57 +1,16 @@ -import { CategoryType, ThumbnailSize } from '@graasp/sdk'; - -export const GRAASP_LOGO_HEADER_HEIGHT = 40; +import { CategoryType } from '@graasp/sdk'; export const APP_NAME = 'Graasp'; export const APP_KEYWORDS = ['graasp', 'library']; export const APP_AUTHOR = 'Graasp'; -export const DEFAULT_LANG = 'en'; -export const DEFAULT_USER_NAME = 'Anonymous'; export const DEFAULT_THUMBNAIL_ALT_TEXT = 'Thumbnail'; -export const MIN_CARD_WIDTH = 345; - -// math -export const BLOCK_MATH_DIV = 'p'; -export const INLINE_MATH_DIV = 'span'; -export const BLOCK_MATH_INDICATOR = '\\['; -export const INLINE_MATH_INDICATOR = '\\('; -export const BLOCK_MATH_REGEX = /(\\\[(.*?)\\])/g; -export const INLINE_MATH_REGEX = /(\\\((.*?)\\\))/g; - -export const ITEM_TYPES = { - FOLDER: 'folder', -}; - -export const MIME_TYPES = { - HTML: 'text/html', - TEXT: 'text/plain', -}; - -export const MEMBER_TYPES = { - OWNER: 'owner', - CONTRIBUTOR: 'contributor', -}; - -export const ROOT_ID = 'ROOT'; -export const TREE_VIEW_HEIGHT = 300; -export const TREE_VIEW_MIN_WIDTH = 350; - export const TWITTER_MESSAGE_MAX_LENGTH = 270; export const MAIL_BREAK_LINE = '%0D%0A'; -export const LEFT_MENU_WIDTH = 300; - -export const PICTURE_QUALITIES = { - LARGE: 'large', - MEDIUM: 'medium', -}; -export const DEFAULT_PICTURE_QUALITY = PICTURE_QUALITIES.LARGE; export const MAX_COLLECTION_NAME_LENGTH = 100; -export const CLIENT_ERROR_MESSAGE = 'Something went wrong!'; export const DEFAULT_ITEM_IMAGE_PATH = '/libraryDefault.svg'; -// export const DEFAULT_MEMBER_THUMBNAIL = '/defaultAvatar.png'; export const DEFAULT_MEMBER_THUMBNAIL = `data:image/svg+xml,${encodeURIComponent(` @@ -60,20 +19,12 @@ export const DEFAULT_MEMBER_THUMBNAIL = `data:image/svg+xml,${encodeURIComponent export const SMALL_AVATAR_ICON_SIZE = 30; export const MEMBER_AVATAR_ICON_SIZE = 40; -export const DEFAULT_THUMBNAIL_SIZE = ThumbnailSize.Medium; - export const UrlSearch = { KeywordSearch: 's', CategorySearch: 'category', GACrossDomainKey: '_gl', }; -export const MY_LIST_TAB_NAMES = { - MY_LIKES: 'myLikes', - MY_FAVORITES: 'myFavorites', - MY_PUBLISHMENTS: 'myPublishments', -}; - export const ENV = { DEVELOPMENT: 'development', PRODUCTION: 'production', diff --git a/src/utils/date.js b/src/utils/date.js deleted file mode 100644 index f7b2e7b16..000000000 --- a/src/utils/date.js +++ /dev/null @@ -1,9 +0,0 @@ -import { DEFAULT_LANG } from '@graasp/sdk'; - -// eslint-disable-next-line import/prefer-default-export -export const formatDate = (published) => { - const datetime = new Date(published); - const time = datetime.toLocaleTimeString(DEFAULT_LANG); - const date = datetime.toLocaleDateString(DEFAULT_LANG); - return `${time} ${date}`; -};