@spokane-folio/security-incident 1.0.28

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 (188) hide show
  1. package/.eslintrc +32 -0
  2. package/.github/workflows/CODEOWNERS +8 -0
  3. package/.github/workflows/pr-validation.yml +44 -0
  4. package/.github/workflows/release.yml +64 -0
  5. package/.prettierrc +6 -0
  6. package/.stripesclirc +4 -0
  7. package/CHANGELOG.md +8 -0
  8. package/CONTRIBUTING.md +4 -0
  9. package/LICENSE +201 -0
  10. package/README.md +16 -0
  11. package/administrator-documentation/roles-and-permissions.md +65 -0
  12. package/administrator-documentation/track-settings-admin-guide-sketch.md +192 -0
  13. package/administrator-documentation/using-the-application.md +192 -0
  14. package/icons/app.png +0 -0
  15. package/icons/app.svg +1 -0
  16. package/icons/playButton.png +0 -0
  17. package/icons/profilePicThumbnail.png +0 -0
  18. package/jest.config.js +10 -0
  19. package/module-descriptor.json +75 -0
  20. package/output/service-worker.js +0 -0
  21. package/package.json +146 -0
  22. package/src/components/incidents/ColumnChooser.js +37 -0
  23. package/src/components/incidents/CreateMedia.js +132 -0
  24. package/src/components/incidents/CreatePane.js +1215 -0
  25. package/src/components/incidents/CreatePane.test.js +138 -0
  26. package/src/components/incidents/CreateReport.js +102 -0
  27. package/src/components/incidents/DetailsPane.js +1267 -0
  28. package/src/components/incidents/DetailsPane.test.js +150 -0
  29. package/src/components/incidents/EditPane.js +2334 -0
  30. package/src/components/incidents/EditPane.test.js +187 -0
  31. package/src/components/incidents/GetDetails.js +55 -0
  32. package/src/components/incidents/GetListDQLinkIncident.js +81 -0
  33. package/src/components/incidents/GetListDynamicQuery.js +66 -0
  34. package/src/components/incidents/GetLocations.js +57 -0
  35. package/src/components/incidents/GetMedia.js +98 -0
  36. package/src/components/incidents/GetName.js +111 -0
  37. package/src/components/incidents/GetNameCreatedBy.js +94 -0
  38. package/src/components/incidents/GetOrgLocaleSettings.js +61 -0
  39. package/src/components/incidents/GetPatronGroups.js +52 -0
  40. package/src/components/incidents/GetSelf.js +65 -0
  41. package/src/components/incidents/GetSummary.js +110 -0
  42. package/src/components/incidents/IncidentTypeCard.js +53 -0
  43. package/src/components/incidents/IncidentTypeCard.test.js +133 -0
  44. package/src/components/incidents/IncidentsPaneset.js +810 -0
  45. package/src/components/incidents/IncidentsPaneset.test.js +128 -0
  46. package/src/components/incidents/LinkedIncident.js +86 -0
  47. package/src/components/incidents/ModalAddMedia.js +262 -0
  48. package/src/components/incidents/ModalAddMedia.test.js +97 -0
  49. package/src/components/incidents/ModalAttentionDecOfService.js +111 -0
  50. package/src/components/incidents/ModalCustomWitness.js +469 -0
  51. package/src/components/incidents/ModalCustomWitness.test.js +147 -0
  52. package/src/components/incidents/ModalCustomerDetails.js +480 -0
  53. package/src/components/incidents/ModalCustomerDetails.test.js +116 -0
  54. package/src/components/incidents/ModalDescribeCustomer.js +361 -0
  55. package/src/components/incidents/ModalDescribeCustomer.test.js +156 -0
  56. package/src/components/incidents/ModalDirtyFormWarn.js +62 -0
  57. package/src/components/incidents/ModalLinkIncident.js +1213 -0
  58. package/src/components/incidents/ModalLinkIncidentStyle.css +32 -0
  59. package/src/components/incidents/ModalSelectIncidentTypes.js +178 -0
  60. package/src/components/incidents/ModalSelectIncidentTypes.test.js +273 -0
  61. package/src/components/incidents/ModalSelectKnownCustomer.js +395 -0
  62. package/src/components/incidents/ModalSelectWitness.js +406 -0
  63. package/src/components/incidents/ModalSelectWitness.test.js +308 -0
  64. package/src/components/incidents/ModalStyle.css +44 -0
  65. package/src/components/incidents/ModalTrespass.js +741 -0
  66. package/src/components/incidents/ModalViewCustomerDetails.js +241 -0
  67. package/src/components/incidents/ModalViewMedia.js +86 -0
  68. package/src/components/incidents/ModalViewTrespass.js +210 -0
  69. package/src/components/incidents/ResultsPane.js +437 -0
  70. package/src/components/incidents/ResultsPane.test.js +120 -0
  71. package/src/components/incidents/SearchCustomerOrWitness.js +108 -0
  72. package/src/components/incidents/Thumbnail.js +72 -0
  73. package/src/components/incidents/ThumbnailMarkRemoval.js +38 -0
  74. package/src/components/incidents/ThumbnailSkeleton.js +30 -0
  75. package/src/components/incidents/ThumbnailStyles.js +49 -0
  76. package/src/components/incidents/ThumbnailTempPreSave.js +71 -0
  77. package/src/components/incidents/UpdateReport.js +84 -0
  78. package/src/components/incidents/__snapshots__/CreatePane.test.js.snap +3 -0
  79. package/src/components/incidents/__snapshots__/DetailsPane.test.js.snap +3 -0
  80. package/src/components/incidents/__snapshots__/EditPane.test.js.snap +3 -0
  81. package/src/components/incidents/__snapshots__/IncidentTypeCard.test.js.snap +3 -0
  82. package/src/components/incidents/__snapshots__/IncidentsPaneset.test.js.snap +3 -0
  83. package/src/components/incidents/__snapshots__/ModalAddMedia.test.js.snap +3 -0
  84. package/src/components/incidents/__snapshots__/ModalCustomerDetails.test.js.snap +3 -0
  85. package/src/components/incidents/__snapshots__/ModalSelectWitness.test.js.snap +3 -0
  86. package/src/components/incidents/__snapshots__/ResultsPane.test.js.snap +3 -0
  87. package/src/components/incidents/helpers/ProfilePicture/ProfilePicture.css +5 -0
  88. package/src/components/incidents/helpers/ProfilePicture/ProfilePicture.js +51 -0
  89. package/src/components/incidents/helpers/ProfilePicture/isAValidURL.js +3 -0
  90. package/src/components/incidents/helpers/ProfilePicture/useProfilePicture.js +127 -0
  91. package/src/components/incidents/helpers/buildQueryString.js +28 -0
  92. package/src/components/incidents/helpers/cleanFormValues.js +53 -0
  93. package/src/components/incidents/helpers/computeEditedCustomers.js +124 -0
  94. package/src/components/incidents/helpers/convertDateIgnoringTZ.js +8 -0
  95. package/src/components/incidents/helpers/convertUTCISOToLocalePrettyTime.js +15 -0
  96. package/src/components/incidents/helpers/convertUTCISOToPrettyDate.js +19 -0
  97. package/src/components/incidents/helpers/decodeParamsToForm.js +20 -0
  98. package/src/components/incidents/helpers/deepNormalizeForComparison.js +39 -0
  99. package/src/components/incidents/helpers/extractFilterString.js +12 -0
  100. package/src/components/incidents/helpers/formatDateAndTimeToUTCISO.js +14 -0
  101. package/src/components/incidents/helpers/formatDateToUTCISO.js +14 -0
  102. package/src/components/incidents/helpers/formatTimeToUTCISO.js +28 -0
  103. package/src/components/incidents/helpers/getCurrentTime.js +20 -0
  104. package/src/components/incidents/helpers/getTodayDate.js +12 -0
  105. package/src/components/incidents/helpers/handlebarsHelpers.js +148 -0
  106. package/src/components/incidents/helpers/hasFormChangedAtCreate.js +50 -0
  107. package/src/components/incidents/helpers/hasTopLevelChangeAffectedDeclaration.js +90 -0
  108. package/src/components/incidents/helpers/hasTopLevelFormChanged.js +111 -0
  109. package/src/components/incidents/helpers/identifyCurrentTrespassDocs.js +109 -0
  110. package/src/components/incidents/helpers/isSameHtml.js +13 -0
  111. package/src/components/incidents/helpers/isValidDateFormat.js +14 -0
  112. package/src/components/incidents/helpers/isValidTimeInput.js +11 -0
  113. package/src/components/incidents/helpers/isValidUTCTimeFormat.js +14 -0
  114. package/src/components/incidents/helpers/parseMMDDYYYY.js +7 -0
  115. package/src/components/incidents/helpers/parseQueryString.js +16 -0
  116. package/src/components/incidents/helpers/sortTrespassDocuments.js +44 -0
  117. package/src/components/incidents/helpers/stripHTML.js +11 -0
  118. package/src/components/incidents/helpers/trespassDocUtils.js +197 -0
  119. package/src/components/incidents/helpers/validateTrespassDetails.js +37 -0
  120. package/src/components/incidents/usePersistedColModalLink.js +70 -0
  121. package/src/components/incidents/usePersistedColumns.js +70 -0
  122. package/src/components/incidents/usePersistedSort.js +23 -0
  123. package/src/components/incidents/usePersistedSortModalLink.js +23 -0
  124. package/src/contexts/IncidentContext.js +433 -0
  125. package/src/index.js +61 -0
  126. package/src/routes/Application.js +13 -0
  127. package/src/settings/GetIncidentCategories.js +56 -0
  128. package/src/settings/GetIncidentTypesDetails.js +88 -0
  129. package/src/settings/GetIncidentTypesIds.js +74 -0
  130. package/src/settings/GetLocationsInService.js +54 -0
  131. package/src/settings/GetSingleCustomLocationDetails.js +60 -0
  132. package/src/settings/GetSingleIncidentTypeDetails.js +60 -0
  133. package/src/settings/GetTrespassReasons.js +67 -0
  134. package/src/settings/GetTrespassTemplates.js +51 -0
  135. package/src/settings/IncidentCategoriesPane.js +285 -0
  136. package/src/settings/IncidentCategoriesPane.test.js +229 -0
  137. package/src/settings/IncidentTypeDetailsPane.js +215 -0
  138. package/src/settings/IncidentTypeDetailsPane.test.js +220 -0
  139. package/src/settings/IncidentTypeEditPane.js +211 -0
  140. package/src/settings/IncidentTypeEditPane.test.js +170 -0
  141. package/src/settings/IncidentTypesPaneset.js +167 -0
  142. package/src/settings/IncidentTypesPaneset.test.js +124 -0
  143. package/src/settings/LocationInServiceEditPane.js +320 -0
  144. package/src/settings/LocationsPaneset.js +415 -0
  145. package/src/settings/LocationsPaneset.test.js +106 -0
  146. package/src/settings/ModalDeleteCategory.js +47 -0
  147. package/src/settings/ModalDeleteIncidentType.js +49 -0
  148. package/src/settings/ModalDeleteLocationInService.js +49 -0
  149. package/src/settings/ModalDeleteTrespassReason.js +49 -0
  150. package/src/settings/ModalPreviewTrespassDoc.js +65 -0
  151. package/src/settings/ModalTrespassDocTokens.js +83 -0
  152. package/src/settings/NewIncidentTypePane.js +182 -0
  153. package/src/settings/PutIncidentType.js +60 -0
  154. package/src/settings/PutLocationsInService.js +52 -0
  155. package/src/settings/PutTrespassReasons.js +61 -0
  156. package/src/settings/PutTrespassTemplate.js +50 -0
  157. package/src/settings/TrespassDoc.css +17 -0
  158. package/src/settings/TrespassDocDetailsPane.js +215 -0
  159. package/src/settings/TrespassDocEditPane.js +538 -0
  160. package/src/settings/TrespassDocPaneset.js +581 -0
  161. package/src/settings/TrespassReasonDetailsPane.js +171 -0
  162. package/src/settings/TrespassReasonEditPane.js +221 -0
  163. package/src/settings/TrespassReasonsPaneset.js +282 -0
  164. package/src/settings/__snapshots__/IncidentCategoriesPane.test.js.snap +3 -0
  165. package/src/settings/__snapshots__/IncidentTypeDetailsPane.test.js.snap +3 -0
  166. package/src/settings/__snapshots__/IncidentTypeEditPane.test.js.snap +3 -0
  167. package/src/settings/__snapshots__/IncidentTypesPaneset.test.js.snap +3 -0
  168. package/src/settings/__snapshots__/LocationsPaneset.test.js.snap +3 -0
  169. package/src/settings/data/exampleJSON.json +92 -0
  170. package/src/settings/data/templateTokens.js +396 -0
  171. package/src/settings/helpers/alphabetize.js +18 -0
  172. package/src/settings/helpers/getCategoryTitleById.js +13 -0
  173. package/src/settings/helpers/makeId.js +15 -0
  174. package/src/settings/index.js +48 -0
  175. package/stripes.config.js +10 -0
  176. package/test/jest/__mock__/index.js +8 -0
  177. package/test/jest/__mock__/intl.mock.js +27 -0
  178. package/test/jest/__mock__/stripes.mock.js +26 -0
  179. package/test/jest/__mock__/stripesComponents.mock.js +151 -0
  180. package/test/jest/__mock__/stripesConfig.mock.js +1 -0
  181. package/test/jest/__mock__/stripesCore.mock.js +9 -0
  182. package/test/jest/__mock__/stripesIcon.mock.js +5 -0
  183. package/test/jest/__mock__/stripesSmartComponents.mock.js +7 -0
  184. package/test/jest/__mock__/stripesUtils.mock.js +3 -0
  185. package/test/jest/eslintrc.js +12 -0
  186. package/test/jest/setupFiles.js +5 -0
  187. package/translations/ui-security-incident/en_US.json +542 -0
  188. package/ui-module-acceptance-criteria.md +34 -0
