Skip to content

Commit a94fc6e

Browse files
authored
fix: issues and update apps-query-client dep (#190)
* fix: update dep and fix issues * fix: invert function of verbose messages (#189) * fix: allow to send comments to everyone * fix: preset view * fix: sonar issues * fix: remove test looking for preset view * fix: tests
1 parent 68afcad commit a94fc6e

28 files changed

+265
-514
lines changed

.github/workflows/cypress.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ jobs:
3232
VITE_GRAASP_APP_KEY: id-1234567890
3333
VITE_MOCK_API: true
3434
VITE_VERSION: cypress-tests
35-
VITE_DEBUG: false
3635
with:
3736
install: false
3837
build: yarn build:test

.github/workflows/deploy-dev.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
VITE_SENTRY_ENV: development
3131
VITE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
3232
VITE_VERSION: ${{ github.sha }}
33-
VITE_DEBUG: false
3433
run: yarn build
3534
shell: bash
3635

.github/workflows/deploy-prod.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
VITE_SENTRY_ENV: production
3030
VITE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
3131
VITE_VERSION: ${{ github.event.client_payload.tag }}
32-
VITE_DEBUG: false
3332
run: yarn build
3433
shell: bash
3534

.github/workflows/deploy-stage.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
VITE_SENTRY_ENV: staging
3030
VITE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
3131
VITE_VERSION: ${{ github.event.client_payload.tag }}
32-
VITE_DEBUG: false
3332
run: yarn build
3433
shell: bash
3534

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ VITE_API_HOST=http://localhost:3000
2020
VITE_MOCK_API=true
2121
VITE_GRAASP_APP_KEY=45678-677889
2222
VITE_VERSION=latest
23-
VITE_DEBUG=false # disable success toast message
23+
# VITE_ENABLE_VERBOSE_MESSAGES=true # comment this out if you want to enable verbose messages
2424
```
2525

2626
Launch the app with `yarn dev`.
@@ -35,7 +35,7 @@ VITE_API_HOST=http://localhost:3000
3535
VITE_MOCK_API=true
3636
VITE_GRAASP_APP_KEY=45678-677889
3737
VITE_VERSION=latest
38-
VITE_DEBUG=false # disable success toast message
38+
# VITE_ENABLE_VERBOSE_MESSAGES=true # verbose messages will be shown when this is set
3939

4040
# dont open browser
4141
BROWSER=none

cypress/e2e/builder/manageAppResources.cy.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,15 @@ describe('Builder as Admin', () => {
101101
cy.get(buildDataCy(TAB_TABLE_VIEW_CYPRESS)).should('be.visible').click();
102102
});
103103

104-
it('Orphan comments', () => {
104+
it.only('Orphan comments', () => {
105105
// table view pane should be displayed
106106
cy.get(buildDataCy(TABLE_VIEW_PANE_CYPRESS)).should('be.visible');
107107

108108
// check that all users are displayed
109109
const comments = [
110110
...SINGLE_LINE_MOCK_COMMENTS,
111111
...MULTILINE_MOCK_COMMENTS,
112+
MOCK_ORPHAN_COMMENT,
112113
].filter((r) => r.type === APP_DATA_TYPES.COMMENT) as CommentType[];
113114
const orphansId = getOrphans(comments).map((c) => c.id);
114115
const nonOrphanComments = comments?.filter(

cypress/e2e/codeReview/codeReview.cy.ts

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@ import {
1818
COMMENT_THREAD_CONTAINER_CYPRESS,
1919
COMMIT_INFO_DIALOG_CYPRESS,
2020
CUSTOM_DIALOG_TITLE_CYPRESS,
21-
DISPLAY_SETTINGS_FAB_CYPRESS,
2221
PLAYER_VIEW_CYPRESS,
23-
REPL_EDITOR_ID_CY,
24-
SETTINGS_DIALOG_CANCEL_BUTTON_CYPRESS,
25-
SETTINGS_DIALOG_SAVE_BUTTON_CYPRESS,
26-
SHOW_LINE_NUMBERS_SWITCH_CYPRESS,
27-
TAB_PRESET_VIEW_CYPRESS,
2822
TOOLBAR_COMMIT_INFO_BUTTON_CYPRESS,
2923
TOOLBAR_EDIT_CODE_BUTTON_CYPRESS,
3024
TOOLBAR_RUN_CODE_BUTTON_CYPRESS,
@@ -327,77 +321,3 @@ describe('Comment settings', () => {
327321
);
328322
});
329323
});
330-
331-
describe('Show Line Numbers Setting Builder View', () => {
332-
beforeEach(() => {
333-
cy.setUpApi({
334-
database: {
335-
appSettings: [
336-
MOCK_GENERAL_SETTINGS,
337-
{
338-
...MOCK_GENERAL_SETTINGS,
339-
data: {
340-
...DEFAULT_GENERAL_SETTINGS,
341-
[GeneralSettingsKeys.ShowLineNumbers]: true,
342-
},
343-
},
344-
MOCK_CODE_SETTINGS,
345-
],
346-
},
347-
appContext: {
348-
context: Context.Builder,
349-
permission: PermissionLevel.Admin,
350-
},
351-
});
352-
cy.visit('/');
353-
});
354-
355-
it('Toggling Line Numbers Switch from Display Settings', () => {
356-
// Check For Line Numbers Are Shown.
357-
// Open Preset View.
358-
cy.get(buildDataCy(TAB_PRESET_VIEW_CYPRESS))
359-
.should('be.visible')
360-
.as('presetViewTab')
361-
.click();
362-
// Open Display Settings.
363-
cy.get(buildDataCy(DISPLAY_SETTINGS_FAB_CYPRESS))
364-
.should('be.visible')
365-
.as('displaySettingsFab')
366-
.click();
367-
// Check that Line Numbers Switch is checked.
368-
cy.get(
369-
`${buildDataCy(SHOW_LINE_NUMBERS_SWITCH_CYPRESS)} input[type="checkbox"]`,
370-
).should('be.checked');
371-
// Click on Cancel button from the display settings window.
372-
cy.get(buildDataCy(SETTINGS_DIALOG_CANCEL_BUTTON_CYPRESS))
373-
.as('cancelButton')
374-
.should('be.visible')
375-
.click();
376-
// Check that line numbers are shown.
377-
cy.get(`#${REPL_EDITOR_ID_CY} .cm-lineNumbers`).should('be.visible');
378-
// Check For Line Numbers Are Not Shown.
379-
// Open Display Settings.
380-
cy.get(buildDataCy(DISPLAY_SETTINGS_FAB_CYPRESS))
381-
.should('be.visible')
382-
.as('displaySettingsFab')
383-
.click();
384-
cy.wait(waitingDelay);
385-
// Click on switch to toggle setting, check that the switch shouldn't be checked.
386-
cy.get(
387-
`${buildDataCy(SHOW_LINE_NUMBERS_SWITCH_CYPRESS)} input[type="checkbox"]`,
388-
).click();
389-
cy.get(
390-
`${buildDataCy(SHOW_LINE_NUMBERS_SWITCH_CYPRESS)} input[type="checkbox"]`,
391-
).should('not.to.be.checked');
392-
// Click on Save button from the display settings window.
393-
cy.get(buildDataCy(SETTINGS_DIALOG_SAVE_BUTTON_CYPRESS))
394-
.as('saveButton')
395-
.should('not.be.disabled');
396-
cy.get(buildDataCy(SETTINGS_DIALOG_SAVE_BUTTON_CYPRESS)).click({
397-
// this seems necessary even if the behavior is correct when doing it at human speeds
398-
force: true,
399-
});
400-
// Check that line numbers are not shown.
401-
cy.get(`#${REPL_EDITOR_ID_CY} .cm-lineNumbers`).should('not.exist');
402-
});
403-
});

