@dssp/supervision 1.0.0-alpha.0 → 1.0.0-alpha.14

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.
Files changed (288) hide show
  1. package/dist-client/pages/action-plan/action-plan-importer.js.map +1 -1
  2. package/dist-client/pages/action-plan/action-plan-list-page.js.map +1 -1
  3. package/dist-client/pages/building-inspection/building-inspection-detail-camera.js.map +1 -1
  4. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +1 -1
  5. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
  6. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.d.ts +0 -1
  7. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +16 -11
  8. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -1
  9. package/dist-client/pages/building-inspection/building-inspection-list.d.ts +2 -2
  10. package/dist-client/pages/building-inspection/building-inspection-list.js +2 -1
  11. package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
  12. package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -1
  13. package/dist-client/pages/building-inspection/component/inspection-event-provider.js +3 -3
  14. package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
  15. package/dist-client/pages/building-inspection/inspection-create-popup.js +8 -5
  16. package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -1
  17. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.d.ts +46 -0
  18. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js +930 -0
  19. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js.map +1 -0
  20. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.d.ts +2 -0
  21. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js +736 -0
  22. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js.map +1 -0
  23. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.d.ts +1 -0
  24. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.js +304 -0
  25. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.js.map +1 -0
  26. package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.d.ts +15 -0
  27. package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.js +430 -0
  28. package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.js.map +1 -0
  29. package/dist-client/pages/checklist/attachment-list-popup.js.map +1 -1
  30. package/dist-client/pages/checklist/checklist-view.d.ts +6 -0
  31. package/dist-client/pages/checklist/checklist-view.js +291 -185
  32. package/dist-client/pages/checklist/checklist-view.js.map +1 -1
  33. package/dist-client/pages/checklist/comment-list-popup.js.map +1 -1
  34. package/dist-client/pages/checklist/file-preview-popup.js.map +1 -1
  35. package/dist-client/pages/checklist-template/checklist-template-item.js +8 -3
  36. package/dist-client/pages/checklist-template/checklist-template-item.js.map +1 -1
  37. package/dist-client/pages/checklist-template/checklist-template-list.js +1 -1
  38. package/dist-client/pages/checklist-template/checklist-template-list.js.map +1 -1
  39. package/dist-client/pages/checklist-template/checklist-type-management.d.ts +2 -2
  40. package/dist-client/pages/checklist-template/checklist-type-management.js.map +1 -1
  41. package/dist-client/pages/issue/issue-importer.js.map +1 -1
  42. package/dist-client/pages/issue/issue-list-page.js.map +1 -1
  43. package/dist-client/pages/project-report/project-report-importer.js.map +1 -1
  44. package/dist-client/pages/project-report/project-report-list-page.js.map +1 -1
  45. package/dist-client/pages/supervisor/supervisor-importer.js.map +1 -1
  46. package/dist-client/pages/supervisor/supervisor-list-page.js.map +1 -1
  47. package/dist-client/route.d.ts +1 -1
  48. package/dist-client/route.js +3 -0
  49. package/dist-client/route.js.map +1 -1
  50. package/dist-client/stt/speech-to-text.d.ts +36 -0
  51. package/dist-client/stt/speech-to-text.js +89 -0
  52. package/dist-client/stt/speech-to-text.js.map +1 -0
  53. package/dist-client/stt/stt-utils.d.ts +28 -0
  54. package/dist-client/stt/stt-utils.js +146 -0
  55. package/dist-client/stt/stt-utils.js.map +1 -0
  56. package/dist-client/tsconfig.tsbuildinfo +1 -1
  57. package/dist-server/middlewares/index.js +1 -2
  58. package/dist-server/middlewares/index.js.map +1 -1
  59. package/dist-server/service/action-plan/action-plan-mutation.js +2 -2
  60. package/dist-server/service/action-plan/action-plan-mutation.js.map +1 -1
  61. package/dist-server/service/action-plan/action-plan-query.js +2 -2
  62. package/dist-server/service/action-plan/action-plan-query.js.map +1 -1
  63. package/dist-server/service/action-plan/action-plan-type.js +6 -6
  64. package/dist-server/service/action-plan/action-plan-type.js.map +1 -1
  65. package/dist-server/service/action-plan/action-plan.js +3 -3
  66. package/dist-server/service/action-plan/action-plan.js.map +1 -1
  67. package/dist-server/service/action-plan/index.d.ts +0 -1
  68. package/dist-server/service/action-plan/index.js +1 -2
  69. package/dist-server/service/action-plan/index.js.map +1 -1
  70. package/dist-server/service/building-inspection/building-inspection-history.js +2 -2
  71. package/dist-server/service/building-inspection/building-inspection-history.js.map +1 -1
  72. package/dist-server/service/building-inspection/building-inspection-mutation.d.ts +1 -0
  73. package/dist-server/service/building-inspection/building-inspection-mutation.js +91 -14
  74. package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
  75. package/dist-server/service/building-inspection/building-inspection-query.d.ts +2 -1
  76. package/dist-server/service/building-inspection/building-inspection-query.js +33 -4
  77. package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
  78. package/dist-server/service/building-inspection/building-inspection-type.d.ts +10 -3
  79. package/dist-server/service/building-inspection/building-inspection-type.js +45 -20
  80. package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
  81. package/dist-server/service/building-inspection/building-inspection.d.ts +9 -0
  82. package/dist-server/service/building-inspection/building-inspection.js +43 -5
  83. package/dist-server/service/building-inspection/building-inspection.js.map +1 -1
  84. package/dist-server/service/building-inspection/index.d.ts +2 -4
  85. package/dist-server/service/building-inspection/index.js +2 -4
  86. package/dist-server/service/building-inspection/index.js.map +1 -1
  87. package/dist-server/service/checklist/checklist-history.d.ts +8 -0
  88. package/dist-server/service/checklist/checklist-history.js +38 -2
  89. package/dist-server/service/checklist/checklist-history.js.map +1 -1
  90. package/dist-server/service/checklist/checklist-mutation.js +2 -2
  91. package/dist-server/service/checklist/checklist-mutation.js.map +1 -1
  92. package/dist-server/service/checklist/checklist-query.js +2 -2
  93. package/dist-server/service/checklist/checklist-query.js.map +1 -1
  94. package/dist-server/service/checklist/checklist-type.js +6 -6
  95. package/dist-server/service/checklist/checklist-type.js.map +1 -1
  96. package/dist-server/service/checklist/checklist.d.ts +19 -1
  97. package/dist-server/service/checklist/checklist.js +78 -7
  98. package/dist-server/service/checklist/checklist.js.map +1 -1
  99. package/dist-server/service/checklist/index.d.ts +0 -2
  100. package/dist-server/service/checklist/index.js +1 -3
  101. package/dist-server/service/checklist/index.js.map +1 -1
  102. package/dist-server/service/checklist-item/checklist-item-mutation.js +2 -2
  103. package/dist-server/service/checklist-item/checklist-item-mutation.js.map +1 -1
  104. package/dist-server/service/checklist-item/checklist-item-query.js +2 -2
  105. package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -1
  106. package/dist-server/service/checklist-item/checklist-item-type.js +2 -2
  107. package/dist-server/service/checklist-item/checklist-item-type.js.map +1 -1
  108. package/dist-server/service/checklist-item/checklist-item.js +3 -3
  109. package/dist-server/service/checklist-item/checklist-item.js.map +1 -1
  110. package/dist-server/service/checklist-item-comment/checklist-item-comment-history.js +2 -2
  111. package/dist-server/service/checklist-item-comment/checklist-item-comment-history.js.map +1 -1
  112. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js +2 -2
  113. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js.map +1 -1
  114. package/dist-server/service/checklist-item-comment/checklist-item-comment-query.js +2 -2
  115. package/dist-server/service/checklist-item-comment/checklist-item-comment-query.js.map +1 -1
  116. package/dist-server/service/checklist-item-comment/checklist-item-comment-type.js +6 -6
  117. package/dist-server/service/checklist-item-comment/checklist-item-comment-type.js.map +1 -1
  118. package/dist-server/service/checklist-item-comment/checklist-item-comment.js +2 -2
  119. package/dist-server/service/checklist-item-comment/checklist-item-comment.js.map +1 -1
  120. package/dist-server/service/checklist-item-comment/index.d.ts +0 -2
  121. package/dist-server/service/checklist-item-comment/index.js +1 -3
  122. package/dist-server/service/checklist-item-comment/index.js.map +1 -1
  123. package/dist-server/service/checklist-template/checklist-template-mutation.js +2 -2
  124. package/dist-server/service/checklist-template/checklist-template-mutation.js.map +1 -1
  125. package/dist-server/service/checklist-template/checklist-template-query.js +2 -2
  126. package/dist-server/service/checklist-template/checklist-template-query.js.map +1 -1
  127. package/dist-server/service/checklist-template/checklist-template-type.js +4 -4
  128. package/dist-server/service/checklist-template/checklist-template-type.js.map +1 -1
  129. package/dist-server/service/checklist-template/checklist-template.js +2 -2
  130. package/dist-server/service/checklist-template/checklist-template.js.map +1 -1
  131. package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js +2 -2
  132. package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js.map +1 -1
  133. package/dist-server/service/checklist-template-item/checklist-template-item-query.js +2 -2
  134. package/dist-server/service/checklist-template-item/checklist-template-item-query.js.map +1 -1
  135. package/dist-server/service/checklist-template-item/checklist-template-item-type.js +4 -4
  136. package/dist-server/service/checklist-template-item/checklist-template-item-type.js.map +1 -1
  137. package/dist-server/service/checklist-template-item/checklist-template-item.js +4 -6
  138. package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -1
  139. package/dist-server/service/checklist-type/checklist-type-mutation.js +2 -2
  140. package/dist-server/service/checklist-type/checklist-type-mutation.js.map +1 -1
  141. package/dist-server/service/checklist-type/checklist-type-query.js +2 -2
  142. package/dist-server/service/checklist-type/checklist-type-query.js.map +1 -1
  143. package/dist-server/service/checklist-type/checklist-type-type.js +4 -4
  144. package/dist-server/service/checklist-type/checklist-type-type.js.map +1 -1
  145. package/dist-server/service/checklist-type/checklist-type.js +3 -3
  146. package/dist-server/service/checklist-type/checklist-type.js.map +1 -1
  147. package/dist-server/service/index.d.ts +0 -1
  148. package/dist-server/service/index.js +1 -11
  149. package/dist-server/service/index.js.map +1 -1
  150. package/dist-server/service/issue/index.d.ts +0 -1
  151. package/dist-server/service/issue/index.js +1 -2
  152. package/dist-server/service/issue/index.js.map +1 -1
  153. package/dist-server/service/issue/issue-mutation.js +2 -2
  154. package/dist-server/service/issue/issue-mutation.js.map +1 -1
  155. package/dist-server/service/issue/issue-query.js +2 -2
  156. package/dist-server/service/issue/issue-query.js.map +1 -1
  157. package/dist-server/service/issue/issue-type.js +6 -6
  158. package/dist-server/service/issue/issue-type.js.map +1 -1
  159. package/dist-server/service/issue/issue.js +3 -3
  160. package/dist-server/service/issue/issue.js.map +1 -1
  161. package/dist-server/service/project-report/index.d.ts +0 -1
  162. package/dist-server/service/project-report/index.js +1 -2
  163. package/dist-server/service/project-report/index.js.map +1 -1
  164. package/dist-server/service/project-report/project-report-mutation.js +2 -2
  165. package/dist-server/service/project-report/project-report-mutation.js.map +1 -1
  166. package/dist-server/service/project-report/project-report-query.js +2 -2
  167. package/dist-server/service/project-report/project-report-query.js.map +1 -1
  168. package/dist-server/service/project-report/project-report-type.js +6 -6
  169. package/dist-server/service/project-report/project-report-type.js.map +1 -1
  170. package/dist-server/service/project-report/project-report.js +3 -3
  171. package/dist-server/service/project-report/project-report.js.map +1 -1
  172. package/dist-server/service/supervisor/index.d.ts +0 -1
  173. package/dist-server/service/supervisor/index.js +1 -2
  174. package/dist-server/service/supervisor/index.js.map +1 -1
  175. package/dist-server/service/supervisor/supervisor-mutation.js +2 -2
  176. package/dist-server/service/supervisor/supervisor-mutation.js.map +1 -1
  177. package/dist-server/service/supervisor/supervisor-query.js +2 -2
  178. package/dist-server/service/supervisor/supervisor-query.js.map +1 -1
  179. package/dist-server/service/supervisor/supervisor-type.js +6 -6
  180. package/dist-server/service/supervisor/supervisor-type.js.map +1 -1
  181. package/dist-server/service/supervisor/supervisor.js +3 -3
  182. package/dist-server/service/supervisor/supervisor.js.map +1 -1
  183. package/dist-server/tsconfig.tsbuildinfo +1 -1
  184. package/package.json +13 -13
  185. package/things-factory.config.js +3 -1
  186. package/client/bootstrap.ts +0 -1
  187. package/client/index.ts +0 -0
  188. package/client/pages/action-plan/action-plan-importer.ts +0 -94
  189. package/client/pages/action-plan/action-plan-list-page.ts +0 -340
  190. package/client/pages/building-inspection/building-inspection-detail-camera.ts +0 -277
  191. package/client/pages/building-inspection/building-inspection-detail-checklist.ts +0 -258
  192. package/client/pages/building-inspection/building-inspection-detail-drawing.ts +0 -288
  193. package/client/pages/building-inspection/building-inspection-list.ts +0 -565
  194. package/client/pages/building-inspection/component/building-inspection-detail-header.ts +0 -123
  195. package/client/pages/building-inspection/component/inspection-event-provider.ts +0 -81
  196. package/client/pages/building-inspection/inspection-create-popup.ts +0 -785
  197. package/client/pages/checklist/attachment-list-popup.ts +0 -301
  198. package/client/pages/checklist/checklist-view.ts +0 -581
  199. package/client/pages/checklist/comment-list-popup.ts +0 -328
  200. package/client/pages/checklist/file-preview-popup.ts +0 -70
  201. package/client/pages/checklist-template/checklist-template-item.ts +0 -240
  202. package/client/pages/checklist-template/checklist-template-list.ts +0 -368
  203. package/client/pages/checklist-template/checklist-type-management.ts +0 -262
  204. package/client/pages/issue/issue-importer.ts +0 -94
  205. package/client/pages/issue/issue-list-page.ts +0 -340
  206. package/client/pages/project-report/project-report-importer.ts +0 -94
  207. package/client/pages/project-report/project-report-list-page.ts +0 -340
  208. package/client/pages/supervisor/supervisor-importer.ts +0 -94
  209. package/client/pages/supervisor/supervisor-list-page.ts +0 -340
  210. package/client/route.ts +0 -27
  211. package/client/tsconfig.json +0 -11
  212. package/dist-server/service/building-inspection/event-subscriber.d.ts +0 -7
  213. package/dist-server/service/building-inspection/event-subscriber.js +0 -21
  214. package/dist-server/service/building-inspection/event-subscriber.js.map +0 -1
  215. package/dist-server/service/checklist/event-subscriber.d.ts +0 -7
  216. package/dist-server/service/checklist/event-subscriber.js +0 -21
  217. package/dist-server/service/checklist/event-subscriber.js.map +0 -1
  218. package/dist-server/service/checklist-item-comment/event-subscriber.d.ts +0 -7
  219. package/dist-server/service/checklist-item-comment/event-subscriber.js +0 -21
  220. package/dist-server/service/checklist-item-comment/event-subscriber.js.map +0 -1
  221. package/server/controllers/index.ts +0 -0
  222. package/server/index.ts +0 -4
  223. package/server/middlewares/index.ts +0 -3
  224. package/server/migrations/index.ts +0 -9
  225. package/server/routes.ts +0 -28
  226. package/server/service/action-plan/action-plan-mutation.ts +0 -198
  227. package/server/service/action-plan/action-plan-query.ts +0 -62
  228. package/server/service/action-plan/action-plan-type.ts +0 -61
  229. package/server/service/action-plan/action-plan.ts +0 -103
  230. package/server/service/action-plan/index.ts +0 -7
  231. package/server/service/building-inspection/building-inspection-history.ts +0 -72
  232. package/server/service/building-inspection/building-inspection-mutation.ts +0 -276
  233. package/server/service/building-inspection/building-inspection-query.ts +0 -242
  234. package/server/service/building-inspection/building-inspection-type.ts +0 -145
  235. package/server/service/building-inspection/building-inspection.ts +0 -108
  236. package/server/service/building-inspection/event-subscriber.ts +0 -20
  237. package/server/service/building-inspection/index.ts +0 -11
  238. package/server/service/checklist/checklist-history.ts +0 -96
  239. package/server/service/checklist/checklist-mutation.ts +0 -103
  240. package/server/service/checklist/checklist-query.ts +0 -58
  241. package/server/service/checklist/checklist-type.ts +0 -49
  242. package/server/service/checklist/checklist.ts +0 -127
  243. package/server/service/checklist/event-subscriber.ts +0 -17
  244. package/server/service/checklist/index.ts +0 -9
  245. package/server/service/checklist-item/checklist-item-mutation.ts +0 -5
  246. package/server/service/checklist-item/checklist-item-query.ts +0 -84
  247. package/server/service/checklist-item/checklist-item-type.ts +0 -12
  248. package/server/service/checklist-item/checklist-item.ts +0 -103
  249. package/server/service/checklist-item/index.ts +0 -7
  250. package/server/service/checklist-item-comment/checklist-item-comment-history.ts +0 -69
  251. package/server/service/checklist-item-comment/checklist-item-comment-mutation.ts +0 -80
  252. package/server/service/checklist-item-comment/checklist-item-comment-query.ts +0 -36
  253. package/server/service/checklist-item-comment/checklist-item-comment-type.ts +0 -32
  254. package/server/service/checklist-item-comment/checklist-item-comment.ts +0 -56
  255. package/server/service/checklist-item-comment/event-subscriber.ts +0 -17
  256. package/server/service/checklist-item-comment/index.ts +0 -9
  257. package/server/service/checklist-template/checklist-template-mutation.ts +0 -66
  258. package/server/service/checklist-template/checklist-template-query.ts +0 -39
  259. package/server/service/checklist-template/checklist-template-type.ts +0 -23
  260. package/server/service/checklist-template/checklist-template.ts +0 -71
  261. package/server/service/checklist-template/index.ts +0 -6
  262. package/server/service/checklist-template-item/checklist-template-item-mutation.ts +0 -64
  263. package/server/service/checklist-template-item/checklist-template-item-query.ts +0 -44
  264. package/server/service/checklist-template-item/checklist-template-item-type.ts +0 -39
  265. package/server/service/checklist-template-item/checklist-template-item.ts +0 -68
  266. package/server/service/checklist-template-item/index.ts +0 -6
  267. package/server/service/checklist-type/checklist-type-mutation.ts +0 -66
  268. package/server/service/checklist-type/checklist-type-query.ts +0 -39
  269. package/server/service/checklist-type/checklist-type-type.ts +0 -26
  270. package/server/service/checklist-type/checklist-type.ts +0 -64
  271. package/server/service/checklist-type/index.ts +0 -6
  272. package/server/service/index.ts +0 -88
  273. package/server/service/issue/index.ts +0 -7
  274. package/server/service/issue/issue-mutation.ts +0 -198
  275. package/server/service/issue/issue-query.ts +0 -62
  276. package/server/service/issue/issue-type.ts +0 -61
  277. package/server/service/issue/issue.ts +0 -100
  278. package/server/service/project-report/index.ts +0 -7
  279. package/server/service/project-report/project-report-mutation.ts +0 -198
  280. package/server/service/project-report/project-report-query.ts +0 -62
  281. package/server/service/project-report/project-report-type.ts +0 -61
  282. package/server/service/project-report/project-report.ts +0 -113
  283. package/server/service/supervisor/index.ts +0 -7
  284. package/server/service/supervisor/supervisor-mutation.ts +0 -198
  285. package/server/service/supervisor/supervisor-query.ts +0 -62
  286. package/server/service/supervisor/supervisor-type.ts +0 -61
  287. package/server/service/supervisor/supervisor.ts +0 -108
  288. package/server/tsconfig.json +0 -10