package/.eslintrc ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "extends": [
3
+ "@folio/eslint-config-stripes",
4
+ "airbnb",
5
+ "plugin:import/recommended",
6
+ "plugin:jsx-a11y/recommended",
7
+ "plugin:prettier/recommended",
8
+ "prettier"
9
+ ],
10
+ "parser": "@babel/eslint-parser",
11
+ "plugins": [
12
+ "no-only-tests"
13
+ ],
14
+ "rules": {
15
+ "react/jsx-props-no-spreading": "off",
16
+ "no-only-tests/no-only-tests": "error",
17
+ "react/prop-types": "off",
18
+ "import/prefer-default-export": "off"
19
+ },
20
+ "overrides": [
21
+ {
22
+ "files": [ "src/**/tests/*", "**/*.test.js", "test/**/*" ],
23
+ "rules": {
24
+ "react/prop-types": "off",
25
+ "import/prefer-default-export": "off"
26
+ }
27
+ }
28
+ ],
29
+ "env": {
30
+ "jest": true
31
+ }
32
+ }
@@ -0,0 +1,8 @@
1
+
2
+ # default ownership for this repo
3
+ * @CB-SPL-Dev
4
+
5
+ # workflow and release sensitive paths
6
+ .github/workflows/** @CB-SPL-Dev
7
+ package.json @CB-SPL-Dev
8
+ yarn.lock @CB-SPL-Dev
@@ -0,0 +1,44 @@
1
+
2
+
3
+ name: PR Validation
4
+
5
+ on:
6
+ pull_request:
7
+ branches: [dev]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ validate:
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - name: Check out
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Set up Node
21
+ uses: actions/setup-node@v4
22
+ with:
23
+ node-version: 18
24
+ cache: yarn
25
+
26
+ - name: Install dependencies
27
+ run: yarn install --frozen-lockfile
28
+
29
+ - name: Lint
30
+ run: yarn lint
31
+
32
+ - name: Test
33
+ run: yarn test --ci
34
+ continue-on-error: false
35
+
36
+ - name: Build
37
+ run: yarn build
38
+
39
+ - name: Validate module descriptor generation
40
+ run: |
41
+ sudo apt-get update
42
+ sudo apt-get install -y jq
43
+ yarn run build-mod-descriptor
44
+ test -f module-descriptor.json
@@ -0,0 +1,64 @@
1
+
2
+
3
+ name: Release
4
+
5
+ on:
6
+ push:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: write
11
+
12
+ jobs:
13
+ release:
14
+ runs-on: ubuntu-latest
15
+ environment: production-release
16
+
17
+ steps:
18
+ - name: Check out
19
+ uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0
22
+
23
+ - name: Set up Node for npm
24
+ uses: actions/setup-node@v4
25
+ with:
26
+ node-version: 18
27
+ registry-url: 'https://registry.npmjs.org'
28
+ scope: '@spokane-folio'
29
+ cache: yarn
30
+
31
+ - name: Install dependencies
32
+ run: yarn install --frozen-lockfile
33
+
34
+ - name: Install jq
35
+ run: |
36
+ sudo apt-get update
37
+ sudo apt-get install -y jq
38
+
39
+ - name: Generate module descriptor
40
+ run: yarn run build-mod-descriptor
41
+
42
+ - name: Publish to npm
43
+ env:
44
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
45
+ run: npm publish --access public
46
+
47
+ - name: Pack tarball
48
+ run: yarn pack
49
+
50
+ - name: Read package version
51
+ id: pkg
52
+ run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
53
+
54
+ - name: Create GitHub release
55
+ uses: softprops/action-gh-release@v2
56
+ with:
57
+ tag_name: v${{ steps.pkg.outputs.version }}
58
+ name: security-incident v${{ steps.pkg.outputs.version }}
59
+ files: |
60
+ module-descriptor.json
61
+ *.tgz
62
+
63
+
64
+
package/.prettierrc ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "singleQuote": true,
3
+ "trailingComma": "es5",
4
+ "tabWidth": 2,
5
+ "printWidth": 80
6
+ }
package/.stripesclirc ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "configFile": "stripes.config.js",
3
+ "port": 3000
4
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # Change history for ui-security-incident
2
+
3
+ ## 1.1.0 (IN PROGRESS)
4
+
5
+
6
+ ## 1.0.0
7
+
8
+ * New app created with stripes-cli
@@ -0,0 +1,4 @@
1
+ # Contribution guidelines
2
+
3
+ Guidelines for Contributing Code:
4
+ [dev.folio.org/guidelines/contributing](https://dev.folio.org/guidelines/contributing)
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # ui-security-incident
2
+
3
+ This software is distributed under the terms of the Apache License, Version 2.0. See the source [LICENSE](https://www.apache.org/licenses/LICENSE-2.0.txt) for more information.
4
+
5
+ ## Introduction
6
+ The Security Incident UI Module, or `ui-security-incident`, is a Stripes UI Module designed to help libraries manage and track security incidents efficiently. It provides functionality for creating, editing, viewing, searching, sorting, and filtering incident reports.
7
+
8
+ ## Installation
9
+
10
+ ## Build and serve
11
+
12
+ ## Tests
13
+
14
+ ## Additional information
15
+
16
+ Other [modules](https://dev.folio.org/source-code/#client-side).
@@ -0,0 +1,65 @@
1
+ # Track Roles and Permissions Guide
2
+
3
+ ## Overview
4
+ Track uses **roles and permissions** to control what each staff member can do in the application.
5
+ This system is called **RBAC (Role-Based Access Control)**.
6
+
7
+ ---
8
+
9
+ ## What Are Roles and Permissions?
10
+
11
+ - **Roles** are assigned to staff (for example: *Front-line Staff*, *Supervisor*, or *Admin*).
12
+ - **Permissions** decide what each role can see and do in Track.
13
+
14
+ Together, roles and permissions ensure that each user only has access to the actions and information appropriate to their job responsibilities.
15
+
16
+ ---
17
+
18
+ ## What You Experience in the UI
19
+
20
+ Depending on your assigned role, the interface and available features in Track will change.
21
+
22
+ ### View Incidents
23
+ Most staff can see the list of incidents and view their details.
24
+
25
+ ### Create or Edit Incidents
26
+ Only staff with the proper permissions can create new reports or edit existing ones.
27
+
28
+ ### Access Settings
29
+ Supervisors and admins can see the **Settings** section to manage:
30
+ - Categories
31
+ - Types
32
+ - Locations
33
+ - Trespass templates
34
+ - Trespass reasons
35
+
36
+ ### Edit Settings
37
+ Only admins (or staff with special permissions) can **add, change, or delete** items in Settings.
38
+
39
+ If you don’t have permission for a feature, you simply won’t see its button or page — the option will be hidden automatically.
40
+
41
+ ---
42
+
43
+ ## Typical Roles Example
44
+
45
+ | **Role** | **View Incidents** | **Create/Edit Incidents** | **View Settings** | **Edit Settings** |
46
+ |--------------------|--------------------|----------------------------|-------------------|-------------------|
47
+ | Front-line Staff | ✓ | ✓ | | |
48
+ | Supervisor | ✓ | ✓ | ✓ | |
49
+ | Admin | ✓ | ✓ | ✓ | ✓ |
50
+
51
+ ---
52
+
53
+ ## How Roles Are Set
54
+
55
+ - Roles are assigned by your library’s **system administrator** (outside of Track).
56
+ - Track automatically shows or hides features based on your assigned role.
57
+ - Permissions are managed centrally to maintain consistency across your organization.
58
+
59
+ ---
60
+
61
+ ## Summary
62
+
63
+ - **Admins** can do everything, including changing settings.
64
+ - **Supervisors** can view and manage incidents, and view settings.
65
+ - **Front-line staff** can create and view incidents.
@@ -0,0 +1,192 @@
1
+ # Track Settings: Admin Guide
2
+
3
+ ## What is Track Settings?
4
+
5
+ **Track Settings** is the control center for managing how security incidents are tracked and documented in your library.
6
+ It lets you customize categories, types, locations, trespass templates, and reasons—so **Track** fits your organization’s needs.
7
+
8
+ ---
9
+
10
+ ## What Can You Do in Track Settings?
11
+
12
+ ### Incident Categories and Incident Types
13
+ In Track Settings, Incident Categories and Incident Types work together to help you organize and report security incidents in your library.
14
+
15
+ ### Incident Categories
16
+ Incident Categories are broad groups, like “Theft” or “Disturbance.” They help you sort incidents into meaningful sections for easier tracking and analysis.
17
+
18
+ ### Incident Types
19
+ Incident Types are the specific kinds of incidents that happen, such as “Verbal Abuse” or “Property Damage.” Every Incident Type belongs to one Incident Category. For example, “Verbal Abuse” might be part of the “Disturbance” category.
20
+
21
+ ### How This Works in the UI
22
+ When you **add or edit an Incident Type**, you’ll be asked to choose which **Category** it belongs to.
23
+ Categories help you keep your Incident Types organized, so reports and searches are clearer. The 'description' field is required. The information for the description will help admin and staff users to have more specificity for reference when choosing an incident type when creating or editing a report.
24
+ You can **filter Incident Types by Category** when viewing or selecting them, making it easier to find what you need. The description of the incident type is also rendered for better reference.
25
+
26
+ ### Summary
27
+ **Incident Categories** are the big groups; **Incident Types** are the specific incidents within those groups.
28
+ This setup makes it simple to organize, find, and report incidents in a way that fits your library’s needs.
29
+
30
+
31
+ ## Locations, Zones, and Custom Locations
32
+ Set up all library locations and sub-locations (like **“Main Branch”** or **“Children’s Area”**) to accurately record where incidents happen.
33
+
34
+ ### Service locations
35
+ Service locations for Track are derived from the official institutional level FOLIO locations, populating the 'select location' dropdown selector in Track Locations Settings. You can select a location and save it to Track locations. The 'location' value of a service location derived from the institution cannot be edited.
36
+
37
+ ### Custom locations
38
+ Custom locations are available for configuration in Track to allow libraries to record incidents in areas that aren't part of their official FOLIO location setup - such as outdoor spaces, shared facilities, or temporary event areas. This makes reporting and analysis more accurate for all parts of the library's environment.
39
+
40
+ Custom locations for Track are user inputted with the 'name' value as required. The name of a custom location cannot be the same as the name of an existing Track service location. The 'name' value of a custom location may be edited.
41
+
42
+ ### Zones
43
+ Zones are configurable for any Track service location, whether it was derived from institutional FOLIO locations or a custom location. Each location can have many zones, with the requirement that each zone has a 'name' field, 'description' is optional. Individual zones are not editable, although they can be removed for replacement.
44
+
45
+ ### How It Works in the UI - Managing Locations and Zones
46
+ - Go to **Settings** and choose **Locations**.
47
+ - You’ll see a list of your library’s official locations. You can add new locations (custom ones) if needed.
48
+ - For each location, you can add zones to break it down into smaller areas. For example, add "Reading Nook" as a zone under "Main Branch."
49
+ - Zones help you record exactly where something happened, making reports more detailed and useful.
50
+
51
+ ### Using Locations and Zones When Reporting Incidents
52
+ - When you create or edit an incident, you’ll select a location from a dropdown menu.
53
+ - If zones are set up for that location, you’ll also be able to pick the specific zone.
54
+ - Custom locations appear in the same list, so you can always record incidents in any area you need.
55
+
56
+ ### Editing and Removing
57
+ - You can edit the name of a custom location if needed, but official locations cannot be changed.
58
+ - Zones can be removed and replaced, but their names and descriptions cannot be edited once created.
59
+
60
+ ### Summary
61
+ - **Locations** help you track where incidents happen at a high level.
62
+ - **Zones** let you be more specific within each location.
63
+ - **Custom Locations** allow you to add new areas for tracking, so nothing is missed.
64
+ - The UI makes it easy to select, add, and organize these places, so your incident records are always clear and complete.
65
+
66
+
67
+ ## Trespass Document Templates
68
+ ### What Are Trespass Document Templates?
69
+ A **Trespass Document Template** is a pre-made notice that you can use when someone needs to be officially notified about a trespass.
70
+ Instead of writing a new notice every time, you set up templates in advance. These templates can include special placeholders (like a person’s name or the date) that get filled in automatically when you use them.
71
+
72
+ ### How Do You Manage Templates in Track?
73
+ ### Go to Settings
74
+ In the Track app, open the **Settings** section and choose **“Trespass Templates.”**
75
+
76
+ ### View Existing Templates
77
+ You’ll see a list of all your current trespass templates.
78
+ Each template shows its **name**, **description**, and whether it’s **active** or **set as the default**.
79
+
80
+ ### Add a New Template
81
+ Click the **“Add”** or **“New”** button.
82
+ Fill in the template’s name and description, and write the notice text.
83
+ You can insert placeholders for things like names or dates, so each notice is personalized.
84
+
85
+ ### Inserting tokens
86
+ Use the 'insert' button in the editor's menu to open the tokens modal. Choose the token(s) you want and click 'Insert selected tokens' button. This will write your selected tokens to the last place your cursor was in the editor's text area. It is not advised to copy and paste tokens from one space to another in the editor because if there is a typo (ex: missing bracket, nudged spacing inside the token text) that token will not be read by the program and data will not be dynamically written onto the final trespass document.
87
+
88
+ ### Edit a Template
89
+ Click on a template to view its details. Choose **“Edit”** to update the wording or change which placeholders are used.
90
+ You can also preview how the notice will look before saving.
91
+
92
+ ### Set a Default Template
93
+ You can mark one template as the **default**.
94
+ This means it will be used automatically when creating a new trespass notice, unless you choose a different one. If one template is already default and you update a different template to default, that most recently updated template will then override to become the new default. A template cannot be both 'default' and not active - if a template is saved as 'default' but not active, the update will revert to 'active'. If no template is chosen as the default the program will not automate trespass documents.
95
+
96
+ ### Delete a Template
97
+ If you no longer need a template, you can delete it.
98
+ You’ll be asked to confirm before it’s removed.
99
+
100
+ ### How Are Templates Used When Reporting Incidents?
101
+ - When you create or edit an incident that involves a trespass, **Track** will use your default template to generate the notice.
102
+ - The system fills in the placeholders with the correct information (like the person’s name and the date).
103
+ - You can preview the notice before saving or sending it.
104
+ - The final document is attached to the incident record for future reference.
105
+
106
+ ### Tips for Admins
107
+ - **Keep Templates Clear and Professional:** Use simple, direct language in your notices.
108
+ - **Use Placeholders Wisely:** They help personalize each notice without extra work.
109
+ - **Preview Before Saving:** Always check how the notice will look to make sure it’s correct.
110
+ - **Set a Default Template:** This ensures the programmatic trespass document generation is in effect.
111
+
112
+ Trespass Document Templates make it easy to create, manage, and send official notices.
113
+ With Track, you can be sure every trespass notice is **accurate**, **consistent**, and **ready when you need it**.
114
+
115
+
116
+ ## Trespass Reasons
117
+ Manage the list of reasons for issuing trespass notices, and choose which are active or default. Trespass Reasons are the explanations you give when someone is being issued a trespass notice at your library. They help you keep a clear record of **why** a person is being asked to leave or stay away.
118
+
119
+ ### How Do Trespass Reasons Work in the UI?
120
+ ### Where to Find Them
121
+ Go to the **Settings** section and select **Trespass Reasons**.
122
+
123
+ ### What You See
124
+ You’ll see a list of all the trespass reasons your library uses.
125
+ Each reason is a short description, such as:
126
+
127
+ - “Repeated disruptive behavior”
128
+ - “Violation of library policy”
129
+
130
+ These help staff choose consistent explanations for each trespass action.
131
+
132
+ ### Adding a New Reason
133
+ Click the **Add** button to create a new reason.
134
+ Type in your explanation and save it.
135
+ This new reason will now be available whenever staff need to issue a trespass notice.
136
+
137
+ ### Default Reason
138
+ You can mark one reason as the **default**.
139
+ This means it will be automatically selected when staff are filling out a trespass notice — but they can always choose a different reason if needed.
140
+
141
+ ### Suppressing a Reason
142
+ If you no longer want a reason to appear for staff to select, you can **suppress** it.
143
+ Suppressed reasons are hidden from the selection list but not deleted, so your historical records remain accurate.
144
+
145
+ ### Editing or Removing
146
+ You can edit the text of a reason if you need to update its wording.
147
+ If a reason is no longer needed, suppress it instead of deleting it to keep your data and reports consistent.
148
+
149
+ ### When Are Trespass Reasons Used?
150
+
151
+ Whenever staff issue a trespass notice to a customer (for example, during an **incident report**), they will select a reason from your list.
152
+ This reason is included in both the **official trespass notice** and your **incident records**, making it clear why the action was taken.
153
+
154
+ ### Summary
155
+ Trespass Reasons help your team stay **consistent**, **clear**, and **accurate** when documenting why someone is being trespassed.
156
+ You control the list in **Settings**, making it easy to update as your library’s needs change.
157
+
158
+ ---
159
+
160
+ ## Getting Started
161
+
162
+ ### 1. Open Track Settings
163
+ Go to the **Settings** section in Track.
164
+ You’ll see a menu with options for:
165
+ - Categories
166
+ - Types
167
+ - Locations
168
+ - Trespass Templates
169
+ - Trespass Reasons
170
+
171
+ ### 2. Choose What to Manage
172
+ Click on the area you want to update (for example, **“Incident Categories”**).
173
+
174
+ ### 3. View, Add, Edit, or Delete
175
+ - **View:** See the current list of items.
176
+ - **Add:** Click the **New** or **Add** button to create a new item. Fill in the details and save.
177
+ - **Edit:** Click on an item to view details, then choose **Edit** to make changes.
178
+ - **Delete:** Use the delete button to remove items you no longer need. You’ll be asked to confirm before anything is deleted.
179
+
180
+ ### 4. Save Your Changes
181
+ After adding or editing, always click **Save** or **Save and Close** to keep your updates.
182
+
183
+ ### 5. Use Modals and Previews
184
+ For trespass templates, you can preview documents before saving.
185
+ You can also insert tokens (like names or dates) to personalize notices.
186
+
187
+
188
+ ## Tips for Admins
189
+ - **Keep Categories and Types Organized:** Clear names make reporting easier.
190
+ - **Double-Check Before Deleting:** Deleted items can’t be recovered.
191
+ - **Use Templates for Consistency:** Trespass templates help ensure notices are professional and complete.
192
+ - **Set Defaults Carefully:** Default reasons and templates are used most often, so choose what fits your policies.