Skip to content

Commit

Permalink
feat: merge metadata and settings, add tags and geoloc (#996)
Browse files Browse the repository at this point in the history
* feat: merge metadata and settings, add tags and geoloc

* test: add tests, docs

* test: fix tests

* refactor: apply PR requested changes
  • Loading branch information
pyphilia authored Feb 16, 2024
1 parent dfaba0a commit 1e31079
Show file tree
Hide file tree
Showing 42 changed files with 1,581 additions and 868 deletions.
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
File renamed without changes.
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',
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

0 comments on commit 1e31079

Please sign in to comment.