Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Typeorm #629

Merged
merged 46 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
f674892
refactor: change types given typeorm
pyphilia Feb 23, 2023
fbfa6ba
refactor: apply typeorm changes
pyphilia Feb 24, 2023
4f1d5c6
refactor: apply typeorm changes
pyphilia Feb 24, 2023
e8c3ce4
refactor: fix issues
pyphilia Mar 10, 2023
0f91d4c
refactor: add many fixes
pyphilia Mar 14, 2023
ef2600d
refactor: fix export zip
pyphilia Mar 17, 2023
1edcdc4
refactor: merge main
pyphilia Mar 17, 2023
3afd18d
refactor: apply fixes
pyphilia Mar 22, 2023
94d34a3
refactor: fix types
pyphilia Mar 27, 2023
47d90f5
refactor: use mutation hooks, move cypress to ts
pyphilia Apr 21, 2023
a281e7a
refactor: move cypress tests to ts
pyphilia Apr 28, 2023
9333be3
refactor: playwright
pyphilia Apr 28, 2023
7508d0d
refactor: use playwright and miragejs
pyphilia Apr 30, 2023
3428f76
refactor: fix cypress tests
pyphilia Apr 30, 2023
46d1086
refactor: fix tests
pyphilia May 3, 2023
f57a9b8
refactor: fix tests
pyphilia May 3, 2023
b8dc3ae
refactor: fix ts errors, update dep
pyphilia May 3, 2023
c4a89e6
refactor: fix tests
pyphilia May 4, 2023
d9a9d50
refactor: update query client, sdk, translations, ui
pyphilia May 10, 2023
829076a
refactor: merge main
pyphilia May 10, 2023
de7b8a2
refactor: fix issues
pyphilia May 10, 2023
38a9aaa
refactor: fix tests for mentions
pyphilia May 12, 2023
5baf43e
fix: chatbox
spaenleh May 12, 2023
3fd6117
refactor: fix chatbot and license adaption
spaenleh May 15, 2023
a6a0514
refactor: remove FC
pyphilia May 15, 2023
0418b59
refactor: fix errors
pyphilia May 15, 2023
f26468f
Merge remote-tracking branch 'origin/typeorm' into typeorm
pyphilia May 15, 2023
eec55a1
refactor: set tsconfig strict to true
pyphilia May 17, 2023
f2ff397
refactor: fix strict true undefined
pyphilia May 22, 2023
1fe92d0
refactor: fix tests
pyphilia May 22, 2023
d1930d9
refactor: update graasp ui
pyphilia May 22, 2023
1eb4f5c
refactor: update graasp ui
pyphilia May 22, 2023
6232734
refactor: add wait for edit caption in folder test
pyphilia May 23, 2023
52d3662
refactor: fix tests
pyphilia May 23, 2023
25aa724
refactor: enable back coverage
pyphilia May 23, 2023
de0dce0
fix: issues with items not rendering
spaenleh May 22, 2023
b4fed44
fix: member extra and sdk update
spaenleh May 25, 2023
c5bc815
fix: udpate ui and fix test with invalid value
spaenleh May 26, 2023
a098406
fix: issues ItemTagType casing
spaenleh May 26, 2023
ff701cb
refactor: fix ts issues after extension of tsconfig.json
spaenleh May 26, 2023
368823b
chore: remove conflicting inlinesourcemaps options
spaenleh May 30, 2023
f9c66c8
fix: config
spaenleh May 30, 2023
4e12db9
fix: test for redirection
spaenleh May 30, 2023
c253d1b
chore: update deps to rc
spaenleh May 30, 2023
61e2e87
chore: update chatbox version
spaenleh May 31, 2023
0fd41de
chore: update ui version
spaenleh Jun 1, 2023
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
Prev Previous commit
Next Next commit
refactor: fix chatbot and license adaption
  • Loading branch information
spaenleh committed May 15, 2023
commit 3fd6117487a38084d71e1f67f52bd4a97d4690eb
5 changes: 2 additions & 3 deletions src/components/common/Chatbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ const Chatbox = ({ item }: Props): JSX.Element => {
chatId={item.id}
messages={chatMessages}
showAdminTools={isAdmin}
// TODO
sendMessageFunction={sendMessage}
deleteMessageFunction={deleteMessage as any}
editMessageFunction={editMessage as any}
deleteMessageFunction={deleteMessage}
editMessageFunction={editMessage}
useAvatarUrl={useAvatarUrl}
/>
);
Expand Down
7 changes: 4 additions & 3 deletions src/components/common/UserSwitchWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const UserSwitchWrapper: FC<Props> = ({ ButtonContent }) => {
} = useCurrentUserContext();
const { t: translateBuilder } = useBuilderTranslation();
const { mutateAsync: signOut } = mutations.useSignOut();
const { mutate: switchMember } = mutations.useSwitchMember();
// todo: does not exist on mutations since we use httpOnly Cookie
// const { mutate: switchMember } = mutations.useSwitchMember();

