@operato/board 1.5.25 → 1.5.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@operato/board",
3
- "version": "1.5.25",
3
+ "version": "1.5.26",
4
4
  "description": "Webcomponent for board following open-wc recommendations",
5
5
  "author": "heartyoh",
6
6
  "main": "dist/src/index.js",
@@ -152,5 +152,5 @@
152
152
  "prettier --write"
153
153
  ]
154
154
  },
155
- "gitHead": "c00ba4544ea5bfbd329520f0b7a865d6a6ee038d"
155
+ "gitHead": "84003f528791a4dc8606ef37ef3e29c8943ea9b3"
156
156
  }
@@ -409,15 +409,17 @@ class BoardList extends LitElement {
409
409
  .groups=${this.groups}
410
410
  @create-board=${async (e: CustomEvent) => {
411
411
  try {
412
- var { name, description, groupId } = e.detail
412
+ var { name, description, groupId, model, thumbnail } = e.detail
413
+
413
414
  var board: Board = {
414
415
  name,
415
416
  description,
416
417
  groupId,
417
- model: {
418
+ model: model || {
418
419
  width: 1200,
419
420
  height: 800
420
- }
421
+ },
422
+ thumbnail
421
423
  }
422
424
 
423
425
  const { createBoard: created } = await createBoard(board)
@@ -248,9 +248,9 @@ export class BoardSelector extends InfiniteScrollable(localize(i18next)(LitEleme
248
248
  }
249
249
 
250
250
  async onCreateBoard(e: CustomEvent) {
251
- var { name, description, groupId } = e.detail
251
+ var { name, description, groupId, model, thumbnail } = e.detail
252
252
 
253
- await this.createBoard(name, description, groupId)
253
+ await this.createBoard(name, description, groupId, model, thumbnail)
254
254
  this.refreshBoards()
255
255
  }
256
256
 
@@ -318,12 +318,14 @@ export class BoardSelector extends InfiniteScrollable(localize(i18next)(LitEleme
318
318
  return boardListResponse.data.boards.items
319
319
  }
320
320
 
321
- async createBoard(name: string, description: string, groupId: string) {
322
- var model = JSON.stringify({
323
- width: 1200,
324
- height: 800,
325
- fillStyle: 'white'
326
- })
321
+ async createBoard(name: string, description: string, groupId: string, modelTemplate: any, thumbnail: string) {
322
+ var model = JSON.stringify(
323
+ modelTemplate || {
324
+ width: 1200,
325
+ height: 800,
326
+ fillStyle: 'white'
327
+ }
328
+ )
327
329
 
328
330
  const response = await client.mutate({
329
331
  mutation: CREATE_BOARD_GQL,
@@ -332,7 +334,8 @@ export class BoardSelector extends InfiniteScrollable(localize(i18next)(LitEleme
332
334
  name,
333
335
  description,
334
336
  groupId,
335
- model
337
+ model,
338
+ thumbnail
336
339
  }
337
340
  },
338
341
  context: gqlContext()
package/src/types.ts CHANGED
@@ -47,6 +47,7 @@ export type Board = {
47
47
  description?: string
48
48
  model?: any
49
49
  groupId?: string
50
+ thumbnail?: string
50
51
  }
51
52
 
52
53
  export type BoardGroup = {