cypress/fixtures/appData.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -105,40 +105,6 @@ export const MULTILINE_MOCK_COMMENTS: AppData[] = [
105105
type: APP_DATA_TYPES.COMMENT,
106106
visibility: AppDataVisibility.Member,
107107
},
108-
{
109-
id: uuid(),
110-
data: { text: 'some text' },
111-
member: MEMBERS.BOB,
112-
creator: MEMBERS.BOB,
113-
item: MOCK_SERVER_ITEM,
114-
createdAt: new Date().toISOString(),
115-
updatedAt: new Date().toISOString(),
116-
type: APP_DATA_TYPES.COMMENT,
117-
visibility: AppDataVisibility.Member,
118-
},
119-
{
120-
id: uuid(),
121-
data: { text: 'some text' },
122-
member: CURRENT_MEMBER,
123-
creator: CURRENT_MEMBER,
124-
item: MOCK_SERVER_ITEM,
125-
createdAt: new Date().toISOString(),
126-
updatedAt: new Date().toISOString(),
127-
type: APP_DATA_TYPES.COMMENT,
128-
visibility: AppDataVisibility.Member,
129-
},
130-
// teacher comments
131-
{
132-
id: uuid(),
133-
data: { text: 'some text' },
134-
member: CURRENT_MEMBER,
135-
creator: CURRENT_MEMBER,
136-
item: MOCK_SERVER_ITEM,
137-
createdAt: new Date().toISOString(),
138-
updatedAt: new Date().toISOString(),
139-
type: APP_DATA_TYPES.TEACHER_COMMENT,
140-
visibility: AppDataVisibility.Member,
141-
},
142108
];
143109

