@things-factory/board-ui 8.0.5 → 9.0.0-beta.10
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/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -19
- package/translations/en.json +32 -29
- package/translations/ja.json +34 -31
- package/translations/ko.json +34 -31
- package/translations/ms.json +29 -25
- package/translations/zh.json +32 -29
- package/assets/images/bg-blue.png +0 -0
- package/assets/images/bg-green.png +0 -0
- package/assets/images/bg-input-select.png +0 -0
- package/assets/images/bg-rail.png +0 -0
- package/assets/images/forklift.png +0 -0
- package/assets/images/icon-backinfo.png +0 -0
- package/assets/images/icon-brand.png +0 -0
- package/assets/images/icon-close.png +0 -0
- package/assets/images/icon-editor-gradient-direction.png +0 -0
- package/assets/images/icon-mobile-brand.png +0 -0
- package/assets/images/icon-nametag.png +0 -0
- package/assets/images/icon-properties-label.png +0 -0
- package/assets/images/icon-properties-line-type.png +0 -0
- package/assets/images/icon-properties-table.png +0 -0
- package/assets/images/icon-resource-select.png +0 -0
- package/assets/images/person.png +0 -0
- package/assets/images/profile.png +0 -0
- package/client/apptools/favorite-tool.ts +0 -124
- package/client/board-list/board-tile-list.ts +0 -272
- package/client/board-list/group-bar-styles.ts +0 -63
- package/client/board-list/group-bar.ts +0 -99
- package/client/board-list/play-group-bar.ts +0 -88
- package/client/board-provider.ts +0 -92
- package/client/bootstrap.ts +0 -39
- package/client/data-grist/board-editor.ts +0 -113
- package/client/data-grist/board-renderer.ts +0 -134
- package/client/data-grist/color-map-editor.ts +0 -17
- package/client/data-grist/color-ranges-editor.ts +0 -17
- package/client/graphql/board-template.ts +0 -141
- package/client/graphql/board.ts +0 -273
- package/client/graphql/favorite-board.ts +0 -25
- package/client/graphql/group.ts +0 -138
- package/client/graphql/index.ts +0 -6
- package/client/graphql/my-board.ts +0 -25
- package/client/graphql/play-group.ts +0 -189
- package/client/index.ts +0 -10
- package/client/pages/attachment-list-page.ts +0 -142
- package/client/pages/board-list-page.ts +0 -603
- package/client/pages/board-modeller-page.ts +0 -288
- package/client/pages/board-player-by-name-page.ts +0 -29
- package/client/pages/board-player-page.ts +0 -241
- package/client/pages/board-template/board-template-list-page.ts +0 -248
- package/client/pages/board-viewer-by-name-page.ts +0 -24
- package/client/pages/board-viewer-page.ts +0 -271
- package/client/pages/font-list-page.ts +0 -31
- package/client/pages/play-list-page.ts +0 -400
- package/client/pages/printable-board-viewer-page.ts +0 -54
- package/client/pages/theme/theme-editors.ts +0 -56
- package/client/pages/theme/theme-list-page.ts +0 -313
- package/client/pages/things-scene-components-with-tools.import +0 -0
- package/client/pages/things-scene-components.import +0 -0
- package/client/route.ts +0 -51
- package/client/setting-let/board-view-setting-let.ts +0 -68
- package/client/themes/board-theme.css +0 -77
- package/client/things-scene-import.d.ts +0 -4
- package/client/viewparts/board-basic-info.ts +0 -646
- package/client/viewparts/board-info-link.ts +0 -56
- package/client/viewparts/board-info.ts +0 -85
- package/client/viewparts/board-template-builder.ts +0 -134
- package/client/viewparts/board-versions.ts +0 -172
- package/client/viewparts/group-info-basic.ts +0 -267
- package/client/viewparts/group-info-import.ts +0 -132
- package/client/viewparts/group-info.ts +0 -87
- package/client/viewparts/index.ts +0 -3
- package/client/viewparts/link-builder.ts +0 -210
- package/client/viewparts/play-group-info-basic.ts +0 -268
- package/client/viewparts/play-group-info-link.ts +0 -46
- package/client/viewparts/play-group-info.ts +0 -81
- package/images/icon-properties-arrow-type.png +0 -0
- package/images/icon-properties-gradient-direction.png +0 -0
- package/images/icon-properties-line-type.png +0 -0
- package/images/icon-properties-padding.png +0 -0
- package/images/icon-properties-table.png +0 -0
- package/images/icon-shell-inspector.png +0 -0
- package/server/index.ts +0 -0
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import '@operato/board/ox-board-selector.js'
|
|
2
|
-
import './board-renderer'
|
|
3
|
-
|
|
4
|
-
import { css, html } from 'lit'
|
|
5
|
-
import { customElement, property, query } from 'lit/decorators.js'
|
|
6
|
-
|
|
7
|
-
import { OxGristEditor } from '@operato/data-grist'
|
|
8
|
-
import { i18next } from '@operato/i18n'
|
|
9
|
-
import { openPopup } from '@operato/layout'
|
|
10
|
-
|
|
11
|
-
@customElement('board-editor')
|
|
12
|
-
export class BoardEditor extends OxGristEditor {
|
|
13
|
-
static styles = [
|
|
14
|
-
css`
|
|
15
|
-
:host {
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-flow: row nowrap;
|
|
18
|
-
align-items: center;
|
|
19
|
-
|
|
20
|
-
box-sizing: border-box;
|
|
21
|
-
|
|
22
|
-
width: 100%;
|
|
23
|
-
height: 100%;
|
|
24
|
-
|
|
25
|
-
border: 0;
|
|
26
|
-
background-color: transparent;
|
|
27
|
-
|
|
28
|
-
font: var(--grist-object-editor-font);
|
|
29
|
-
color: var(--grist-object-editor-color);
|
|
30
|
-
|
|
31
|
-
justify-content: inherit;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
board-renderer {
|
|
35
|
-
display: flex;
|
|
36
|
-
flex: auto;
|
|
37
|
-
|
|
38
|
-
justify-content: inherit;
|
|
39
|
-
}
|
|
40
|
-
`
|
|
41
|
-
]
|
|
42
|
-
|
|
43
|
-
@property({ type: Object }) value: any
|
|
44
|
-
@property({ type: Object }) column: any
|
|
45
|
-
@property({ type: Object }) record: any
|
|
46
|
-
@property({ type: Number }) row?: number
|
|
47
|
-
|
|
48
|
-
popup
|
|
49
|
-
|
|
50
|
-
render() {
|
|
51
|
-
var { boardViewerPage } = this.column.record.options || {}
|
|
52
|
-
return html` <board-renderer .value=${this.value} .boardViewerPage=${boardViewerPage}></board-renderer> `
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async firstUpdated() {
|
|
56
|
-
this.value = this.record[this.column.name]
|
|
57
|
-
|
|
58
|
-
await this.updateComplete
|
|
59
|
-
|
|
60
|
-
this.renderRoot.addEventListener('click', e => {
|
|
61
|
-
e.stopPropagation()
|
|
62
|
-
|
|
63
|
-
this.openSelector()
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
this.openSelector()
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
openSelector() {
|
|
70
|
-
if (this.popup) {
|
|
71
|
-
delete this.popup
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/*
|
|
75
|
-
* 기존 설정된 보드가 선택된 상태가 되게 하기 위해서는 selector에 value를 전달해줄 필요가 있음.
|
|
76
|
-
* 주의. value는 object일 수도 있고, string일 수도 있다.
|
|
77
|
-
* string인 경우에는 해당 보드의 id로 해석한다.
|
|
78
|
-
*/
|
|
79
|
-
var value = this.value || {}
|
|
80
|
-
|
|
81
|
-
var template = html`
|
|
82
|
-
<ox-board-selector
|
|
83
|
-
.creatable=${true}
|
|
84
|
-
.value=${this.value}
|
|
85
|
-
@board-selected=${async e => {
|
|
86
|
-
var board = e.detail.board
|
|
87
|
-
|
|
88
|
-
this.dispatchEvent(
|
|
89
|
-
new CustomEvent('field-change', {
|
|
90
|
-
bubbles: true,
|
|
91
|
-
composed: true,
|
|
92
|
-
detail: {
|
|
93
|
-
before: this.value,
|
|
94
|
-
after: this.column.type == 'board' ? board : board.id || '',
|
|
95
|
-
record: this.record,
|
|
96
|
-
column: this.column,
|
|
97
|
-
row: this.row
|
|
98
|
-
}
|
|
99
|
-
})
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
this.popup && this.popup.close()
|
|
103
|
-
}}
|
|
104
|
-
></ox-board-selector>
|
|
105
|
-
`
|
|
106
|
-
|
|
107
|
-
this.popup = openPopup(template, {
|
|
108
|
-
backdrop: true,
|
|
109
|
-
size: 'large',
|
|
110
|
-
title: i18next.t('title.select board')
|
|
111
|
-
})
|
|
112
|
-
}
|
|
113
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
|
|
3
|
-
import gql from 'graphql-tag'
|
|
4
|
-
import { css, html, LitElement } from 'lit'
|
|
5
|
-
import { customElement, property, query } from 'lit/decorators.js'
|
|
6
|
-
|
|
7
|
-
import { navigate } from '@operato/shell'
|
|
8
|
-
import { client, gqlContext } from '@operato/graphql'
|
|
9
|
-
|
|
10
|
-
const FETCH_BOARD_GQL = id => {
|
|
11
|
-
return gql`
|
|
12
|
-
{
|
|
13
|
-
board(id:"${id}") {
|
|
14
|
-
id
|
|
15
|
-
name
|
|
16
|
-
description
|
|
17
|
-
thumbnail
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
`
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@customElement('board-renderer')
|
|
24
|
-
class BoardRendererElement extends LitElement {
|
|
25
|
-
static styles = [
|
|
26
|
-
css`
|
|
27
|
-
:host {
|
|
28
|
-
display: flex;
|
|
29
|
-
justify-content: center;
|
|
30
|
-
position: relative;
|
|
31
|
-
|
|
32
|
-
max-width: var(--board-renderer-max-width);
|
|
33
|
-
border: var(--board-renderer-border);
|
|
34
|
-
|
|
35
|
-
width: 100%;
|
|
36
|
-
}
|
|
37
|
-
span {
|
|
38
|
-
position: absolute;
|
|
39
|
-
bottom: 0;
|
|
40
|
-
width: 100%;
|
|
41
|
-
text-indent: 5px;
|
|
42
|
-
|
|
43
|
-
font: var(--board-renderer-name-font);
|
|
44
|
-
color: var(--md-sys-color-on-primary);
|
|
45
|
-
background-color: var(--md-sys-color-primary);
|
|
46
|
-
}
|
|
47
|
-
img {
|
|
48
|
-
object-fit: contain;
|
|
49
|
-
max-width: 100%;
|
|
50
|
-
max-height: 100%;
|
|
51
|
-
}
|
|
52
|
-
md-icon {
|
|
53
|
-
position: absolute;
|
|
54
|
-
top: 0;
|
|
55
|
-
text-align: center;
|
|
56
|
-
color: var(--md-sys-color-on-primary);
|
|
57
|
-
background-color: var(--md-sys-color-primary);
|
|
58
|
-
|
|
59
|
-
width: var(--board-renderer-icon-size);
|
|
60
|
-
height: var(--board-renderer-icon-size);
|
|
61
|
-
font: var(--board-renderer-font);
|
|
62
|
-
}
|
|
63
|
-
md-icon[edit] {
|
|
64
|
-
right: 0;
|
|
65
|
-
|
|
66
|
-
border-bottom-left-radius: var(--board-renderer-icon-border-radius);
|
|
67
|
-
}
|
|
68
|
-
md-icon[view] {
|
|
69
|
-
left: 0;
|
|
70
|
-
|
|
71
|
-
border-bottom-right-radius: var(--board-renderer-icon-border-radius);
|
|
72
|
-
}
|
|
73
|
-
`
|
|
74
|
-
]
|
|
75
|
-
|
|
76
|
-
@property({ type: Object }) value: any
|
|
77
|
-
@property({ type: String }) boardViewerPage?: string
|
|
78
|
-
@property({ type: Object }) _value: any
|
|
79
|
-
|
|
80
|
-
async updated(changes) {
|
|
81
|
-
if (changes.has('value')) {
|
|
82
|
-
if (typeof this.value == 'string' && this.value) {
|
|
83
|
-
/* fetchBoard..., */
|
|
84
|
-
try {
|
|
85
|
-
var response = await client.query({
|
|
86
|
-
query: FETCH_BOARD_GQL(this.value),
|
|
87
|
-
context: gqlContext()
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
this._value = (response && response.data && response.data.board) || {}
|
|
91
|
-
} catch (e) {
|
|
92
|
-
console.error(e)
|
|
93
|
-
}
|
|
94
|
-
} else {
|
|
95
|
-
this._value = this.value || {}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
render() {
|
|
101
|
-
var { id, name = '', thumbnail = 'image/gif' } = this._value || {}
|
|
102
|
-
|
|
103
|
-
return id
|
|
104
|
-
? html`
|
|
105
|
-
<span>${name}</span>
|
|
106
|
-
<img src=${thumbnail} alt="no thumbnail!" />
|
|
107
|
-
<md-icon view @mousedown=${e => this.onClickViewer(e, id)}>search</md-icon>
|
|
108
|
-
<md-icon edit @mousedown=${e => this.onClickModeler(e, id)}>edit</md-icon>
|
|
109
|
-
`
|
|
110
|
-
: html` choose board.. `
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
onClickViewer(e, id) {
|
|
114
|
-
e.preventDefault()
|
|
115
|
-
e.stopPropagation()
|
|
116
|
-
|
|
117
|
-
var boardViewerPage = this.boardViewerPage || 'board-viewer'
|
|
118
|
-
|
|
119
|
-
navigate(`${boardViewerPage}/${id}${window.location.search}`)
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
onClickModeler(e, id) {
|
|
123
|
-
e.preventDefault()
|
|
124
|
-
e.stopPropagation()
|
|
125
|
-
|
|
126
|
-
navigate(`board-modeller/${id}${window.location.search}`)
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export const BoardRenderer = (value, column, record) => {
|
|
131
|
-
var { boardViewerPage = '' } = column.record.options || {}
|
|
132
|
-
|
|
133
|
-
return html` <board-renderer .value=${value} .boardViewerPage=${boardViewerPage}></board-renderer> `
|
|
134
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { customElement } from 'lit/decorators.js'
|
|
2
|
-
|
|
3
|
-
import { OxGristEditorValueMap } from '@operato/grist-editor/ox-grist-editor-value-map.js'
|
|
4
|
-
|
|
5
|
-
@customElement('color-map-editor')
|
|
6
|
-
export class ColorMapEditor extends OxGristEditorValueMap {
|
|
7
|
-
get options() {
|
|
8
|
-
const overidable = this.column.record?.options || {}
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: `Color Map : ${this.record.name}`,
|
|
12
|
-
valuetype: 'color',
|
|
13
|
-
objectified: true,
|
|
14
|
-
...overidable
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { customElement } from 'lit/decorators.js'
|
|
2
|
-
|
|
3
|
-
import { OxGristEditorValueRanges } from '@operato/grist-editor/ox-grist-editor-value-ranges.js'
|
|
4
|
-
|
|
5
|
-
@customElement('color-ranges-editor')
|
|
6
|
-
export class ColorRangesEditor extends OxGristEditorValueRanges {
|
|
7
|
-
get options() {
|
|
8
|
-
const overidable = this.column.record?.options || {}
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: `Color Ranges : ${this.record.name}`,
|
|
12
|
-
valuetype: 'color',
|
|
13
|
-
objectified: true,
|
|
14
|
-
...overidable
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import gql from 'graphql-tag'
|
|
2
|
-
|
|
3
|
-
import { client } from '@operato/graphql'
|
|
4
|
-
import { gqlBuilder } from '@things-factory/utils'
|
|
5
|
-
|
|
6
|
-
export async function fetchBoardTemplateList(listParam = {}) {
|
|
7
|
-
const response = await client.query({
|
|
8
|
-
query: gql`
|
|
9
|
-
{
|
|
10
|
-
boardTemplates(${gqlBuilder.buildArgs(listParam)}) {
|
|
11
|
-
items {
|
|
12
|
-
id
|
|
13
|
-
name
|
|
14
|
-
description
|
|
15
|
-
thumbnail
|
|
16
|
-
visibility
|
|
17
|
-
createdAt
|
|
18
|
-
updatedAt
|
|
19
|
-
}
|
|
20
|
-
total
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
`
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
return response.data
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export async function fetchBoardTemplate(id) {
|
|
30
|
-
const response = await client.query({
|
|
31
|
-
query: gql`
|
|
32
|
-
query FetchBoardTemplate($id: String!) {
|
|
33
|
-
boardTemplate(id: $id) {
|
|
34
|
-
id
|
|
35
|
-
name
|
|
36
|
-
description
|
|
37
|
-
thumbnail
|
|
38
|
-
model
|
|
39
|
-
visibility
|
|
40
|
-
createdAt
|
|
41
|
-
creator {
|
|
42
|
-
id
|
|
43
|
-
name
|
|
44
|
-
}
|
|
45
|
-
updatedAt
|
|
46
|
-
updater {
|
|
47
|
-
id
|
|
48
|
-
name
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
`,
|
|
53
|
-
variables: { id }
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
return response.data
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export async function createBoardTemplate(boardTemplate) {
|
|
60
|
-
/*
|
|
61
|
-
input NewBoard {
|
|
62
|
-
name : String!
|
|
63
|
-
description : String
|
|
64
|
-
model : String!
|
|
65
|
-
visibility : String!
|
|
66
|
-
}
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
boardTemplate.model = JSON.stringify(boardTemplate.model)
|
|
70
|
-
|
|
71
|
-
const response = await client.mutate({
|
|
72
|
-
mutation: gql`
|
|
73
|
-
mutation CreateBoardTemplate($boardTemplate: NewBoardTemplate!) {
|
|
74
|
-
createBoardTemplate(boardTemplate: $boardTemplate) {
|
|
75
|
-
id
|
|
76
|
-
name
|
|
77
|
-
description
|
|
78
|
-
model
|
|
79
|
-
visibility
|
|
80
|
-
createdAt
|
|
81
|
-
updatedAt
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
`,
|
|
85
|
-
variables: {
|
|
86
|
-
boardTemplate
|
|
87
|
-
}
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
return response.data
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export async function updateBoardTemplate(boardTemplate) {
|
|
94
|
-
/*
|
|
95
|
-
input BoardPatch {
|
|
96
|
-
name : String
|
|
97
|
-
description : String
|
|
98
|
-
model : String
|
|
99
|
-
visibility : String
|
|
100
|
-
}
|
|
101
|
-
*/
|
|
102
|
-
var { id, name, description, model, visibility } = boardTemplate
|
|
103
|
-
model = JSON.stringify(model)
|
|
104
|
-
|
|
105
|
-
const response = await client.mutate({
|
|
106
|
-
mutation: gql`
|
|
107
|
-
mutation UpdateBoard($id: String!, $patch: BoardTemplatePatch!) {
|
|
108
|
-
updateBoard(id: $id, patch: $patch) {
|
|
109
|
-
id
|
|
110
|
-
name
|
|
111
|
-
description
|
|
112
|
-
model
|
|
113
|
-
visibility
|
|
114
|
-
createdAt
|
|
115
|
-
updatedAt
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
`,
|
|
119
|
-
variables: {
|
|
120
|
-
id,
|
|
121
|
-
patch: { name, description, model, visibility }
|
|
122
|
-
}
|
|
123
|
-
})
|
|
124
|
-
|
|
125
|
-
return response.data
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export async function deleteBoardTemplate(id) {
|
|
129
|
-
const response = await client.mutate({
|
|
130
|
-
mutation: gql`
|
|
131
|
-
mutation ($id: String!) {
|
|
132
|
-
deleteBoardTemplate(id: $id)
|
|
133
|
-
}
|
|
134
|
-
`,
|
|
135
|
-
variables: {
|
|
136
|
-
id
|
|
137
|
-
}
|
|
138
|
-
})
|
|
139
|
-
|
|
140
|
-
return response.data
|
|
141
|
-
}
|
package/client/graphql/board.ts
DELETED
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
import gql from 'graphql-tag'
|
|
2
|
-
|
|
3
|
-
import { client } from '@operato/graphql'
|
|
4
|
-
import { gqlBuilder } from '@things-factory/utils'
|
|
5
|
-
|
|
6
|
-
export async function fetchBoardList(listParam = {}) {
|
|
7
|
-
const response = await client.query({
|
|
8
|
-
query: gql`
|
|
9
|
-
{
|
|
10
|
-
boards(${gqlBuilder.buildArgs(listParam)}) {
|
|
11
|
-
items {
|
|
12
|
-
id
|
|
13
|
-
name
|
|
14
|
-
description
|
|
15
|
-
thumbnail
|
|
16
|
-
state
|
|
17
|
-
version
|
|
18
|
-
createdAt
|
|
19
|
-
updatedAt
|
|
20
|
-
}
|
|
21
|
-
total
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
`
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
return response.data
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export async function fetchBoard(id) {
|
|
31
|
-
const response = await client.query({
|
|
32
|
-
query: gql`
|
|
33
|
-
query FetchBoardById($id: String!) {
|
|
34
|
-
board(id: $id) {
|
|
35
|
-
id
|
|
36
|
-
name
|
|
37
|
-
description
|
|
38
|
-
group {
|
|
39
|
-
id
|
|
40
|
-
name
|
|
41
|
-
}
|
|
42
|
-
thumbnail
|
|
43
|
-
model
|
|
44
|
-
createdAt
|
|
45
|
-
creator {
|
|
46
|
-
id
|
|
47
|
-
name
|
|
48
|
-
}
|
|
49
|
-
state
|
|
50
|
-
version
|
|
51
|
-
updatedAt
|
|
52
|
-
updater {
|
|
53
|
-
id
|
|
54
|
-
name
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
`,
|
|
59
|
-
variables: { id }
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
return response.data
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export async function createBoard(board) {
|
|
66
|
-
/*
|
|
67
|
-
input NewBoard {
|
|
68
|
-
name : String!
|
|
69
|
-
description : String
|
|
70
|
-
model : String!
|
|
71
|
-
groupId : String!
|
|
72
|
-
}
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
|
-
board.model = JSON.stringify(board.model)
|
|
76
|
-
|
|
77
|
-
const response = await client.mutate({
|
|
78
|
-
mutation: gql`
|
|
79
|
-
mutation CreateBoard($board: NewBoard!) {
|
|
80
|
-
createBoard(board: $board) {
|
|
81
|
-
id
|
|
82
|
-
name
|
|
83
|
-
description
|
|
84
|
-
model
|
|
85
|
-
state
|
|
86
|
-
version
|
|
87
|
-
createdAt
|
|
88
|
-
updatedAt
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
`,
|
|
92
|
-
variables: {
|
|
93
|
-
board
|
|
94
|
-
}
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
return response.data
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export async function cloneBoard({
|
|
101
|
-
id,
|
|
102
|
-
name,
|
|
103
|
-
description,
|
|
104
|
-
targetSubdomain,
|
|
105
|
-
targetGroupId
|
|
106
|
-
}: {
|
|
107
|
-
id: string
|
|
108
|
-
name: string
|
|
109
|
-
description: string
|
|
110
|
-
targetSubdomain: string
|
|
111
|
-
targetGroupId: string
|
|
112
|
-
}) {
|
|
113
|
-
const response = await client.mutate({
|
|
114
|
-
mutation: gql`
|
|
115
|
-
mutation CloneBoard($id: String!, $patch: BoardPatch!, $targetSubdomain: String!, $targetGroupId: String) {
|
|
116
|
-
cloneBoard(id: $id, patch: $patch, targetSubdomain: $targetSubdomain, targetGroupId: $targetGroupId) {
|
|
117
|
-
id
|
|
118
|
-
name
|
|
119
|
-
description
|
|
120
|
-
model
|
|
121
|
-
group {
|
|
122
|
-
id
|
|
123
|
-
name
|
|
124
|
-
}
|
|
125
|
-
state
|
|
126
|
-
version
|
|
127
|
-
createdAt
|
|
128
|
-
updatedAt
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
`,
|
|
132
|
-
variables: {
|
|
133
|
-
id,
|
|
134
|
-
patch: { name, description },
|
|
135
|
-
targetSubdomain,
|
|
136
|
-
targetGroupId
|
|
137
|
-
}
|
|
138
|
-
})
|
|
139
|
-
|
|
140
|
-
return response.data
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export async function releaseBoard(board) {
|
|
144
|
-
var { id } = board
|
|
145
|
-
|
|
146
|
-
const response = await client.mutate({
|
|
147
|
-
mutation: gql`
|
|
148
|
-
mutation ReleaseBoard($id: String!) {
|
|
149
|
-
releaseBoard(id: $id) {
|
|
150
|
-
id
|
|
151
|
-
name
|
|
152
|
-
description
|
|
153
|
-
model
|
|
154
|
-
group {
|
|
155
|
-
id
|
|
156
|
-
name
|
|
157
|
-
}
|
|
158
|
-
state
|
|
159
|
-
version
|
|
160
|
-
createdAt
|
|
161
|
-
updatedAt
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
`,
|
|
165
|
-
variables: {
|
|
166
|
-
id
|
|
167
|
-
}
|
|
168
|
-
})
|
|
169
|
-
|
|
170
|
-
return response.data
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export async function revertBoardVersion(id, version) {
|
|
174
|
-
const response = await client.mutate({
|
|
175
|
-
mutation: gql`
|
|
176
|
-
mutation RevertBoardVersion($id: String!, $version: Float!) {
|
|
177
|
-
revertBoardVersion(id: $id, version: $version) {
|
|
178
|
-
name
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
`,
|
|
182
|
-
variables: {
|
|
183
|
-
id,
|
|
184
|
-
version
|
|
185
|
-
}
|
|
186
|
-
})
|
|
187
|
-
|
|
188
|
-
return response.data.revertBoardVersion
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export async function updateBoard(board) {
|
|
192
|
-
/*
|
|
193
|
-
input BoardPatch {
|
|
194
|
-
name : String
|
|
195
|
-
description : String
|
|
196
|
-
model : String
|
|
197
|
-
}
|
|
198
|
-
*/
|
|
199
|
-
var { id, name, description, model, groupId } = board
|
|
200
|
-
model = JSON.stringify(model)
|
|
201
|
-
|
|
202
|
-
const response = await client.mutate({
|
|
203
|
-
mutation: gql`
|
|
204
|
-
mutation UpdateBoard($id: String!, $patch: BoardPatch!) {
|
|
205
|
-
updateBoard(id: $id, patch: $patch) {
|
|
206
|
-
id
|
|
207
|
-
name
|
|
208
|
-
description
|
|
209
|
-
model
|
|
210
|
-
group {
|
|
211
|
-
id
|
|
212
|
-
name
|
|
213
|
-
}
|
|
214
|
-
state
|
|
215
|
-
version
|
|
216
|
-
createdAt
|
|
217
|
-
updatedAt
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
`,
|
|
221
|
-
variables: {
|
|
222
|
-
id,
|
|
223
|
-
patch: { name, description, model, groupId }
|
|
224
|
-
}
|
|
225
|
-
})
|
|
226
|
-
|
|
227
|
-
return response.data
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
export async function deleteBoard(id) {
|
|
231
|
-
const response = await client.mutate({
|
|
232
|
-
mutation: gql`
|
|
233
|
-
mutation ($id: String!) {
|
|
234
|
-
deleteBoard(id: $id)
|
|
235
|
-
}
|
|
236
|
-
`,
|
|
237
|
-
variables: {
|
|
238
|
-
id
|
|
239
|
-
}
|
|
240
|
-
})
|
|
241
|
-
|
|
242
|
-
return response.data
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
export async function importBoards({
|
|
246
|
-
groupId,
|
|
247
|
-
files,
|
|
248
|
-
overwrite
|
|
249
|
-
}: {
|
|
250
|
-
groupId: string
|
|
251
|
-
files: File[]
|
|
252
|
-
overwrite: boolean
|
|
253
|
-
}) {
|
|
254
|
-
const response = await client.mutate({
|
|
255
|
-
mutation: gql`
|
|
256
|
-
mutation importBoards($groupId: String!, $files: [Upload!]!, $overwrite: Boolean!) {
|
|
257
|
-
importBoards(groupId: $groupId, files: $files, overwrite: $overwrite) {
|
|
258
|
-
id
|
|
259
|
-
name
|
|
260
|
-
description
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
`,
|
|
264
|
-
variables: {
|
|
265
|
-
groupId,
|
|
266
|
-
files,
|
|
267
|
-
overwrite
|
|
268
|
-
},
|
|
269
|
-
context: { hasUpload: true }
|
|
270
|
-
})
|
|
271
|
-
|
|
272
|
-
return response.data
|
|
273
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import gql from 'graphql-tag'
|
|
2
|
-
import { client } from '@operato/graphql'
|
|
3
|
-
import { gqlBuilder } from '@things-factory/utils'
|
|
4
|
-
|
|
5
|
-
export async function fetchFavoriteBoardList(listParam = {}) {
|
|
6
|
-
const response = await client.query({
|
|
7
|
-
query: gql`
|
|
8
|
-
{
|
|
9
|
-
favoriteBoards(${gqlBuilder.buildArgs(listParam)}) {
|
|
10
|
-
items {
|
|
11
|
-
id
|
|
12
|
-
name
|
|
13
|
-
description
|
|
14
|
-
thumbnail
|
|
15
|
-
createdAt
|
|
16
|
-
updatedAt
|
|
17
|
-
}
|
|
18
|
-
total
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
return response.data
|
|
25
|
-
}
|