@smarterplan/ngx-smarterplan-locations 0.2.44 → 0.2.45

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 (152) hide show
  1. package/esm2020/lib/components/carousel/carousel.component.mjs +28 -0
  2. package/esm2020/lib/components/chevron/chevron.component.mjs +18 -0
  3. package/esm2020/lib/components/detail-location/detail-location.component.mjs +168 -0
  4. package/esm2020/lib/components/form-location/form-location.component.mjs +237 -0
  5. package/esm2020/lib/components/images/images.component.mjs +107 -0
  6. package/esm2020/lib/components/locations/locations.component.mjs +145 -0
  7. package/esm2020/lib/components/locations/map/map-popup/map-popup.component.mjs +66 -0
  8. package/esm2020/lib/components/locations/map/map.component.mjs +91 -0
  9. package/esm2020/lib/components/plan-legend/plan-legend.component.mjs +47 -0
  10. package/esm2020/lib/components/plans/calibration/calibration.component.mjs +468 -0
  11. package/esm2020/lib/components/plans/edit-plan/edit-plan.component.mjs +324 -0
  12. package/esm2020/lib/components/plans/plans.component.mjs +225 -0
  13. package/esm2020/lib/components/tab-navigation/tab-navigation.component.mjs +41 -0
  14. package/esm2020/lib/components/visits/visits.component.mjs +283 -0
  15. package/esm2020/lib/components/zones/add-audio-zone/add-audio-zone.component.mjs +230 -0
  16. package/esm2020/lib/components/zones/add-zone/add-zone.component.mjs +315 -0
  17. package/esm2020/lib/components/zones/add-zone/selection/selection.component.mjs +77 -0
  18. package/esm2020/lib/components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component.mjs +502 -0
  19. package/esm2020/lib/components/zones/zones.component.mjs +268 -0
  20. package/esm2020/lib/helper.service.mjs +134 -0
  21. package/esm2020/lib/ngx-smarterplan-location-routing.module.mjs +49 -0
  22. package/esm2020/lib/ngx-smarterplan-locations.module.mjs +125 -0
  23. package/esm2020/lib/ngx-smarterplan-locations.service.mjs +14 -0
  24. package/esm2020/lib/pipes/count-audio-sweeps.pipe.mjs +27 -0
  25. package/esm2020/lib/radio-button/radio-button.component.mjs +26 -0
  26. package/esm2020/public-api.mjs +9 -0
  27. package/esm2020/smarterplan-ngx-smarterplan-locations.mjs +5 -0
  28. package/fesm2015/smarterplan-ngx-smarterplan-locations.mjs +3991 -0
  29. package/fesm2015/smarterplan-ngx-smarterplan-locations.mjs.map +1 -0
  30. package/fesm2020/smarterplan-ngx-smarterplan-locations.mjs +3828 -0
  31. package/fesm2020/smarterplan-ngx-smarterplan-locations.mjs.map +1 -0
  32. package/lib/components/carousel/carousel.component.d.ts +12 -0
  33. package/lib/components/chevron/chevron.component.d.ts +9 -0
  34. package/lib/components/detail-location/detail-location.component.d.ts +55 -0
  35. package/lib/components/form-location/form-location.component.d.ts +45 -0
  36. package/lib/components/images/images.component.d.ts +33 -0
  37. package/lib/components/locations/locations.component.d.ts +51 -0
  38. package/lib/components/locations/map/map-popup/map-popup.component.d.ts +22 -0
  39. package/lib/components/locations/map/map.component.d.ts +22 -0
  40. package/lib/components/plan-legend/plan-legend.component.d.ts +14 -0
  41. package/lib/components/plans/calibration/calibration.component.d.ts +140 -0
  42. package/lib/components/plans/edit-plan/edit-plan.component.d.ts +55 -0
  43. package/lib/components/plans/plans.component.d.ts +63 -0
  44. package/lib/components/tab-navigation/tab-navigation.component.d.ts +13 -0
  45. package/lib/components/visits/visits.component.d.ts +62 -0
  46. package/lib/components/zones/add-audio-zone/add-audio-zone.component.d.ts +63 -0
  47. package/lib/components/zones/add-zone/add-zone.component.d.ts +69 -0
  48. package/lib/components/zones/add-zone/selection/selection.component.d.ts +44 -0
  49. package/lib/components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component.d.ts +107 -0
  50. package/lib/components/zones/zones.component.d.ts +73 -0
  51. package/lib/helper.service.d.ts +53 -0
  52. package/lib/ngx-smarterplan-location-routing.module.d.ts +7 -0
  53. package/lib/ngx-smarterplan-locations.module.d.ts +36 -0
  54. package/lib/ngx-smarterplan-locations.service.d.ts +6 -0
  55. package/lib/pipes/count-audio-sweeps.pipe.d.ts +10 -0
  56. package/lib/radio-button/radio-button.component.d.ts +12 -0
  57. package/package.json +22 -5
  58. package/{src/public-api.ts → public-api.d.ts} +4 -11
  59. package/smarterplan-ngx-smarterplan-locations.d.ts +5 -0
  60. package/.browserslistrc +0 -16
  61. package/karma.conf.js +0 -44
  62. package/ng-package.json +0 -7
  63. package/src/lib/components/carousel/carousel.component.html +0 -13
  64. package/src/lib/components/carousel/carousel.component.scss +0 -0
  65. package/src/lib/components/carousel/carousel.component.spec.ts +0 -25
  66. package/src/lib/components/carousel/carousel.component.ts +0 -31
  67. package/src/lib/components/chevron/chevron.component.html +0 -5
  68. package/src/lib/components/chevron/chevron.component.scss +0 -16
  69. package/src/lib/components/chevron/chevron.component.spec.ts +0 -25
  70. package/src/lib/components/chevron/chevron.component.ts +0 -17
  71. package/src/lib/components/detail-location/detail-location.component.html +0 -108
  72. package/src/lib/components/detail-location/detail-location.component.scss +0 -0
  73. package/src/lib/components/detail-location/detail-location.component.spec.ts +0 -25
  74. package/src/lib/components/detail-location/detail-location.component.ts +0 -215
  75. package/src/lib/components/form-location/form-location.component.html +0 -160
  76. package/src/lib/components/form-location/form-location.component.scss +0 -62
  77. package/src/lib/components/form-location/form-location.component.spec.ts +0 -25
  78. package/src/lib/components/form-location/form-location.component.ts +0 -274
  79. package/src/lib/components/images/images.component.html +0 -27
  80. package/src/lib/components/images/images.component.scss +0 -0
  81. package/src/lib/components/images/images.component.spec.ts +0 -25
  82. package/src/lib/components/images/images.component.ts +0 -133
  83. package/src/lib/components/locations/locations.component.html +0 -63
  84. package/src/lib/components/locations/locations.component.scss +0 -121
  85. package/src/lib/components/locations/locations.component.spec.ts +0 -25
  86. package/src/lib/components/locations/locations.component.ts +0 -186
  87. package/src/lib/components/locations/map/map-popup/map-popup.component.html +0 -11
  88. package/src/lib/components/locations/map/map-popup/map-popup.component.scss +0 -51
  89. package/src/lib/components/locations/map/map-popup/map-popup.component.spec.ts +0 -25
  90. package/src/lib/components/locations/map/map-popup/map-popup.component.ts +0 -79
  91. package/src/lib/components/locations/map/map.component.html +0 -2
  92. package/src/lib/components/locations/map/map.component.scss +0 -0
  93. package/src/lib/components/locations/map/map.component.spec.ts +0 -25
  94. package/src/lib/components/locations/map/map.component.ts +0 -111
  95. package/src/lib/components/plan-legend/plan-legend.component.html +0 -9
  96. package/src/lib/components/plan-legend/plan-legend.component.scss +0 -38
  97. package/src/lib/components/plan-legend/plan-legend.component.spec.ts +0 -25
  98. package/src/lib/components/plan-legend/plan-legend.component.ts +0 -50
  99. package/src/lib/components/plans/calibration/calibration.component.html +0 -98
  100. package/src/lib/components/plans/calibration/calibration.component.scss +0 -136
  101. package/src/lib/components/plans/calibration/calibration.component.spec.ts +0 -25
  102. package/src/lib/components/plans/calibration/calibration.component.ts +0 -603
  103. package/src/lib/components/plans/edit-plan/edit-plan.component.html +0 -77
  104. package/src/lib/components/plans/edit-plan/edit-plan.component.scss +0 -9
  105. package/src/lib/components/plans/edit-plan/edit-plan.component.spec.ts +0 -25
  106. package/src/lib/components/plans/edit-plan/edit-plan.component.ts +0 -421
  107. package/src/lib/components/plans/plans.component.html +0 -102
  108. package/src/lib/components/plans/plans.component.scss +0 -24
  109. package/src/lib/components/plans/plans.component.spec.ts +0 -25
  110. package/src/lib/components/plans/plans.component.ts +0 -305
  111. package/src/lib/components/tab-navigation/tab-navigation.component.html +0 -7
  112. package/src/lib/components/tab-navigation/tab-navigation.component.scss +0 -27
  113. package/src/lib/components/tab-navigation/tab-navigation.component.spec.ts +0 -25
  114. package/src/lib/components/tab-navigation/tab-navigation.component.ts +0 -35
  115. package/src/lib/components/visits/visits.component.html +0 -134
  116. package/src/lib/components/visits/visits.component.scss +0 -24
  117. package/src/lib/components/visits/visits.component.spec.ts +0 -25
  118. package/src/lib/components/visits/visits.component.ts +0 -357
  119. package/src/lib/components/zones/add-audio-zone/add-audio-zone.component.html +0 -73
  120. package/src/lib/components/zones/add-audio-zone/add-audio-zone.component.scss +0 -14
  121. package/src/lib/components/zones/add-audio-zone/add-audio-zone.component.spec.ts +0 -25
  122. package/src/lib/components/zones/add-audio-zone/add-audio-zone.component.ts +0 -269
  123. package/src/lib/components/zones/add-zone/add-zone.component.html +0 -153
  124. package/src/lib/components/zones/add-zone/add-zone.component.scss +0 -44
  125. package/src/lib/components/zones/add-zone/add-zone.component.spec.ts +0 -25
  126. package/src/lib/components/zones/add-zone/add-zone.component.ts +0 -377
  127. package/src/lib/components/zones/add-zone/selection/selection.component.html +0 -3
  128. package/src/lib/components/zones/add-zone/selection/selection.component.scss +0 -16
  129. package/src/lib/components/zones/add-zone/selection/selection.component.spec.ts +0 -25
  130. package/src/lib/components/zones/add-zone/selection/selection.component.ts +0 -95
  131. package/src/lib/components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component.html +0 -73
  132. package/src/lib/components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component.scss +0 -23
  133. package/src/lib/components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component.spec.ts +0 -25
  134. package/src/lib/components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component.ts +0 -595
  135. package/src/lib/components/zones/zones.component.html +0 -181
  136. package/src/lib/components/zones/zones.component.scss +0 -36
  137. package/src/lib/components/zones/zones.component.spec.ts +0 -25
  138. package/src/lib/components/zones/zones.component.ts +0 -339
  139. package/src/lib/helper.service.ts +0 -161
  140. package/src/lib/ngx-smarterplan-location-routing.module.ts +0 -41
  141. package/src/lib/ngx-smarterplan-locations.module.ts +0 -74
  142. package/src/lib/ngx-smarterplan-locations.service.spec.ts +0 -16
  143. package/src/lib/ngx-smarterplan-locations.service.ts +0 -9
  144. package/src/lib/pipes/count-audio-sweeps.pipe.ts +0 -21
  145. package/src/lib/radio-button/radio-button.component.html +0 -9
  146. package/src/lib/radio-button/radio-button.component.scss +0 -152
  147. package/src/lib/radio-button/radio-button.component.spec.ts +0 -25
  148. package/src/lib/radio-button/radio-button.component.ts +0 -26
  149. package/src/test.ts +0 -27
  150. package/tsconfig.lib.json +0 -15
  151. package/tsconfig.lib.prod.json +0 -10
  152. package/tsconfig.spec.json +0 -17
