Skip to content

Commit 440a869

Browse files
authored
fix: remove enums (#213)
1 parent df4e930 commit 440a869

File tree

7 files changed

+13
-25
lines changed

7 files changed

+13
-25
lines changed

cypress.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import registerCodeCoverage from '@cypress/code-coverage/task';
1+
import registerCodeCoverage from '@cypress/code-coverage/task.js';
22
import { defineConfig } from 'cypress';
33

44
export default defineConfig({

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@emotion/react": "11.11.4",
2020
"@emotion/styled": "11.11.5",
2121
"@graasp/apps-query-client": "3.4.15",
22-
"@graasp/sdk": "4.14.1",
22+
"@graasp/sdk": "^5.6.0",
2323
"@graasp/ui": "4.19.3",
2424
"@mui/icons-material": "5.15.20",
2525
"@mui/lab": "5.0.0-alpha.170",

src/components/common/Settings.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { AppSetting } from '@graasp/sdk';
1313

1414
import { makeStyles } from 'tss-react/mui';
1515

16-
import { APP_SETTINGS_TYPES } from '../../config/appSettingTypes';
1716
import {
1817
DEFAULT_HEADER_VISIBLE,
1918
DEFAULT_PUBLIC_STUDENT_UPLOADS,
@@ -25,6 +24,11 @@ import {
2524
} from '../../config/selectors';
2625
import { useAppSettingContext } from '../context/AppSettingContext';
2726

27+
const APP_SETTINGS_TYPES = {
28+
HEADER_VISIBLE: 'headerVisible',
29+
PUBLIC_STUDENT_UPLOADS: 'publicStudentUploads',
30+
} as const;
31+
2832
function getModalStyle(): { top: string; left: string; transform: string } {
2933
const top = 50;
3034
const left = 50;
@@ -85,7 +89,7 @@ const Settings: FC = () => {
8589
...originalSetting,
8690
name: key,
8791
data: {
88-
[key]: !originalSetting?.data?.[key] ?? !DEFAULT_HEADER_VISIBLE,
92+
[key]: originalSetting?.data?.[key] ?? !DEFAULT_HEADER_VISIBLE,
8993
},
9094
};
9195
saveSettings(settingsToChange);
@@ -98,7 +102,7 @@ const Settings: FC = () => {
98102
...originalSetting,
99103
name: key,
100104
data: {
101-
[key]: !originalSetting?.data?.[key] ?? !DEFAULT_PUBLIC_STUDENT_UPLOADS,
105+
[key]: originalSetting?.data?.[key] ?? !DEFAULT_PUBLIC_STUDENT_UPLOADS,
102106
},
103107
};
104108
saveSettings(settingsToChange);

src/config/appActionTypes.ts

-8
This file was deleted.

src/config/appDataTypes.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
enum APP_DATA_TYPES {
2-
FILE = 'file',
3-
}
4-
5-
export { APP_DATA_TYPES };
1+
export const APP_DATA_TYPES = {
2+
FILE: 'file',
3+
} as const;

src/config/appSettingTypes.ts

-6
This file was deleted.

yarn.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -9086,7 +9086,7 @@ __metadata:
90869086
"@emotion/react": "npm:11.11.4"
90879087
"@emotion/styled": "npm:11.11.5"
90889088
"@graasp/apps-query-client": "npm:3.4.15"
9089-
"@graasp/sdk": "npm:4.14.1"
9089+
"@graasp/sdk": "npm:^5.6.0"
90909090
"@graasp/ui": "npm:4.19.3"
90919091
"@mui/icons-material": "npm:5.15.20"
90929092
"@mui/lab": "npm:5.0.0-alpha.170"

0 commit comments

Comments
 (0)