144110
export const generateSingleLineThread = (

cypress/fixtures/members.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const MEMBERS: { [key: string]: CompleteMember } = {
44
ANNA: {
55
id: '0f0a2774-a965-4b97-afb4-bccc3796e060',
66
name: 'anna',
7-
email: 'bob@gmail.com',
7+
email: 'anna@gmail.com',
88
extra: {},
99
type: MemberType.Individual,
1010
createdAt: new Date().toISOString(),

package.json

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@fortawesome/free-regular-svg-icons": "6.5.1",
2424
"@fortawesome/free-solid-svg-icons": "6.5.1",
2525
"@fortawesome/react-fontawesome": "0.2.0",
26-
"@graasp/apps-query-client": "3.4.0",
26+
"@graasp/apps-query-client": "github:graasp/graasp-apps-query-client#hotfix-app-data-key",
2727
"@graasp/pyodide": "github:graasp/graasp-pyodide",
2828
"@graasp/sdk": "3.3.0",
2929
"@graasp/ui": "4.1.1",
@@ -86,7 +86,7 @@
8686
"hooks:install": "husky install",
8787
"hooks:uninstall": "husky uninstall",
8888
"pre-commit": "yarn prettier:check && yarn lint",
89-
"cypress:open": "env-cmd -f ./.env.development cypress open",
89+
"cypress:open": "env-cmd -f ./.env.test cypress open",
9090
"test": "yarn build:test && concurrently -k -s first \"yarn preview:test\" \"yarn test:ci\"",
9191
"test:ci": "env-cmd -f ./.env.test cypress run && nyc report --reporter=text --reporter=text-summary",
9292
"cov:report": "open ./coverage/lcov-report/index.html"
@@ -129,11 +129,7 @@
129129
"vite-plugin-istanbul": "5.0.0"
130130
},
131131
"browserslist": {
132-
"production": [
133-
">0.2%",
134-
"not dead",
135-
"not op_mini all"
136-
],
132+
"production": [">0.2%", "not dead", "not op_mini all"],
137133
"development": [
138134
"last 1 chrome version",
139135
"last 1 firefox version",
@@ -142,13 +138,8 @@
142138
},
143139
"nyc": {
144140
"all": true,
145-
"include": [
146-
"src/**/*.{js,ts,jsx,tsx}"
147-
],
148-
"exclude": [
149-
"src/setupTests.ts",
150-
"src/**/*.d.ts"
151-
]
141+
"include": ["src/**/*.{js,ts,jsx,tsx}"],
142+
"exclude": ["src/setupTests.ts", "src/**/*.d.ts"]
152143
},
153144
"resolutions": {
154145
"@codemirror/state": "6.3.3"

0 commit comments

Comments
 (0)