@konfuzio/document-validation-ui 0.1.1 → 0.1.2-pre-release-1

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 (36) hide show
  1. package/dist/css/app.6a102cfe.css +1 -0
  2. package/dist/index.html +1 -1
  3. package/dist/js/app.8be19e1c.js +2 -0
  4. package/dist/js/app.8be19e1c.js.map +1 -0
  5. package/package.json +1 -1
  6. package/src/assets/scss/annotation_details.scss +1 -1
  7. package/src/assets/scss/categorize_modal.scss +36 -33
  8. package/src/assets/scss/choose_label_set_modal.scss +60 -57
  9. package/src/assets/scss/document_page.scss +4 -0
  10. package/src/assets/scss/document_top_bar.scss +0 -7
  11. package/src/assets/scss/variables.scss +47 -29
  12. package/src/components/DocumentAnnotations/ActionButtons.vue +33 -21
  13. package/src/components/DocumentAnnotations/AnnotationDetails.vue +66 -109
  14. package/src/components/DocumentAnnotations/CategorizeModal.vue +91 -32
  15. package/src/components/DocumentAnnotations/ChooseLabelSetModal.vue +56 -27
  16. package/src/components/DocumentAnnotations/DocumentAnnotations.vue +0 -14
  17. package/src/components/DocumentEdit/DocumentEdit.vue +25 -36
  18. package/src/components/DocumentEdit/EditPages.vue +8 -17
  19. package/src/components/DocumentPage/DocumentPage.vue +17 -16
  20. package/src/components/DocumentPage/DocumentToolbar.vue +12 -24
  21. package/src/components/DocumentPage/NewAnnotation.vue +11 -2
  22. package/src/components/DocumentPage/ScrollingPage.vue +4 -17
  23. package/src/components/DocumentTopBar/DocumentTopBar.vue +0 -15
  24. package/src/components/DocumentTopBar/DocumentTopBarButtons.vue +7 -2
  25. package/src/components/DocumentTopBar/index.js +0 -2
  26. package/src/locales/de.json +8 -5
  27. package/src/locales/en.json +6 -3
  28. package/src/locales/es.json +6 -3
  29. package/src/store/document.js +88 -9
  30. package/dist/css/app.0c8973f8.css +0 -1
  31. package/dist/js/app.17fe48c4.js +0 -2
  32. package/dist/js/app.17fe48c4.js.map +0 -1
  33. package/src/assets/scss/document_dataset_status.scss +0 -46
  34. package/src/assets/scss/document_handover.scss +0 -200
  35. package/src/components/DocumentTopBar/DocumentDatasetStatus.vue +0 -103
  36. package/src/components/DocumentTopBar/DocumentHandover.vue +0 -202