@@ -1,328 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import gql from 'graphql-tag'
3
- import { client } from '@operato/graphql'
4
- import { css, html, LitElement } from 'lit'
5
- import { customElement, property, query, state } from 'lit/decorators.js'
6
- import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
7
- import { notify } from '@operato/layout'
8
- import { store, User } from '@operato/shell'
9
- import { connect } from 'pwa-helpers/connect-mixin.js'
10
- import { OxPrompt } from '@operato/popup/ox-prompt.js'
11
- import { BuildingInspectionStatus } from '../building-inspection/building-inspection-list'
12
-
13
- @customElement('comment-list-popup')
14
- class CommentListPopup extends connect(store)(LitElement) {
15
- static styles = [
16
- ButtonContainerStyles,
17
- ScrollbarStyles,
18
- css`
19
- :host {
20
- display: flex;
21
- flex-direction: column;
22
- padding: 15px 20px;
23
- background-color: var(--md-sys-color-surface);
24
- }
25
-
26
- div[body] {
27
- height: 100%;
28
- display: flex;
29
- flex-direction: column;
30
- gap: 12px;
31
- }
32
-
33
- div[comments-container] {
34
- overflow-y: auto;
35
- gap: 10px;
36
- display: flex;
37
- flex-direction: column;
38
- flex: 1;
39
-
40
- div[comment-row] {
41
- display: flex;
42
- flex-direction: column;
43
- padding-right: 10px;
44
-
45
- div[creator-container] {
46
- display: flex;
47
- justify-content: space-between;
48
-
49
- span[creator] {
50
- font-weight: 600;
51
- display: flex;
52
- align-items: center;
53
- gap: 3px;
54
- }
55
- span[createdAt] {
56
- display: flex;
57
- align-items: center;
58
- gap: 3px;
59
-
60
- md-icon[delete] {
61
- cursor: pointer;
62
- }
63
- }
64
- }
65
-
66
- div[comment] {
67
- margin-left: 20px;
68
- }
69
- }
70
- }
71
-
72
- h3 {
73
- position: relative;
74
- color: rgb(5, 149, 229);
75
- font-size: 17px;
76
- font-weight: 700;
77
- background-color: var(--md-sys-color-surface);
78
- margin-top: 0px;
79
- margin-bottom: 5px;
80
- }
81
-
82
- textarea {
83
- height: 75px;
84
- border: 1px solid #ccc;
85
- }
86
-
87
- div[button-container] {
88
- display: flex;
89
- justify-content: flex-end;
90
- gap: 10px;
91
-
92
- md-elevated-button[blue] {
93
- --md-elevated-button-container-color: #0595e5;
94
-
95
- --md-elevated-button-label-text-color: #fff;
96
- --md-elevated-button-hover-label-text-color: #fff;
97
- --md-elevated-button-pressed-label-text-color: #fff;
98
- --md-elevated-button-focus-label-text-color: #fff;
99
- --md-elevated-button-icon-color: #fff;
100
- --md-elevated-button-hover-icon-color: #fff;
101
- --md-elevated-button-pressed-icon-color: #fff;
102
- --md-elevated-button-focus-icon-color: #fff;
103
- }
104
- }
105
- `
106
- ]
107
-
108
- @property({ type: String }) checklistItemId: string = ''
109
- @property({ type: String }) status: BuildingInspectionStatus = BuildingInspectionStatus.WAIT
110
-
111
- @state() item: any = { count: 0 }
112
- @state() checklistItemComments: any = []
113
- @state() comment: string = ''
114
- @state() checklistItemCommentCount: number = 0
115
- @state() user: User = {}
116
- @state() page: number = 1
117
- @state() loading: boolean = false
118
- @state() hasMoreComments: boolean = true
119
-
120
- @query('div[comments-container]') commentsContainer!: HTMLDivElement
121
-
122
- render() {
123
- return html`
124
- <div body>
125
- <h3>제품검사에 대한 확인: ${this.checklistItemCommentCount || 0}건</h3>
126
-
127
- <div comments-container @scroll=${this._onScroll}>
128
- ${this.checklistItemComments.map(comment => {
129
- return html`
130
- <div comment-row>
131
- <div creator-container>
132
- <span creator><md-icon slot="icon">account_circle</md-icon> ${comment.creator.name}</span>
133
- <span createdAt>
134
- <md-icon slot="icon">schedule</md-icon> ${this._formatDate(comment.createdAt)}
135
- ${comment.creator.email === this.user.email && this.status != BuildingInspectionStatus.PASS
136
- ? html` <md-icon delete slot="icon" @click=${() => this._deleteComment(comment.id)}>delete</md-icon>`
137
- : ''}
138
- </span>
139
- </div>
140
- <div comment>${comment.comment}</div>
141
- </div>
142
- `
143
- })}
144
- </div>
145
-
146
- <textarea
147
- .value=${this.comment || ''}
148
- ?disabled=${this.status == BuildingInspectionStatus.PASS}
149
- @input=${this._onInputChange}
150
- ></textarea>
151
-
152
- <div button-container>
153
- <md-elevated-button blue ?disabled=${this.status == BuildingInspectionStatus.PASS} @click=${this._createComment}>
154
- <md-icon slot="icon">task</md-icon>저장
155
- </md-elevated-button>
156
- <md-elevated-button @click=${this._close}> <md-icon slot="icon">cancel</md-icon>취소 </md-elevated-button>
157
- </div>
158
- </div>
159
- `
160
- }
161
-
162
- async firstUpdated() {
163
- this.user = (store.getState() as any).auth?.user
164
- this.comment = ''
165
- this.page = 1
166
- await this._loadComments()
167
- this._scrollBottom()
168
- }
169
-
170
- private async _loadComments() {
171
- if (this.loading || !this.hasMoreComments) return
172
-
173
- this.loading = true
174
-
175
- const response = await client.query({
176
- query: gql`
177
- query ChecklistItemComments($pagination: Pagination!, $checklistItemId: String!) {
178
- checklistItemComments(pagination: $pagination, checklistItemId: $checklistItemId) {
179
- id
180
- comment
181
- creator {
182
- id
183
- email
184
- name
185
- }
186
- createdAt
187
- }
188
-
189
- checklistItem(id: $checklistItemId) {
190
- id
191
- checklistItemCommentCount
192
- }
193
- }
194
- `,
195
- variables: {
196
- checklistItemId: this.checklistItemId,
197
- pagination: {
198
- page: this.page,
199
- limit: 10
200
- }
201
- }
202
- })
203
-
204
- if (response.errors) return
205
-
206
- const items = response.data.checklistItemComments
207
- if (items.length < 10) this.hasMoreComments = false
208
-
209
- this.checklistItemComments = [...items.reverse(), ...this.checklistItemComments]
210
- this.page += 1
211
- this.checklistItemCommentCount = response.data.checklistItem.checklistItemCommentCount
212
- this.loading = false
213
- }
214
-
215
- // 스크롤이 맨 위에 가까울 때 데이터 요청
216
- private _onScroll() {
217
- const { scrollTop } = this.commentsContainer
218
- if (scrollTop <= 5) {
219
- this._loadComments()
220
- }
221
- }
222
-
223
- private async _createComment() {
224
- if (!this.comment) {
225
- notify({ message: '조치사항을 입력해주세요.', level: 'warn' })
226
- return
227
- }
228
-
229
- const response = await client.mutate({
230
- mutation: gql`
231
- mutation CreateChecklistItemComment($checklistItemComment: NewChecklistItemComment!) {
232
- createChecklistItemComment(checklistItemComment: $checklistItemComment) {
233
- id
234
- comment
235
- creator {
236
- id
237
- email
238
- }
239
- createdAt
240
- }
241
- }
242
- `,
243
- variables: {
244
- checklistItemComment: {
245
- comment: this.comment,
246
- checklistItemId: this.checklistItemId
247
- }
248
- }
249
- })
250
-
251
- if (!response.errors) {
252
- this.comment = ''
253
- this.checklistItemComments = [...this.checklistItemComments, { ...response.data.createChecklistItemComment }]
254
- this._scrollBottom()
255
- this.checklistItemCommentCount++
256
- } else {
257
- notify({ message: response.errors?.[0]?.message || '조치사항 등록에 실패하였습니다.', level: 'error' })
258
- }
259
-
260
- this._dispatchEvent()
261
- }
262
-
263
- private async _deleteComment(commentId: string) {
264
- if (
265
- await OxPrompt.open({
266
- title: '조치 사항을 삭제',
267
- text: '조치 사항을 삭제 하시겠습니까?',
268
- confirmButton: { text: '삭제' },
269
- cancelButton: { text: '취소' }
270
- })
271
- ) {
272
- const response = await client.mutate({
273
- mutation: gql`
274
- mutation DeleteChecklistItemComment($id: String!) {
275
- deleteChecklistItemComment(id: $id)
276
- }
277
- `,
278
- variables: {
279
- id: commentId
280
- }
281
- })
282
-
283
- if (!response.errors) {
284
- this.checklistItemComments = [...this.checklistItemComments.filter(comment => comment.id != commentId)]
285
- notify({ message: '조치사항을 삭제하였습니다.', level: 'info' })
286
- } else {
287
- notify({ message: response.errors?.[0]?.message || '조치사항 삭제에 실패하였습니다.', level: 'error' })
288
- }
289
-
290
- this._dispatchEvent()
291
- }
292
- }
293
-
294
- private _close() {
295
- history.back()
296
- }
297
-
298
- // Input 요소의 값이 변경될 때 호출되는 콜백 함수
299
- private _onInputChange(event: InputEvent) {
300
- const target = event.target as HTMLInputElement
301
- this.comment = target.value
302
- }
303
-
304
- private _formatDate(date) {
305
- const _date = new Date(date.toLocaleString('en-US', { timeZone: 'Asia/Seoul' }))
306
-
307
- const year = _date.getFullYear()
308
- const month = String(_date.getMonth() + 1).padStart(2, '0')
309
- const day = String(_date.getDate()).padStart(2, '0')
310
- const hours = String(_date.getHours()).padStart(2, '0')
311
- const minutes = String(_date.getMinutes()).padStart(2, '0')
312
- const seconds = String(_date.getSeconds()).padStart(2, '0')
313
-
314
- return `${year}.${month}.${day} ${hours}:${minutes}:${seconds}`
315
- }
316
-
317
- // 댓글 스크롤 맨 밑으로
318
- private async _scrollBottom() {
319
- setTimeout(() => {
320
- this.commentsContainer.scrollTop = this.commentsContainer.scrollHeight
321
- }, 100)
322
- }
323
-
324
- // 조치사항 변경 이벤트 디스패치
325
- _dispatchEvent() {
326
- this.dispatchEvent(new CustomEvent('change-comment', { detail: { checklistItemId: this.checklistItemId } }))
327
- }
328
- }
@@ -1,70 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import { css, html, LitElement } from 'lit'
3
- import { customElement, property, query } from 'lit/decorators.js'
4
- import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
5
-
6
- @customElement('file-preview-popup')
7
- class FilePreviewPopup extends LitElement {
8
- static styles = [
9
- ButtonContainerStyles,
10
- ScrollbarStyles,
11
- css`
12
- :host {
13
- display: flex;
14
- flex-direction: column;
15
- padding: 15px 20px;
16
- overflow-y: auto;
17
- background-color: var(--md-sys-color-surface);
18
- }
19
-
20
- .modal-content {
21
- margin: 5% auto;
22
- width: 90%;
23
- background-color: white;
24
- text-align: center;
25
- }
26
- `
27
- ]
28
-
29
- @property({ type: String }) filepath: string = ''
30
-
31
- @query('#previewContent') previewContent!: HTMLDivElement
32
-
33
- render() {
34
- return html` <div class="modal-content" id="previewContent"></div>`
35
- }
36
-
37
- async firstUpdated() {
38
- this.showPreview(this.filepath)
39
- }
40
-
41
- showPreview(fileUrl) {
42
- // 파일 확장자 확인
43
- const fileExtension = fileUrl.split('.').pop().toLowerCase()
44
- this.previewContent.innerHTML = ''
45
-
46
- console.log(fileExtension)
47
-
48
- if (['jpg', 'jpeg', 'png', 'gif', 'webp'].includes(fileExtension)) {
49
- // 이미지 미리보기
50
- const img = document.createElement('img')
51
- img.src = fileUrl
52
- img.alt = '미리보기 이미지'
53
- img.style.width = '100%'
54
- this.previewContent.appendChild(img)
55
- } else if (fileExtension === 'pdf') {
56
- // PDF 미리보기
57
- const iframe = document.createElement('iframe')
58
- iframe.src = `${fileUrl}#toolbar=0&navpanes=0&scrollbar=0` // 툴바, 내비게이션 및 스크롤바 숨기기
59
- iframe.style.width = '100%'
60
- iframe.style.height = '100vh'
61
- iframe.style.border = 'none'
62
- this.previewContent.appendChild(iframe)
63
- } else {
64
- // 미리보기가 지원되지 않는 파일 형식 안내
65
- const message = document.createElement('p')
66
- message.innerText = '미리보기가 지원되지 않는 파일 형식입니다.'
67
- this.previewContent.appendChild(message)
68
- }
69
- }
70
- }
@@ -1,240 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '@operato/data-grist/ox-grist.js'
3
-
4
- import gql from 'graphql-tag'
5
- import { css, html, LitElement } from 'lit'
6
- import { customElement, property, query } from 'lit/decorators.js'
7
-
8
- import { DataGrist } from '@operato/data-grist/ox-grist.js'
9
- import { client } from '@operato/graphql'
10
- import { ButtonContainerStyles } from '@operato/styles'
11
- import { FetchOption } from '@operato/data-grist'
12
- import { notify } from '@operato/layout'
13
- import { CHECKLIST_MAIN_TYPE_LIST } from './checklist-type-management'
14
-
15
- @customElement('checklist-template-item')
16
- class ChecklistTemplateItem extends LitElement {
17
- static styles = [
18
- ButtonContainerStyles,
19
- css`
20
- :host {
21
- display: flex;
22
- flex-direction: column;
23
-
24
- background-color: var(--md-sys-color-surface);
25
- }
26
-
27
- ox-grist {
28
- flex: 1;
29
- }
30
- `
31
- ]
32
-
33
- @property({ type: Object }) checklistDetailTypes: any
34
- @property({ type: Object }) checklistTemplate: any
35
- @property({ type: Object }) gristConfig: any
36
-
37
- @query('ox-grist') grist!: DataGrist
38
-
39
- render() {
40
- return html`
41
- <ox-grist .mode=${'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}></ox-grist>
42
- <div class="button-container">
43
- <button danger @click=${this._deleteChecklistTemplateItems.bind(this)}><md-icon>delete</md-icon>삭제</button>
44
- <button @click=${this._updateChecklistTemplateItems.bind(this)}><md-icon>save</md-icon>저장</button>
45
- </div>
46
- `
47
- }
48
-
49
- async firstUpdated() {
50
- this.gristConfig = {
51
- columns: [
52
- { type: 'gutter', gutterName: 'row-selector', multiple: true },
53
- {
54
- type: 'gutter',
55
- gutterName: 'button',
56
- fixed: true,
57
- icon: 'add',
58
- handlers: {
59
- click: 'record-copy'
60
- }
61
- },
62
- { type: 'gutter', gutterName: 'sequence' },
63
- {
64
- type: 'gutter',
65
- gutterName: 'button',
66
- icon: 'arrow_upward',
67
- handlers: {
68
- click: 'move-up'
69
- }
70
- },
71
- {
72
- type: 'gutter',
73
- gutterName: 'button',
74
- icon: 'arrow_downward',
75
- handlers: {
76
- click: 'move-down'
77
- }
78
- },
79
- {
80
- type: 'number',
81
- name: 'sequence',
82
- hidden: true
83
- },
84
- {
85
- type: 'string',
86
- name: 'id',
87
- hidden: true
88
- },
89
- {
90
- type: 'select',
91
- name: 'mainType',
92
- header: '구분',
93
- record: {
94
- editable: true,
95
- options: [{ display: '', value: '' }].concat(
96
- Object.keys(CHECKLIST_MAIN_TYPE_LIST).map(key => ({ display: CHECKLIST_MAIN_TYPE_LIST[key], value: key }))
97
- )
98
- },
99
- width: 150
100
- },
101
- {
102
- type: 'select',
103
- name: 'detailType',
104
- header: '상세 구분',
105
- record: {
106
- editable: true,
107
- options: (columns, data, column) => [
108
- { display: '', value: '' },
109
- ...this.checklistDetailTypes.filter(v => v.mainType == column.mainType)
110
- ]
111
- },
112
- width: 250
113
- },
114
- {
115
- type: 'string',
116
- name: 'name',
117
- header: '검사 항목',
118
- record: {
119
- editable: true
120
- },
121
- width: 200
122
- },
123
- {
124
- type: 'string',
125
- name: 'inspctionCriteria',
126
- header: '검사 기준',
127
- record: {
128
- editable: true
129
- },
130
- width: 200
131
- }
132
- ],
133
- rows: {
134
- selectable: {
135
- multiple: true
136
- }
137
- },
138
- pagination: {
139
- infinite: true
140
- },
141
- sorters: [{ name: 'mainType' }, { name: 'sequence' }]
142
- }
143
- }
144
-
145
- async fetchHandler({ page, limit, sorters = [] }: FetchOption) {
146
- const response = await client.query({
147
- query: gql`
148
- query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
149
- checklistTemplateItems(filters: $filters, pagination: $pagination, sortings: $sortings) {
150
- items {
151
- id
152
- sequence
153
- name
154
- inspctionCriteria
155
- mainType
156
- detailType
157
- }
158
- }
159
- }
160
- `,
161
- variables: {
162
- filters: {
163
- name: 'checklistTemplateId',
164
- value: this.checklistTemplate.id,
165
- operator: 'eq'
166
- },
167
- sortings: [{ name: 'mainType' }, { name: 'sequence' }]
168
- }
169
- })
170
-
171
- return {
172
- total: response.data.checklistTemplateItems.total || 0,
173
- records: response.data.checklistTemplateItems.items || []
174
- }
175
- }
176
-
177
- private async _deleteChecklistTemplateItems() {
178
- if (confirm('삭제하시겠습니까?')) {
179
- const ids = this.grist.selected.map(record => record.id)
180
- if (ids && ids.length > 0) {
181
- const response = await client.mutate({
182
- mutation: gql`
183
- mutation ($ids: [String!]!) {
184
- deleteChecklistTemplateItems(ids: $ids)
185
- }
186
- `,
187
- variables: {
188
- ids
189
- }
190
- })
191
-
192
- if (!response.errors) {
193
- this.grist.fetch()
194
- notify({ message: '삭제되었습니다.' })
195
- }
196
- }
197
- }
198
- }
199
-
200
- async _updateChecklistTemplateItems() {
201
- let patches = this.grist.dirtyData.records
202
- if (patches) {
203
- patches = patches.map(patch => {
204
- const { __origin__: { __typename, ...patchField } = {}, __dirtyfields__ } = patch
205
-
206
- for (let key in __dirtyfields__) {
207
- patchField[key] = __dirtyfields__[key].after
208
- }
209
-
210
- return patchField
211
- })
212
-
213
- const response = await client.mutate({
214
- mutation: gql`
215
- mutation UpdateMultipleChecklistTemplateItems($checklistTemplateId: String!, $patches: [ChecklistTemplateItemPatch!]!) {
216
- updateMultipleChecklistTemplateItems(checklistTemplateId: $checklistTemplateId, patches: $patches) {
217
- id
218
- }
219
- }
220
- `,
221
- variables: {
222
- checklistTemplateId: this.checklistTemplate.id,
223
- patches
224
- }
225
- })
226
-
227
- if (!response.errors) {
228
- this.grist.fetch()
229
- notify({ message: '저장되었습니다.' })
230
- this.requestRefresh()
231
- } else {
232
- notify({ message: '저장에 실패하였습니다.', level: 'error' })
233
- }
234
- }
235
- }
236
-
237
- requestRefresh() {
238
- this.dispatchEvent(new CustomEvent('requestRefresh'))
239
- }
240
- }