-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First implementation of LinkElement to be used on cards of columnBoards. * implemented open-graph-proxy-service to gather open graph data from urls * open-graph-data is fetched during updateElement and enriches the input from the user (=url) * invalid urls are handled in the open-graph-proxy * if multiple open-graph-images are provided the smallest one (exceeding a min-width) will be chosen * feature toogle is used to disable the feature for the moment --------- Co-authored-by: Oliver Happe <[email protected]>
- Loading branch information
1 parent
4d5a69c
commit a8f7cda
Showing
56 changed files
with
1,550 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
apps/server/src/modules/board/controller/dto/element/any-content-element.response.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import { ExternalToolElementResponse } from './external-tool-element.response'; | ||
import { FileElementResponse } from './file-element.response'; | ||
import { LinkElementResponse } from './link-element.response'; | ||
import { RichTextElementResponse } from './rich-text-element.response'; | ||
import { SubmissionContainerElementResponse } from './submission-container-element.response'; | ||
|
||
export type AnyContentElementResponse = | ||
| FileElementResponse | ||
| LinkElementResponse | ||
| RichTextElementResponse | ||
| SubmissionContainerElementResponse | ||
| ExternalToolElementResponse; |
5 changes: 3 additions & 2 deletions
5
apps/server/src/modules/board/controller/dto/element/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
export * from './any-content-element.response'; | ||
export * from './create-content-element.body.params'; | ||
export * from './update-element-content.body.params'; | ||
export * from './external-tool-element.response'; | ||
export * from './file-element.response'; | ||
export * from './link-element.response'; | ||
export * from './rich-text-element.response'; | ||
export * from './submission-container-element.response'; | ||
export * from './external-tool-element.response'; | ||
export * from './update-element-content.body.params'; |
45 changes: 45 additions & 0 deletions
45
apps/server/src/modules/board/controller/dto/element/link-element.response.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; | ||
import { ContentElementType } from '@shared/domain'; | ||
import { TimestampsResponse } from '../timestamps.response'; | ||
|
||
export class LinkElementContent { | ||
constructor({ url, title, description, imageUrl }: LinkElementContent) { | ||
this.url = url; | ||
this.title = title; | ||
this.description = description; | ||
this.imageUrl = imageUrl; | ||
} | ||
|
||
@ApiProperty() | ||
url: string; | ||
|
||
@ApiProperty() | ||
title: string; | ||
|
||
@ApiPropertyOptional() | ||
description?: string; | ||
|
||
@ApiPropertyOptional() | ||
imageUrl?: string; | ||
} | ||
|
||
export class LinkElementResponse { | ||
constructor({ id, content, timestamps, type }: LinkElementResponse) { | ||
this.id = id; | ||
this.content = content; | ||
this.timestamps = timestamps; | ||
this.type = type; | ||
} | ||
|
||
@ApiProperty({ pattern: '[a-f0-9]{24}' }) | ||
id: string; | ||
|
||
@ApiProperty({ enum: ContentElementType, enumName: 'ContentElementType' }) | ||
type: ContentElementType.LINK; | ||
|
||
@ApiProperty() | ||
content: LinkElementContent; | ||
|
||
@ApiProperty() | ||
timestamps: TimestampsResponse; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.