@@ -1,46 +0,0 @@
1
- @import "./imports.scss";
2
-
3
- .dataset-status-chooser {
4
- margin-left: 0 !important;
5
- cursor: pointer;
6
-
7
- .dataset-status-drop-down {
8
- display: flex;
9
- height: 100%;
10
- align-items: center;
11
- padding: 0 8px 0 16px;
12
-
13
- .caret,
14
- .icon {
15
- text-align: center;
16
- margin-right: 8px;
17
- }
18
-
19
- .dataset-status-info {
20
- min-width: 100px;
21
- width: 100px;
22
-
23
- .dataset-status-title {
24
- font-size: 12px;
25
- color: $grey;
26
- }
27
-
28
- .dataset-status-name {
29
- white-space: nowrap;
30
- overflow: hidden;
31
- text-overflow: ellipsis;
32
- }
33
- }
34
- }
35
-
36
- .dropdown-menu-title {
37
- padding-left: 16px;
38
- font-weight: 400;
39
- font-size: 12px;
40
- }
41
-
42
- p {
43
- font-size: 12px;
44
- color: $grey;
45
- }
46
- }
@@ -1,200 +0,0 @@
1
- @import "./imports.scss";
2
-
3
- .handover-container {
4
- .handover-btn {
5
- font-size: 14px;
6
- font-weight: 500;
7
-
8
- &:hover {
9
- background-color: $darker-green;
10
- }
11
-
12
- &:focus {
13
- box-shadow: none;
14
- }
15
- }
16
-
17
- .handover-collapse {
18
- position: absolute !important;
19
- right: 20px;
20
- top: 52px;
21
- max-width: 435px;
22
- max-height: 264px;
23
- margin: 0;
24
-
25
- .collapse-content {
26
- .notification {
27
- background-color: $white;
28
- border: 1px solid $subtle-grey;
29
- box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.08),
30
- 0px 4px 6px -2px rgba(16, 24, 40, 0.03);
31
- padding: 0;
32
-
33
- .content {
34
- .container {
35
- display: flex;
36
- align-items: center;
37
- justify-content: space-between;
38
- }
39
-
40
- .header {
41
- display: flex;
42
- align-items: center;
43
- justify-content: space-between;
44
- border-bottom: 1px solid $subtle-grey;
45
- padding: 15px;
46
-
47
- .title {
48
- margin: 0 !important;
49
- color: $dark-blue;
50
- font-size: 14px;
51
- }
52
- }
53
-
54
- .input-container {
55
- .input-section {
56
- margin-top: 7px;
57
- padding-left: 15px;
58
- padding-right: 15px;
59
- font-size: 14px;
60
-
61
- ::placeholder {
62
- font-size: 14px;
63
- font-weight: 400;
64
- color: $grey;
65
- }
66
-
67
- .handover-btn-menu {
68
- height: 40px;
69
- width: 97px;
70
- background-color: $dark-blue;
71
- color: $white;
72
- font-size: 14px;
73
- border: 0;
74
-
75
- &:focus {
76
- box-shadow: none;
77
- border: 0;
78
- }
79
- }
80
-
81
- .field {
82
- margin: 0 !important;
83
- padding-right: 8px;
84
-
85
- .validation-message {
86
- display: none;
87
- }
88
-
89
- .control {
90
- width: 298px;
91
- height: 40px;
92
-
93
- .input {
94
- border-color: $subtlest-grey;
95
- font-size: 14px;
96
- height: 40px;
97
-
98
- &:focus {
99
- box-shadow: none !important;
100
- }
101
- }
102
- }
103
- }
104
-
105
- .loading-overlay.is-active {
106
- position: relative;
107
- height: 40px;
108
- width: 97px;
109
- border-radius: 4px;
110
- background-color: $dark-blue;
111
-
112
- .spinner {
113
- color: $white;
114
- }
115
- }
116
- }
117
-
118
- &.invalid {
119
- .input {
120
- border-color: $red !important;
121
- }
122
- }
123
-
124
- .invalid-email-msg {
125
- color: $red;
126
- margin: 8px 15px 20px 15px;
127
- }
128
- }
129
-
130
- .members-section {
131
- margin: 15px;
132
- margin-right: 0;
133
-
134
- .members-title {
135
- display: flex !important;
136
- margin-bottom: 10px;
137
-
138
- .title {
139
- color: $grey !important;
140
- font-size: 12px !important;
141
- font-weight: 400 !important;
142
- margin-bottom: 0 !important;
143
- }
144
- }
145
-
146
- .member-list {
147
- max-height: 110px;
148
- padding-right: 15px;
149
-
150
- &.scroll {
151
- overflow: auto;
152
- }
153
-
154
- .member {
155
- padding-bottom: 7px;
156
-
157
- .email {
158
- margin-bottom: 0 !important;
159
- color: $grey-darker;
160
- }
161
-
162
- .select-btn {
163
- height: 32px;
164
- color: $dark-blue;
165
- font-weight: 500;
166
- font-size: 14px;
167
-
168
- &:hover {
169
- background-color: $grey-hover;
170
- }
171
-
172
- &:focus {
173
- box-shadow: none;
174
- border-color: $grey-outline;
175
- }
176
- }
177
- }
178
- }
179
- }
180
- }
181
- }
182
- }
183
-
184
- .close-icon-container {
185
- cursor: pointer;
186
- display: flex;
187
- align-items: center;
188
-
189
- .close-btn {
190
- &.error-icon {
191
- color: $grey;
192
- }
193
-
194
- &.snackbar-icon {
195
- color: $white;
196
- }
197
- }
198
- }
199
- }
200
- }
@@ -1,103 +0,0 @@
1
- <template>
2
- <b-dropdown class="dataset-status-chooser">
3
- <template #trigger>
4
- <div class="dataset-status-drop-down">
5
- <div class="icon">
6
- <StatusIcon />
7
- </div>
8
- <div class="dataset-status-info">
9
- <p class="dataset-status-title">
10
- {{ $t("status") }}
11
- </p>
12
- <div class="dataset-status-name">
13
- {{ datasetStatus === 0 ? $t("set_status") : handleStatus() }}
14
- </div>
15
- </div>
16
- <div class="caret">
17
- <b-icon icon="angle-down" size="is-small" class="caret" />
18
- </div>
19
- </div>
20
- </template>
21
-
22
- <p class="dropdown-menu-title">
23
- {{ $t("status") }}
24
- </p>
25
-
26
- <b-dropdown-item
27
- v-for="(status, index) in statusList"
28
- :key="index"
29
- class="dropdown-item"
30
- aria-role="listitem"
31
- :disabled="disable(status)"
32
- @click="handleChangeStatus(index)"
33
- >
34
- {{ status }}
35
- </b-dropdown-item>
36
- </b-dropdown>
37
- </template>
38
-
39
- <script>
40
- import StatusIcon from "../../assets/images/StatusImg";
41
-
42
- export default {
43
- name: "DatasetStatus",
44
- components: {
45
- StatusIcon,
46
- },
47
- props: {
48
- datasetStatus: {
49
- type: Number,
50
- },
51
- },
52
- data() {
53
- return {
54
- statusList: [
55
- this.$t("preparation"),
56
- this.$t("training"),
57
- this.$t("test"),
58
- this.$t("excluded"),
59
- ],
60
- currentStatus: null,
61
- };
62
- },
63
- methods: {
64
- handleChangeStatus(index) {
65
- const updatedDatasetStatus = {
66
- dataset_status: index + 1,
67
- };
68
-
69
- this.$store
70
- .dispatch("document/updateDocument", updatedDatasetStatus)
71
- .then((response) => {
72
- if (response) {
73
- this.currentStatus = this.statusList[index];
74
- }
75
- })
76
- .catch((error) => {
77
- this.$store.dispatch("document/createErrorMessage", {
78
- error,
79
- serverErrorMessage: this.$t("server_error"),
80
- defaultErrorMessage: this.$t("edit_error"),
81
- });
82
- });
83
- },
84
- handleStatus() {
85
- if (!this.currentStatus) {
86
- return this.statusList[this.datasetStatus - 1];
87
- }
88
- return this.currentStatus;
89
- },
90
- disable(status) {
91
- if (this.datasetStatus === this.statusList.indexOf(status) + 1) {
92
- return true;
93
- }
94
- },
95
- },
96
- };
97
- </script>
98
-
99
- <style
100
- scoped
101
- lang="scss"
102
- src="../../assets/scss/document_dataset_status.scss"
103
- ></style>
@@ -1,202 +0,0 @@
1
- <template>
2
- <div class="handover-container">
3
- <b-button
4
- :label="$t('handover')"
5
- type="is-primary"
6
- aria-controls="handover"
7
- class="handover-btn"
8
- @click="open = true"
9
- />
10
-
11
- <div class="handover-collapse">
12
- <b-collapse
13
- :open="open"
14
- aria-id="handover"
15
- class="is-bottom"
16
- >
17
- <div class="notification">
18
- <div class="content">
19
- <div class="header container">
20
- <p class="title">
21
- {{ $t("handover_document") }}
22
- </p>
23
- <div
24
- type="button"
25
- class="close-icon-container modal-btn"
26
- @click="open = false"
27
- >
28
- <b-icon
29
- icon="xmark"
30
- class="close-btn"
31
- size="is-small"
32
- />
33
- </div>
34
- </div>
35
- <div class="input-container">
36
- <section
37
- :class="['input-section container', invalidEmail && 'invalid']"
38
- >
39
- <b-field type="input">
40
- <b-input
41
- id="input"
42
- v-model="selected"
43
- :placeholder="$t('type_email')"
44
- autocomplete="off"
45
- @input="invalidEmail = false"
46
- />
47
- </b-field>
48
- <b-loading
49
- v-if="isLoading"
50
- v-model="isLoading"
51
- :is-full-page="isFullPage"
52
- >
53
- <b-icon
54
- icon="spinner"
55
- class="fa-spin loading-icon-size spinner"
56
- />
57
- </b-loading>
58
- <b-button
59
- v-else
60
- :label="$t('handover')"
61
- class="handover-btn-menu"
62
- @click.prevent="handleHandover"
63
- />
64
- </section>
65
- <div
66
- v-if="invalidEmail"
67
- class="invalid-email-msg"
68
- >
69
- <p>{{ $t("invalid_email") }}</p>
70
- </div>
71
- </div>
72
- <div class="members-section">
73
- <div class="members-title">
74
- <h3 class="title">
75
- {{ $t("members") }}
76
- </h3>
77
- </div>
78
- <div :class="['member-list', scroll && 'scroll']">
79
- <div
80
- v-for="member in members"
81
- :key="member.id"
82
- >
83
- <div class="member container">
84
- <p class="email">
85
- {{ member.email }}
86
- </p>
87
- <b-button
88
- :label="$t('select')"
89
- class="select-btn"
90
- @click="handleSelect(member.id, member.email)"
91
- />
92
- </div>
93
- </div>
94
- </div>
95
- </div>
96
- </div>
97
- </div>
98
- </b-collapse>
99
- </div>
100
- </div>
101
- </template>
102
-
103
- <script>
104
- export default {
105
- name: "DocumentHandover",
106
- data() {
107
- return {
108
- isComponentModalActive: false,
109
- open: false,
110
- // TODO: bring list of members from the backend when endpoint is ready
111
- members: [
112
- { id: 1, email: "ch@konfuzio.com" },
113
- { id: 2, email: "fz@helm-nagel.com" },
114
- { id: 3, email: "ana@helm-nagel.com" },
115
- { id: 4, email: "ch@konfuzio.com" },
116
- { id: 5, email: "fz@helm-nagel.com" },
117
- { id: 6, email: "ana@helm-nagel.com" }
118
- ],
119
- isFullPage: false,
120
- isLoading: false,
121
- selected: null,
122
- scroll: false,
123
- invalidEmail: false,
124
- regex:
125
- /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i
126
- };
127
- },
128
- computed: {
129
- // TODO: map members from store
130
- },
131
-
132
- updated() {
133
- if (this.members.length > 3) {
134
- this.scroll = true;
135
- }
136
- },
137
- methods: {
138
- emailValidation(email) {
139
- return email.toLowerCase().match(this.regex);
140
- },
141
- isMember() {
142
- const found = this.members.find(member => member.email === this.selected);
143
-
144
- if (found) {
145
- return true;
146
- }
147
-
148
- return false;
149
- },
150
- handleSelect(id, email) {
151
- const inputField = document.getElementById("input");
152
-
153
- if (id) {
154
- inputField.value = email;
155
- this.selected = email;
156
- }
157
- },
158
- handleHandover() {
159
- if (!this.selected) {
160
- return;
161
- }
162
-
163
- if (!this.emailValidation(this.selected)) {
164
- this.invalidEmail = true;
165
- return;
166
- }
167
-
168
- this.invalidEmail = false;
169
- this.isLoading = true;
170
-
171
- // TODO: dispatch to store to set the new owner of the doc
172
- let assignee;
173
-
174
- // Check if the user is already a member of the project or new member
175
- if (this.isMember()) {
176
- assignee = { assignee: `${this.selected}` };
177
- } else {
178
- assignee = { email: `${this.selected}`, role: "annotator" };
179
- }
180
-
181
- setTimeout(() => {
182
- this.isLoading = false;
183
- // this.snackbar();
184
- this.selected = null;
185
- }, 2000);
186
- },
187
- snackbar() {
188
- this.$buefy.snackbar.open({
189
- message: `
190
- ${this.$t("document_successfully_handed")} ${this.selected}`,
191
- actionText: null
192
- });
193
- }
194
- }
195
- };
196
- </script>
197
-
198
- <style
199
- scoped
200
- lang="scss"
201
- src="../../assets/scss/document_handover.scss"
202
- ></style>