@dssp/supervision 0.0.33 → 0.0.35
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/client/pages/building-inspection/building-inspection-detail-checklist.ts +1 -0
- package/client/pages/checklist/attachment-list-popup.ts +283 -0
- package/client/pages/checklist/checklist-view.ts +32 -7
- package/client/pages/checklist/comment-list-popup.ts +2 -1
- package/client/pages/checklist/file-preview-popup.ts +70 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +1 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
- package/dist-client/pages/checklist/attachment-list-popup.d.ts +2 -0
- package/dist-client/pages/checklist/attachment-list-popup.js +290 -0
- package/dist-client/pages/checklist/attachment-list-popup.js.map +1 -0
- package/dist-client/pages/checklist/checklist-view.d.ts +1 -0
- package/dist-client/pages/checklist/checklist-view.js +29 -8
- package/dist-client/pages/checklist/checklist-view.js.map +1 -1
- package/dist-client/pages/checklist/comment-list-popup.d.ts +0 -1
- package/dist-client/pages/checklist/comment-list-popup.js +2 -1
- package/dist-client/pages/checklist/comment-list-popup.js.map +1 -1
- package/dist-client/pages/checklist/file-preview-popup.d.ts +1 -0
- package/dist-client/pages/checklist/file-preview-popup.js +78 -0
- package/dist-client/pages/checklist/file-preview-popup.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/checklist-item/checklist-item-query.d.ts +3 -0
- package/dist-server/service/checklist-item/checklist-item-query.js +34 -2
- package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/server/service/checklist-item/checklist-item-query.ts +25 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dssp/supervision",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@dssp/building-complex": "^0.0.
|
|
31
|
-
"@dssp/drawing": "^0.0.
|
|
32
|
-
"@dssp/project": "^0.0.
|
|
30
|
+
"@dssp/building-complex": "^0.0.35",
|
|
31
|
+
"@dssp/drawing": "^0.0.35",
|
|
32
|
+
"@dssp/project": "^0.0.35",
|
|
33
33
|
"@operato/event-view": "^8.0.0-alpha",
|
|
34
34
|
"@operato/graphql": "^8.0.0-alpha",
|
|
35
35
|
"@operato/image-marker": "^8.0.0-alpha",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"@things-factory/auth-base": "^8.0.0-alpha",
|
|
40
40
|
"@things-factory/shell": "^8.0.0-alpha"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "075cee051e01751c29cbf1849968ba3f892c1e85"
|
|
43
43
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx
|
|
1
|
+
import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx } from 'type-graphql'
|
|
2
2
|
import { Attachment } from '@things-factory/attachment-base'
|
|
3
|
-
import {
|
|
3
|
+
import { getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'
|
|
4
4
|
import { User } from '@things-factory/auth-base'
|
|
5
5
|
import { ChecklistItem } from './checklist-item'
|
|
6
6
|
import { ChecklistItemList } from './checklist-item-type'
|
|
@@ -10,8 +10,6 @@ import { ChecklistItemComment } from '../checklist-item-comment/checklist-item-c
|
|
|
10
10
|
export class ChecklistItemQuery {
|
|
11
11
|
@Query(returns => ChecklistItem!, { nullable: true, description: 'To fetch a ChecklistItem' })
|
|
12
12
|
async checklistItem(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<ChecklistItem> {
|
|
13
|
-
const { domain } = context.state
|
|
14
|
-
|
|
15
13
|
return await getRepository(ChecklistItem).findOne({
|
|
16
14
|
where: { id }
|
|
17
15
|
})
|
|
@@ -19,8 +17,6 @@ export class ChecklistItemQuery {
|
|
|
19
17
|
|
|
20
18
|
@Query(returns => ChecklistItemList, { description: 'To fetch multiple ChecklistItems' })
|
|
21
19
|
async checklistItems(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<ChecklistItemList> {
|
|
22
|
-
const { domain } = context.state
|
|
23
|
-
|
|
24
20
|
const queryBuilder = getQueryBuilderFromListParams({
|
|
25
21
|
params,
|
|
26
22
|
repository: await getRepository(ChecklistItem),
|
|
@@ -42,6 +38,29 @@ export class ChecklistItemQuery {
|
|
|
42
38
|
return await getRepository(ChecklistItemComment).countBy({ checklistItem: { id: checklistItem.id } })
|
|
43
39
|
}
|
|
44
40
|
|
|
41
|
+
@FieldResolver(type => [Attachment])
|
|
42
|
+
async checklistItemAttachments(@Root() checklistItem: ChecklistItem): Promise<Attachment[]> {
|
|
43
|
+
return await getRepository(Attachment).find({
|
|
44
|
+
where: {
|
|
45
|
+
refType: ChecklistItem.name,
|
|
46
|
+
refBy: checklistItem.id
|
|
47
|
+
},
|
|
48
|
+
order: {
|
|
49
|
+
createdAt: 'DESC'
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@FieldResolver(type => Number)
|
|
55
|
+
async checklistItemAttachmentCount(@Root() checklistItem: ChecklistItem): Promise<number> {
|
|
56
|
+
return await getRepository(Attachment).count({
|
|
57
|
+
where: {
|
|
58
|
+
refType: ChecklistItem.name,
|
|
59
|
+
refBy: checklistItem.id
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
45
64
|
@FieldResolver(type => User)
|
|
46
65
|
async updater(@Root() checklistItem: ChecklistItem): Promise<User> {
|
|
47
66
|
return await getRepository(User).findOneBy({ id: checklistItem.updaterId })
|