const renderAvatar = (m: MemberRecord) => <MemberAvatar id={m.id} />;

Expand All @@ -42,13 +43,13 @@ const UserSwitchWrapper: FC<Props> = ({ ButtonContent }) => {
isCurrentMemberLoading={isLoading}
isCurrentMemberSuccess={isSuccessUser}
// fix in query client
switchMember={switchMember as any}
// switchMember={switchMember as any}
seeProfileText={translateBuilder(BUILDER.USER_SWITCH_PROFILE_BUTTON)}
signedOutTooltipText={translateBuilder(
BUILDER.USER_SWITCH_SIGNED_OUT_TOOLTIP,
)}
signOutText={translateBuilder(BUILDER.USER_SWITCH_SIGN_OUT_BUTTON)}
switchMemberText={translateBuilder(BUILDER.USER_SWITCH_SWITCH_USER_TEXT)}
// switchMemberText={translateBuilder(BUILDER.USER_SWITCH_SWITCH_USER_TEXT)}
profilePath={MEMBER_PROFILE_PATH}
domain={DOMAIN}
redirectPath={SIGN_IN_PATH}
Expand Down
4 changes: 2 additions & 2 deletions src/components/item/form/AppForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import { buildAppExtra } from '../../../utils/itemExtra';
import BaseItemForm from './BaseItemForm';

type Props = {
onChange: (item: Partial<DiscriminatedItem<UnknownExtra>>) => void;
onChange: (item: Partial<DiscriminatedItem>) => void;
item?: AppItemTypeRecord;
updatedProperties: Partial<DiscriminatedItem<UnknownExtra>>;
updatedProperties: Partial<DiscriminatedItem>;
};

const AppForm: FC<Props> = ({ onChange, item, updatedProperties = {} }) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/item/form/BaseItemForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { TextField } from '@mui/material';

import { ChangeEvent, FC } from 'react';

import { DiscriminatedItem, UnknownExtra } from '@graasp/sdk';
import { DiscriminatedItem } from '@graasp/sdk';
import { ItemRecord } from '@graasp/sdk/frontend';
import { BUILDER } from '@graasp/translations';

import { useBuilderTranslation } from '../../../config/i18n';
import { ITEM_FORM_NAME_INPUT_ID } from '../../../config/selectors';

type Props = {
updatedProperties: Partial<DiscriminatedItem<UnknownExtra>>;
updatedProperties: Partial<DiscriminatedItem>;
onChange: (props: Partial<DiscriminatedItem>) => void;
item: Partial<ItemRecord>;
required?: boolean;
Expand Down
20 changes: 2 additions & 18 deletions src/components/item/publish/CCLicenseSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {

import { ChangeEvent, FC, useEffect, useState } from 'react';

import { CCLicenseAdaptions } from '@graasp/sdk';
import { ItemRecord } from '@graasp/sdk/frontend';
import { BUILDER } from '@graasp/translations';
import { CCSharingVariant, CreativeCommons, Loader } from '@graasp/ui';
Expand All @@ -26,19 +27,6 @@ import {
import { useCurrentUserContext } from '../../context/CurrentUserContext';
import CCLicenseDialog from './CCLicenseDialog';

// TODO: export in graasp sdk
enum CCLicenseAdaptions {
CC_BY = 'CC BY',
CC_BY_NC = 'CC BY-NC',
CC_BY_SA = 'CC BY-SA',
CC_BY_NC_SA = 'CC BY-NC-SA',
CC_BY_ND = 'CC BY-ND',
CC_BY_NC_ND = 'CC BY-NC-ND',
CC0 = 'CC0',
}

export type CCLicenseAdaption = CCLicenseAdaptions | `${CCLicenseAdaptions}`;

type CCLicenseChoice = 'yes' | 'no' | '';
type CCSharingLicenseChoice = CCLicenseChoice | 'alike';

Expand Down Expand Up @@ -78,11 +66,7 @@ const CCLicenseSelection: FC<Props> = ({ item, disabled }) => {
useEffect(() => {
if (settings?.ccLicenseAdaption) {
// Handles old license formats.
if (
['alike', 'allow'].includes(
settings?.ccLicenseAdaption as CCLicenseAdaption,
)
) {
if (['alike', 'allow'].includes(settings?.ccLicenseAdaption)) {
setRequireAttributionValue('yes');
setAllowCommercialValue('no');
setAllowSharingValue(
Expand Down
10 changes: 3 additions & 7 deletions src/components/item/settings/ItemSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ import Typography from '@mui/material/Typography';

import { FC, useEffect, useState } from 'react';

import {
ItemSettings as ItemSettingsType,
ItemType,
convertJs,
} from '@graasp/sdk';
import { ImmutableCast, ItemRecord } from '@graasp/sdk/frontend';
import { ItemType, convertJs } from '@graasp/sdk';
import { ItemRecord } from '@graasp/sdk/frontend';
import { BUILDER } from '@graasp/translations';

import {
Expand Down Expand Up @@ -45,7 +41,7 @@ const ItemSettings: FC<Props> = ({ item }) => {
const { settings } = item;

const [settingLocal, setSettingLocal] =
useState<ImmutableCast<ItemSettingsType>>(settings);
useState<ItemRecord['settings']>(settings);

useEffect(
() => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/item/settings/LinkSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Typography from '@mui/material/Typography';

import { ChangeEvent, FC } from 'react';

import { ItemRecord } from '@graasp/sdk/frontend';
import { EmbeddedLinkItemTypeRecord } from '@graasp/sdk/frontend';
import { BUILDER } from '@graasp/translations';

import {
Expand All @@ -18,7 +18,7 @@ import {
} from '../../../config/selectors';

type Props = {
item: ItemRecord;
item: EmbeddedLinkItemTypeRecord;
};

const LinkSettings: FC<Props> = ({ item }) => {
Expand Down
52 changes: 17 additions & 35 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2347,7 +2347,7 @@ __metadata:

"@graasp/chatbox@github:graasp/graasp-chatbox#typeorm":
version: 1.2.1
resolution: "@graasp/chatbox@https://github.com/graasp/graasp-chatbox.git#commit=04dfc190566f9b912542b627b0f3ca7ac3a8480c"
resolution: "@graasp/chatbox@https://github.com/graasp/graasp-chatbox.git#commit=e16748b897afaed06050a5452e34ff76d054e562"
dependencies:
lodash.truncate: 4.4.2
moment: 2.29.4
Expand All @@ -2373,7 +2373,7 @@ __metadata:
react: ^17.0.0
react-dom: "*"
react-i18next: ^12.0.0
checksum: f551cf73f0b68e038ac2b6e8c1dbf2a7fb1eb5e4ed2be0bfb72bc0a04b7ad41dbbdc53c2419f9518f3915c78423d75034297b19e7efe173ecddb24c803062d97
checksum: 708af4f3f02c99df1ad73bc18b4dccdcfbf47aeb94928118cd0cfcd45824f6d8a3a1c0a1384c4ceb37286c94e58612834b9d834bacc48a3fa3fdd002cf630bb8
languageName: node
linkType: hard

Expand Down Expand Up @@ -2407,7 +2407,7 @@ __metadata:

"@graasp/query-client@github:graasp/graasp-query-client#typeorm":
version: 0.4.1
resolution: "@graasp/query-client@https://github.com/graasp/graasp-query-client.git#commit=b79f7aec6310607603bfdb5fdf9a52ab1ca030cf"
resolution: "@graasp/query-client@https://github.com/graasp/graasp-query-client.git#commit=361f7a559054ac5bb24db932b9ebb5fd9b81f843"
dependencies:
"@graasp/sdk": "github:graasp/graasp-sdk#typeorm"
"@graasp/translations": 1.13.0
Expand All @@ -2420,13 +2420,13 @@ __metadata:
uuid: 9.0.0
peerDependencies:
react: ^17.0.0
checksum: 845b130a21bd5c302bf24fd9c265fb6fe4da0f32268a3f82174f34c6e1cf8a9a0fd4cf1f5d542f89729c96e743f0eebc5fc325bf8b9bd977260922efaf4528df
checksum: bebe468002ced7b60aa4d56d1936c589e3c8d5c94e34ebb3222c0a2b4533bdf0474e02a980980c38afba69a99422370f865947f382234de36ce711b011a1d0a2
languageName: node
linkType: hard

"@graasp/sdk@github:graasp/graasp-sdk#typeorm":
version: 0.12.0
resolution: "@graasp/sdk@https://github.com/graasp/graasp-sdk.git#commit=0ae4e64a0dfc18eab3aac4f3774ea39b235a068e"
resolution: "@graasp/sdk@https://github.com/graasp/graasp-sdk.git#commit=7952338b6cb874db33fb667eff9fafec31b3c17e"
dependencies:
"@fastify/secure-session": 5.3.0
"@graasp/etherpad-api": 2.1.1
Expand All @@ -2438,7 +2438,8 @@ __metadata:
qs: 6.11.1
typeorm: 0.3.15
uuid: 9.0.0
checksum: 79494cdbd3380644e2af203c06f52ea5650638606b53c89d97d302134fe8b4bd5d9ec1bf593ab96ed492475b8aaa9a6276645bcd8c7ff6fcceac4af4a4131ff4
validator: 13.9.0
checksum: 5edd36e3e8bc395168f93ba3fcc02c0ad37970f37366e4b2468d2c85e22c72254e3fa11351aff839df91ae1929b842c1e8d558c8c59ebb21a7c8b8403c50be82
languageName: node
linkType: hard

Expand All @@ -2453,7 +2454,7 @@ __metadata:

"@graasp/ui@github:graasp/graasp-ui#typeorm":
version: 2.5.0
resolution: "@graasp/ui@https://github.com/graasp/graasp-ui.git#commit=277183c0eb8a974da72b74dde827afb181f9e639"
resolution: "@graasp/ui@https://github.com/graasp/graasp-ui.git#commit=09ae78cf35d82382c70d960c856a4d5923cebd4f"
dependencies:
"@graasp/sdk": "github:graasp/graasp-sdk#typeorm"
clsx: 1.1.1
Expand All @@ -2464,7 +2465,6 @@ __metadata:
qs: 6.11.0
quill-emoji: 0.2.0
react-cookie-consent: 7.4.1
react-i18next: 11.17.0
react-quill: 2.0.0-beta.4
react-rnd: 10.3.7
react-text-mask: 5.4.3
Expand All @@ -2475,18 +2475,19 @@ __metadata:
"@mui/icons-material": ~5.11.9
"@mui/lab": ~5.0.0-alpha.120
"@mui/material": ~5.11.9
ag-grid-community: 28.1.1
ag-grid-react: 28.1.1
i18next: ~21.8.9
react: 17.0.2
react-dom: 17.0.2
react-router-dom: 6.2.2
ag-grid-community: ^28.1.1
ag-grid-react: ^28.1.1
i18next: ^22.4.15
react: ^17.0.2
react-dom: ^17.0.2
react-i18next: ^12.2.0
react-router-dom: ^6.11.0
peerDependenciesMeta:
ag-grid-community:
optional: true
ag-grid-react:
optional: true
checksum: 6a4f790c8b0d625b99a32eb8e8beb659978b053b5065fea1bf7757291723a1c6c9d8cd2a30e912ffaf8b15435579ce54b119adba98176c208925259ab770c0bf
checksum: 7545e03274ff0152cfe3ba20d822d9cd642b09ec0645290d5df1f1d4f9306f6f07eeece5c80e582f9286a590bd7e863ac29269ebddb76c55f37a9a62177595ab
languageName: node
linkType: hard

Expand Down Expand Up @@ -10074,7 +10075,7 @@ __metadata:
languageName: node
linkType: hard

"html-escaper@npm:^2.0.0, html-escaper@npm:^2.0.2":
"html-escaper@npm:^2.0.0":
version: 2.0.2
resolution: "html-escaper@npm:2.0.2"
checksum: d2df2da3ad40ca9ee3a39c5cc6475ef67c8f83c234475f24d8e9ce0dc80a2c82df8e1d6fa78ddd1e9022a586ea1bd247a615e80a5cd9273d90111ddda7d9e974
Expand Down Expand Up @@ -15985,25 +15986,6 @@ __metadata:
languageName: node
linkType: hard

"react-i18next@npm:11.17.0":
version: 11.17.0
resolution: "react-i18next@npm:11.17.0"
dependencies:
"@babel/runtime": ^7.14.5
html-escaper: ^2.0.2
html-parse-stringify: ^3.0.1
peerDependencies:
i18next: ">= 19.0.0"
react: ">= 16.8.0"
peerDependenciesMeta:
react-dom:
optional: true
react-native:
optional: true
checksum: 0ed6823af56f4133bf1664262206be6651cbea95e2f9275411d6346c6b8009e277b32fe60702fd06607d13b8979913bd013da702e25fa3f4e1bd73e403417296
languageName: node
linkType: hard

"react-i18next@npm:11.18.6":
version: 11.18.6
resolution: "react-i18next@npm:11.18.6"
Expand Down