@@ -1,269 +0,0 @@
1
- import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
- import { FormGroup, FormBuilder, Validators } from '@angular/forms';
3
- import { TranslateService } from '@ngx-translate/core';
4
- import { ZoneService, LayerService, BaseUserService, NavigationService, Layer, Zone, CommentType, CommentService, Comment, filterUniqueArrayByID } from '@smarterplan/ngx-smarterplan-core';
5
-
6
-
7
- @Component({
8
- selector: 'lib-add-audio-zone',
9
- templateUrl: './add-audio-zone.component.html',
10
- styleUrls: ['./add-audio-zone.component.scss'],
11
- })
12
- export class AddAudioZoneComponent implements OnInit {
13
-
14
- @Input() spaceID: string;
15
-
16
- @Output() updatedZone = new EventEmitter<any>();
17
-
18
- @Input() defaultZone: Zone;
19
-
20
- @Input() zones: Zone[];
21
-
22
- @Input() parentZone: Zone;
23
-
24
- isSubmitted = false;
25
-
26
- fromPlan: boolean = false;
27
-
28
- chosenScansOnPlan: string[] = [];
29
-
30
- currentOrgId: string;
31
-
32
- audioLayer: Layer;
33
-
34
- commentForm: FormGroup;
35
-
36
- fileToUpload: File;
37
-
38
- audiosForSpace: Comment[];
39
-
40
- isAddingAudio = false;
41
-
42
- chosenAudio: Comment;
43
-
44
- audioZones: Zone[];
45
-
46
- @Input() currentAudioZone: Zone;
47
-
48
- scansModified = false;
49
-
50
- occupiedSweeps: string[] = [];
51
-
52
- unavailableSweeps: string[] = [];
53
-
54
- working = false;
55
-
56
- audioUploaded = false;
57
-
58
- constructor(
59
- private fb: FormBuilder,
60
- private zoneService: ZoneService,
61
- private layerService: LayerService,
62
- private userService: BaseUserService,
63
- private navigationService: NavigationService,
64
- private commentService: CommentService,
65
- private translate: TranslateService,
66
- ) { }
67
-
68
- ngOnInit(): void {
69
- if (this.currentAudioZone) {
70
- // we are editing zone
71
- this.chosenAudio = this.currentAudioZone.audio;
72
- this.chosenScansOnPlan = this.currentAudioZone.sweepIDs;
73
- this.parentZone = this.currentAudioZone.parent;
74
- }
75
- this.setup();
76
- }
77
-
78
- async setup() {
79
- const mission = this.userService.currentMission(this.spaceID);
80
- this.currentOrgId = mission.organisationID;
81
- let layers = await this.layerService.getLayerForOrganisation(
82
- this.currentOrgId,
83
- );
84
- this.audioLayer = layers.find((layer) => layer.name === "AUDIO");
85
- if (!this.audioLayer) {
86
- // first time creating Audio Zone
87
- this.audioLayer = await this.layerService.createLayerForOrganisation("AUDIO", this.currentOrgId);
88
- }
89
- if (!this.parentZone) {
90
- this.parentZone = this.defaultZone;
91
- }
92
- this.audioZones = this.zones.filter((zone) => zone.audioID && zone.parentID === this.parentZone.id);
93
- this.occupiedSweeps = this.audioZones.flatMap((zone) => zone.sweepIDs);
94
- // unavailable sweeps: sweeps that do not belong to parent zone
95
- this.unavailableSweeps = this.defaultZone.sweepIDs.filter((sweep) => !this.parentZone.sweepIDs.includes(sweep));
96
- await this.getAudios();
97
- this.commentForm = this.fb.group({
98
- title: [null, Validators.required],
99
- spaceID: this.spaceID,
100
- type: CommentType.AUDIO,
101
- ownerID: mission.id,
102
- });
103
- }
104
-
105
- async onSubmit() {
106
- this.isSubmitted = true;
107
- this.working = true;
108
- if (this.currentAudioZone) {
109
- await this.zoneService.updateZone({
110
- id: this.currentAudioZone.id,
111
- sweepIDs: this.chosenScansOnPlan,
112
- });
113
- await this.removeTakenSweepsFromOtherZones();
114
- this.updatedZone.emit(this.currentAudioZone.id);
115
- this.working = false;
116
- } else {
117
- const zoneInput = {
118
- name: `${this.parentZone.name} - ${this.chosenAudio.title}`,
119
- surface: 0,
120
- spaceID: this.spaceID,
121
- layerID: this.audioLayer.id,
122
- parentID: this.parentZone.id,
123
- isMuseumVisitZone: false,
124
- isMultipleFloorZone: this.parentZone.isMultipleFloorZone,
125
- audioID: this.chosenAudio.id,
126
- } as Zone;
127
- try {
128
- await this.setSweepsAndNodeForZoneInput(zoneInput);
129
- await this.zoneService
130
- .create(zoneInput)
131
- .then(async (zoneCreated) => {
132
- this.currentAudioZone = zoneCreated;
133
- await this.removeTakenSweepsFromOtherZones();
134
- this.updatedZone.emit(zoneCreated.id);
135
- });
136
- this.working = false;
137
- } catch (error) {
138
- console.error(error);
139
- this.working = false;
140
- }
141
- }
142
- }
143
-
144
- async setSweepsAndNodeForZoneInput(zoneInput: Zone) {
145
- if (this.chosenScansOnPlan.length > 0) {
146
- zoneInput.sweepIDs = this.chosenScansOnPlan;
147
- }
148
- if (zoneInput.sweepIDs && zoneInput.sweepIDs.length > 0) {
149
- const navForSweep =
150
- await this.navigationService.getNavigationsForMatterportIDForSpace(
151
- zoneInput.sweepIDs[0],
152
- this.spaceID,
153
- );
154
- zoneInput.nodeIDs = [navForSweep[0].nodeID];
155
- }
156
- }
157
-
158
- onCancel() {
159
- if (this.scansModified) {
160
- const message = this.translate.instant("confirm.cancelEditZone");
161
- if (!window.confirm(message)) {
162
- return;
163
- }
164
- }
165
- this.commentForm = null;
166
- this.chosenScansOnPlan = [];
167
- this.updatedZone.emit(false);
168
- }
169
-
170
- togglePlan() {
171
- this.fromPlan = true;
172
- }
173
-
174
- onSelectedSweepsFromPlan(result: { "sweeps": string[]; "startSweepID": string; }) {
175
- if (result && result.sweeps) {
176
- this.chosenScansOnPlan = result.sweeps;
177
- this.scansModified = true;
178
- }
179
- this.fromPlan = false;
180
- }
181
-
182
- handleFileInput(event: Event) {
183
- const target = event.target as HTMLInputElement;
184
- this.fileToUpload = (target.files as FileList)[0];
185
- }
186
-
187
- async onUploadAudio() {
188
- this.working = true;
189
- const commentInput = this.commentForm.value;
190
- try {
191
- const newAudio = await this.commentService.createCommentWithFile(
192
- commentInput,
193
- this.fileToUpload,
194
- );
195
- this.audiosForSpace.push(newAudio);
196
- this.isAddingAudio = false;
197
- this.working = false;
198
- this.audioUploaded = true;
199
- } catch (e) {
200
- this.working = false;
201
- this.audioUploaded = false;
202
- console.log(e);
203
- }
204
-
205
- }
206
-
207
- async getAudios() {
208
- const attachments = await this.commentService.getCommentsBySpaceID(this.spaceID);
209
- if (attachments) {
210
- this.audiosForSpace = attachments.filter((attachment) => attachment.type === CommentType.AUDIO);
211
- }
212
- }
213
-
214
- onCancelAudioUpload() {
215
- this.commentForm = null;
216
- this.isAddingAudio = false;
217
- this.fileToUpload = null;
218
- }
219
-
220
- onChooseAudio(audio: Comment) {
221
- this.chosenAudio = audio;
222
- this.currentAudioZone = this.audioZones.find((zone) => zone.audioID === this.chosenAudio.id);
223
- if (this.currentAudioZone) {
224
- this.chosenScansOnPlan = this.currentAudioZone.sweepIDs;
225
- } else {
226
- this.chosenScansOnPlan = [];
227
- }
228
- }
229
-
230
- /**
231
- * Removes newly selected sweeps for current zone (they are in chosenScansOnPlan) from other audio zones.
232
- * Rule: one sweep = one audio.
233
- */
234
- async removeTakenSweepsFromOtherZones() {
235
- await Promise.all(this.audioZones.map(async (zone) => {
236
- if (zone.id !== this.currentAudioZone.id) {
237
- const newSweeps = zone.sweepIDs.filter((sweepID) => !this.chosenScansOnPlan.includes(sweepID));
238
- if (newSweeps.length !== zone.sweepIDs.length) {
239
- await this.zoneService.updateZone({ id: zone.id, sweepIDs: newSweeps });
240
- }
241
- }
242
- }));
243
- }
244
-
245
- /**
246
- * Delete audio as Comment, all its audio Zones and file from S3 (using lambda function)
247
- */
248
- async onDeleteAudio() {
249
- const message = this.translate.instant("confirm.deleteAudio");
250
- if (window.confirm(message)) {
251
- await this.commentService.deleteComment(this.chosenAudio.id);
252
- const index = this.audiosForSpace.indexOf(this.chosenAudio);
253
- this.audiosForSpace.splice(index, 1);
254
-
255
- // delete all zones with this comment audio
256
- const audioZonesToDelete = this.zones.filter((z) => z.audioID === this.chosenAudio.id);
257
- await Promise.all(audioZonesToDelete.map(async (zone) => {
258
- await this.zoneService.deleteZone(zone.id);
259
- const indexZone = this.audioZones.indexOf(this.currentAudioZone);
260
- if (indexZone !== -1) {
261
- this.audioZones.slice(indexZone, 1);
262
- }
263
- }));
264
- this.currentAudioZone = null;
265
- this.chosenAudio = null;
266
- }
267
- }
268
-
269
- }
@@ -1,153 +0,0 @@
1
- <div class="main-container" *ngIf="zoneForm">
2
- <div class="col-7">
3
- <form (ngSubmit)="onSubmitZone()" [formGroup]="zoneForm">
4
- <div class="mb-3 row">
5
- <label class="col-sm-2 col-form-label">{{'Name' | translate}} *</label>
6
- <div class="col-sm-10">
7
- <input type="text" class="form-control" required formControlName="name">
8
- <!-- <div class="invalid-feedback">
9
- {{'A name is required' | translate}}
10
- </div> -->
11
- </div>
12
- </div>
13
- <div class="mb-3 row">
14
- <label class="col-sm-2 col-form-label">{{'codeRef' | translate}}</label>
15
- <div class="col-sm-10">
16
- <input type="text" class="form-control" formControlName="code_ref">
17
- </div>
18
- </div>
19
- <div class="mb-3 row" *ngIf="!isMuseumVisit && !zoneIsMatterportFloor">
20
- <label class="col-sm-2 col-form-label">{{'Type of zone' | translate}}</label>
21
- <div class="col-sm-10">
22
- <select class="form-control" formControlName="layerID">
23
- <option value="null" selected disabled hidden> {{ zoneEdit && zoneEdit.layer ?
24
- zoneEdit.layer.name : 'Choose type'}}</option>
25
- <option *ngFor="let layer of layers" [value]="layer.id">
26
- {{ layer.name }}
27
- </option>
28
- </select>
29
- <p class="mt-1 new-type-text">{{'or add new type of zone' | translate }}</p>
30
- <input type="text" class="form-control new-type-input" formControlName="newLayer">
31
- <div *ngIf="newLayer.invalid && (newLayer.dirty || newLayer.touched)" class="text-danger">
32
- <div *ngIf="newLayer.errors?.['forbiddenName']">
33
- {{'Layer exists already' | translate}}
34
- </div>
35
- </div>
36
- </div>
37
- </div>
38
- <!--If Editing Zone possibility to assign it to museum itinerary-->
39
- <div class="mb-3 row" *ngIf="zoneEdit && !zoneIsMatterportFloor">
40
- <label class="col-sm-2 col-form-label">{{ 'Museum Itinerary' | translate }}</label>
41
- <div class="col-sm-10">
42
- <input class="checkbox-apply mt-3" type="checkbox" [(ngModel)]="isMuseumVisit"
43
- [ngModelOptions]="{standalone: true}">
44
- </div>
45
- </div>
46
-
47
- <div class="mb-3 row" *ngIf="!zoneEdit || zoneEdit.isMultipleFloorZone">
48
- <label class="col-sm-2 col-form-label">{{ 'Multiple Floors' | translate }}</label>
49
- <div class="col-sm-10">
50
- <input class="checkbox-apply mt-3" type="checkbox" [(ngModel)]="multipleFloors"
51
- [disabled]="zoneEdit !== undefined && zoneEdit !== null" (change)="onChangeMultipleFloors()"
52
- [ngModelOptions]="{standalone: true}">
53
- <div class='text-danger' *ngIf="zoneEdit">
54
- {{'cannotChangeMultifloor' | translate}}
55
- </div>
56
- </div>
57
-
58
- </div>
59
-
60
- <div class="mb-3 row">
61
- <label class="col-sm-2 col-form-label">{{'Surface' | translate}}</label>
62
- <div class="col-sm-10">
63
- <input type="text" class="form-control" formControlName="surface">
64
- </div>
65
- </div>
66
-
67
- <div class="mb-3 row" *ngIf="!zoneIsMatterportFloor">
68
- <label class="col-sm-2 col-form-label">{{'Parent zone' | translate}}</label>
69
- <div class="col-sm-10">
70
- <input *ngIf="zoneEdit" type="text" class="form-control" formControlName="parent">
71
- <div class="text-danger" *ngIf="zoneEdit">
72
- {{'cannotChangeParent' | translate}}
73
- </div>
74
- <select *ngIf="!zoneEdit" class="form-control" formControlName="parentID">
75
- <option *ngFor="let zone of parentZones" [ngValue]="zone.id">
76
- {{ zone.name }}
77
- </option>
78
- </select>
79
-
80
- </div>
81
- </div>
82
-
83
- <div class="mb-3 row" style="max-height: 200px; overflow: auto;" *ngIf="!zoneIsMatterportFloor">
84
- <label class="col-sm-2 col-form-label">{{'Scan Points' | translate}}</label>
85
- <!-- <p class="col-sm-2" *ngIf="zoneEdit">{{ zoneEdit.sweepIDs.length }} scans</p> -->
86
- <p class="col" *ngIf="chosenScansOnPlan.length === 0 && chosenScans.length === 0">
87
- {{'No scan points chosen' | translate}}</p>
88
- <div class="col-sm-5" *ngIf="chosenScansOnPlan && chosenScansOnPlan.length > 0">
89
- <p>{{ chosenScansOnPlan.length }} {{'scan points chosen' | translate}}</p>
90
- <!-- <div *ngFor="let scan of chosenScansOnPlan">
91
- <div class="row">
92
- <p class="me-2">{{ scan | slice:0:8 }}</p>
93
- <div (click)="onRemoveScanPlan(scan)" [style.cursor]="'pointer'">
94
- <span class="iconify" data-icon="mdi:trash-can-outline"></span>
95
- </div>
96
- </div>
97
- </div> -->
98
- </div>
99
- <div class="col-sm-5" *ngIf="carouselIsVisible && chosenScans && chosenScans.length > 0">
100
- <p>{{ chosenScans.length }} {{'scan points chosen' | translate}}</p>
101
- <div *ngFor="let scan of chosenScans">
102
- <div class="row">
103
- <p class="me-2">{{ images360[scan].filename }}</p>
104
- <div (click)="onRemoveScanImage(scan)" [style.cursor]="'pointer'">
105
- <span class="iconify" data-icon="mdi:trash-can-outline"></span>
106
- </div>
107
- </div>
108
- </div>
109
- </div>
110
- </div>
111
-
112
- <div class="row mb-3 mt-3" *ngIf="!zoneIsMatterportFloor">
113
- <div class="col">
114
- <button type="button" class="btn btn-outline-primary rounded-pill me-2"
115
- (click)="togglePlan()">{{'Choose scan points on plan' |
116
- translate}}</button>
117
- <button type="button" class="btn btn-outline-primary rounded-pill me-2" (click)="toggleCarousel()"
118
- [disabled]="fromPlan || !images360 || images360.length === 0">
119
- {{'Choose scan points from gallery' | translate}}</button>
120
- <button type="button" class="btn btn-outline-primary rounded-pill me-2" (click)="onAddAll()"
121
- [disabled]="fromPlan || !images360 || images360.length === 0">
122
- {{'add-all-scans' | translate}}</button>
123
- </div>
124
- </div>
125
-
126
- <!-- <div class="mb-3 row">
127
- <label class="col-sm-3 col-form-label">{{'No visible scan points' | translate}}</label>
128
- <div class="col-sm-3">
129
- <input class="checkbox-apply mt-3" type="checkbox" [(ngModel)]="noScanPoints"
130
- [ngModelOptions]="{standalone: true}">
131
- </div>
132
- </div> -->
133
-
134
- <div *ngIf="carouselIsVisible" class="mb-2">
135
- <lib-carousel *ngIf="images360 && images360.length > 0" [images]="images360"
136
- (currentScan)="currentScanShowing=$event"></lib-carousel>
137
- <button type="button" class="btn btn-outline-primary rounded-pill me-2 mt-3"
138
- (click)="onAddScan()">{{'Add to zone' | translate}}</button>
139
- </div>
140
- <div class="mt-3">
141
- <button type="submit" class="btn btn-primary rounded-pill me-2"
142
- [disabled]="fromPlan || !zoneForm.valid">{{'Save' | translate}}</button>
143
- <button type="button" (click)="onCancel()" class="btn btn-outline-primary rounded-pill me-2">
144
- {{'Cancel' | translate}}</button>
145
- </div>
146
- </form>
147
- </div>
148
- <div class="edit-plan" *ngIf="fromPlan">
149
- <lib-sweep-plan-selection style="width: 100%;" [newZoneData]="newZoneDataFromEditor" [spaceID]="spaceID"
150
- [multipleFloors]="multipleFloors" [inputZone]="zoneEdit"
151
- (sweepsSelected)="onSelectedSweepsFromPlan($event)"></lib-sweep-plan-selection>
152
- </div>
153
- </div>
@@ -1,44 +0,0 @@
1
- .main-container {
2
- display: flex;
3
- flex-direction: column;
4
- }
5
-
6
- .edit-plan {
7
- display: flex;
8
- margin: 8px 0px;
9
- }
10
-
11
- .form-range {
12
- width: 100%;
13
- }
14
-
15
- h2 {
16
- color: var(--smarterplan-primary);
17
- padding: 0px;
18
- }
19
-
20
- .col-form-label {
21
- margin-bottom: 1rem;
22
- }
23
- .btn-outline-primary {
24
- margin-right: 1rem;
25
- }
26
- .new-type-input {
27
- margin-bottom: 1rem;
28
- }
29
- .new-type-text {
30
- margin-bottom: 0.5rem;
31
- }
32
- .row {
33
- margin: 0px;
34
- }
35
-
36
- p {
37
- margin: 0;
38
- padding-top: calc(0.375rem + 1px);
39
- padding-bottom: calc(0.375rem + 1px);
40
- }
41
-
42
- button {
43
- min-width: 80px;
44
- }
@@ -1,25 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { AddZoneComponent } from './add-zone.component';
4
-
5
- describe('AddZoneComponent', () => {
6
- let component: AddZoneComponent;
7
- let fixture: ComponentFixture<AddZoneComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ AddZoneComponent ]
12
- })
13
- .compileComponents();
14
- });
15
-
16
- beforeEach(() => {
17
- fixture = TestBed.createComponent(AddZoneComponent);
18
- component = fixture.componentInstance;
19
- fixture.detectChanges();
20
- });
21
-
22
- it('should create', () => {
23
- expect(component).toBeTruthy();
24
- });
25
- });