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

feat: merge metadata and settings, add tags and geoloc #996

Merged
merged 4 commits into from
Feb 16, 2024
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
495 changes: 291 additions & 204 deletions cypress/e2e/item/settings/itemSettings.cy.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { buildItemPath } from '../../../../src/config/paths';
import { buildItemSettingsPath } from '../../../../src/config/paths';
import {
CROP_MODAL_CONFIRM_BUTTON_CLASSNAME,
ITEM_INFORMATION_BUTTON_ID,
THUMBNAIL_SETTING_UPLOAD_BUTTON_CLASSNAME,
} from '../../../../src/config/selectors';
import {
Expand All @@ -17,8 +16,7 @@ describe('Upload Thumbnails', () => {

it(`upload item thumbnail`, () => {
const { items } = SAMPLE_ITEMS_WITH_THUMBNAILS;
cy.visit(buildItemPath(items[0].id));
cy.get(`#${ITEM_INFORMATION_BUTTON_ID}`).click();
cy.visit(buildItemSettingsPath(items[0].id));

// change item thumbnail
// selectFile ???
Expand Down
70 changes: 37 additions & 33 deletions cypress/fixtures/documents.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { DocumentItemType, Item, ItemType } from '@graasp/sdk';
import {
DocumentItemFactory,
DocumentItemType,
Item,
ItemType,
} from '@graasp/sdk';
import { DEFAULT_LANG } from '@graasp/translations';

import { buildDocumentExtra } from '../../src/utils/itemExtra';
import { DEFAULT_FOLDER_ITEM } from './items';
import { CURRENT_USER } from './members';

export const GRAASP_DOCUMENT_ITEM: DocumentItemType = {
export const GRAASP_DOCUMENT_ITEM: DocumentItemType = DocumentItemFactory({
id: 'ecafbd2a-5688-12eb-ae91-0242ac130002',
type: ItemType.DOCUMENT,
name: 'graasp text',
Expand All @@ -19,23 +24,23 @@ export const GRAASP_DOCUMENT_ITEM: DocumentItemType = {
extra: buildDocumentExtra({
content: '<h1>Some Title</h1>',
}),
};
});

export const GRAASP_DOCUMENT_BLANK_NAME_ITEM: DocumentItemType = {
id: 'ecafbd2a-5688-12eb-ae91-0242ac130004',
type: ItemType.DOCUMENT,
name: ' ',
description: 'a description for graasp text',
path: 'ecafbd2a_5688_12eb_ae93_0242ac130002',
settings: {},
createdAt: '2021-08-11T12:56:36.834Z',
updatedAt: '2021-08-11T12:56:36.834Z',
lang: DEFAULT_LANG,
creator: CURRENT_USER,
extra: buildDocumentExtra({
content: '<h1>Some Title</h1>',
}),
};
export const GRAASP_DOCUMENT_BLANK_NAME_ITEM: DocumentItemType =
DocumentItemFactory({
id: 'ecafbd2a-5688-12eb-ae91-0242ac130004',
pyphilia marked this conversation as resolved.
Show resolved Hide resolved
type: ItemType.DOCUMENT,
name: ' ',
description: 'a description for graasp text',
path: 'ecafbd2a_5688_12eb_ae93_0242ac130002',
settings: {},
createdAt: '2021-08-11T12:56:36.834Z',
updatedAt: '2021-08-11T12:56:36.834Z',
creator: CURRENT_USER,
extra: buildDocumentExtra({
content: '<h1>Some Title</h1>',
}),
});

export const GRAASP_DOCUMENT_PARENT_FOLDER: Item = {
...DEFAULT_FOLDER_ITEM,
Expand All @@ -44,21 +49,20 @@ export const GRAASP_DOCUMENT_PARENT_FOLDER: Item = {
path: 'bdf09f5a_5688_11eb_ae93_0242ac130002',
};

export const GRAASP_DOCUMENT_CHILDREN_ITEM: DocumentItemType = {
id: '1cafbd2a-5688-12eb-ae91-0242ac130002',
type: ItemType.DOCUMENT,
name: 'children graasp text',
description: 'a description for graasp text',
path: 'bdf09f5a_5688_11eb_ae93_0242ac130002.1cafbd2a_5688_12eb_ae93_0242ac130002',
creator: CURRENT_USER,
settings: {},
lang: DEFAULT_LANG,
createdAt: '2021-08-11T12:56:36.834Z',
updatedAt: '2021-08-11T12:56:36.834Z',
extra: buildDocumentExtra({
content: '<h1>Some Title</h1>',
}),
};
export const GRAASP_DOCUMENT_CHILDREN_ITEM: DocumentItemType =
DocumentItemFactory({
type: ItemType.DOCUMENT,
name: 'children graasp text',
description: 'a description for graasp text',
creator: CURRENT_USER,
settings: {},
createdAt: '2021-08-11T12:56:36.834Z',
updatedAt: '2021-08-11T12:56:36.834Z',
extra: buildDocumentExtra({
content: '<h1>Some Title</h1>',
}),
parentItem: GRAASP_DOCUMENT_PARENT_FOLDER,
});

export const GRAASP_DOCUMENT_ITEMS_FIXTURE = [
GRAASP_DOCUMENT_ITEM,
Expand Down
6 changes: 3 additions & 3 deletions cypress/fixtures/etherpad.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { EtherpadItemType, ItemType } from '@graasp/sdk';
import { EtherpadItemFactory, EtherpadItemType, ItemType } from '@graasp/sdk';
import { DEFAULT_LANG } from '@graasp/translations';

import { CURRENT_USER } from './members';

// eslint-disable-next-line import/prefer-default-export
export const GRAASP_ETHERPAD_ITEM: EtherpadItemType = {
export const GRAASP_ETHERPAD_ITEM: EtherpadItemType = EtherpadItemFactory({
id: 'ecaf1d2a-5688-11eb-ae91-0242ac130002',
type: ItemType.ETHERPAD,
name: 'graasp etherpad',
Expand All @@ -21,4 +21,4 @@ export const GRAASP_ETHERPAD_ITEM: EtherpadItemType = {
groupID: 'groupId',
},
},
};
});
Loading
Loading