Skip to content

Commit

Permalink
fix: resolve pull conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ymijsters committed Dec 17, 2024
2 parents c478a2d + d6cacaa commit 671972b
Show file tree
Hide file tree
Showing 12 changed files with 431 additions and 1,019 deletions.
12 changes: 11 additions & 1 deletion .aws/graasp-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,17 @@
"dependsOn": null,
"disableNetworking": null,
"healthCheck": null,
"essential": true
"essential": true,
"links": null,
"hostname": null,
"extraHosts": null,
"pseudoTerminal": null,
"user": null,
"readonlyRootFilesystem": null,
"dockerLabels": null,
"systemControls": null,
"privileged": null
"name": "graasp"
},
{
"dnsSearchDomains": null,
Expand Down
29 changes: 28 additions & 1 deletion .aws/graasp-prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"cpu": "2048",
"memory": "4096",
"requiresCompatibilities": ["FARGATE"],
"requiresCompatibilities": ["FARGATE"],
"networkMode": "awsvpc",
"runtimePlatform": {
"operatingSystemFamily": "LINUX",
"cpuArchitecture": null
},
"containerDefinitions": [
{
"name": "graasp",
"logConfiguration": {
"logDriver": "awslogs",
"options": {
Expand Down Expand Up @@ -101,6 +101,16 @@
"systemControls": null,
"privileged": null,
"name": "graasp-iframely-production"
"links": null,
"hostname": null,
"extraHosts": null,
"pseudoTerminal": null,
"user": null,
"readonlyRootFilesystem": null,
"dockerLabels": null,
"systemControls": null,
"privileged": null,
"name": "graasp-iframely-production"
}
],
"placementConstraints": [],
Expand All @@ -120,4 +130,21 @@
"inferenceAccelerators": null,
"proxyConfiguration": null,
"volumes": []
"placementConstraints": [],
"memory": "4096",
"taskRoleArn": null,
"compatibilities": [],
"taskDefinitionArn": null,
"family": "graasp",
"requiresAttributes": [],
"pidMode": null,
"requiresCompatibilities": ["FARGATE"],
"networkMode": "awsvpc",
"runtimePlatform": null,
"cpu": "2048",
"revision": null,
"status": null,
"inferenceAccelerators": null,
"proxyConfiguration": null,
"volumes": []
}
356 changes: 356 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions src/services/item/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import graaspValidationPlugin from './plugins/publication/validation';
import graaspRecycledItemData from './plugins/recycled';
import ShortLinkService from './plugins/shortLink';
import { SHORT_LINKS_ROUTE_PREFIX } from './plugins/shortLink/service';
import graaspItemTagPlugin from './plugins/tag/controller';
import thumbnailsPlugin from './plugins/thumbnail';
import { itemWsHooks } from './ws/hooks';

Expand Down Expand Up @@ -113,8 +112,6 @@ const plugin: FastifyPluginAsync = async (fastify) => {

fastify.register(itemGeolocationPlugin);

fastify.register(graaspItemTagPlugin);

fastify.register(itemController);
});
},
Expand Down
106 changes: 0 additions & 106 deletions src/services/item/plugins/etherpad/controller.ts

This file was deleted.

33 changes: 8 additions & 25 deletions src/services/item/plugins/file/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fastifyMultipart } from '@fastify/multipart';
import { FastifyPluginAsyncTypebox } from '@fastify/type-provider-typebox';

import { FileItemProperties, PermissionLevel, getFileExtension } from '@graasp/sdk';
import { FileItemProperties, PermissionLevel } from '@graasp/sdk';

import { resolveDependency } from '../../../../di/utils';
import { asDefined } from '../../../../utils/assertions';
Expand All @@ -14,8 +14,6 @@ import { StorageService } from '../../../member/plugins/storage/service';
import { validatedMemberAccountRole } from '../../../member/strategies/validatedMemberAccountRole';
import { Item } from '../../entities/Item';
import { ItemService } from '../../service';
import { H5PService } from '../html/h5p/service';
import { H5P_FILE_EXTENSION } from '../importExport/constants';
import { download, upload } from './schema';
import FileItemService from './service';
import { DEFAULT_MAX_FILE_SIZE, MAX_NUMBER_OF_FILES_UPLOAD } from './utils/constants';
Expand All @@ -36,7 +34,6 @@ const basePlugin: FastifyPluginAsyncTypebox<GraaspPluginFileOptions> = async (fa
const itemService = resolveDependency(ItemService);
const storageService = resolveDependency(StorageService);
const fileItemService = resolveDependency(FileItemService);
const h5pService = resolveDependency(H5PService);

fastify.register(fastifyMultipart, {
limits: {
Expand Down Expand Up @@ -139,27 +136,13 @@ const basePlugin: FastifyPluginAsyncTypebox<GraaspPluginFileOptions> = async (fa
try {
// if the file is an H5P file, we treat it appropriately
// othwerwise, we save it as a generic file
let item: Item;
if (getFileExtension(filename) === H5P_FILE_EXTENSION) {
item = await h5pService.createH5PItem(
member,
repositories,
filename,
stream,
parentId,
previousItemId,
log,
);
} else {
item = await fileItemService.upload(member, repositories, {
parentId,
filename,
mimetype,
stream,
previousItemId,
});
}

const item = await fileItemService.upload(member, repositories, {
parentId,
filename,
mimetype,
stream,
previousItemId,
});
items.push(item);
} catch (e) {
// ignore errors
Expand Down
Loading

0 comments on commit 671972b

Please sign in to comment.