@smarterplan/ngx-smarterplan-core 1.4.29 → 1.4.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -24
- package/esm2022/lib/components/checkbox-slider/checkbox-slider.component.mjs +3 -3
- package/esm2022/lib/components/csv-export/csv-export.component.mjs +3 -3
- package/esm2022/lib/components/inventory-runs/inventory-files.component.mjs +89 -89
- package/esm2022/lib/components/inventory-runs/inventory-launch.component.mjs +3 -3
- package/esm2022/lib/components/inventory-runs/inventory-runs.component.mjs +3 -3
- package/esm2022/lib/components/loader/loader.component.mjs +3 -3
- package/esm2022/lib/components/menu-bar/avatar/avatar.component.mjs +1 -1
- package/esm2022/lib/components/menu-bar/menu-bar.component.mjs +3 -3
- package/esm2022/lib/components/menu-bar/navigation-bar/navigation-bar.component.mjs +3 -3
- package/esm2022/lib/components/modal-switch-visit/modal-switch-visit.component.mjs +3 -3
- package/esm2022/lib/components/search-bar/search-bar.component.mjs +3 -3
- package/esm2022/lib/components/splat-viewer/splat-viewer.component.mjs +1 -1
- package/esm2022/lib/components/support-modal/support-modal.component.mjs +3 -3
- package/esm2022/lib/config.mjs +1 -1
- package/esm2022/lib/helpers.service.mjs +1 -1
- package/esm2022/lib/matterport-extensions/nest-thermostat/CanvasImage.mjs +1 -1
- package/esm2022/lib/matterport-extensions/nest-thermostat/CanvasRenderer.mjs +1 -1
- package/esm2022/lib/matterport-extensions/nest-thermostat/NestThermostat.mjs +1 -1
- package/esm2022/lib/matterport-extensions/nest-thermostat/PlaneRenderer.mjs +1 -1
- package/esm2022/lib/matterport-extensions/scene-component/SceneComponent.mjs +1 -1
- package/esm2022/lib/matterport-extensions/security-camera/SecurityCamera.mjs +22 -22
- package/esm2022/lib/matterport-extensions/tv-player/TvPlayer.mjs +1 -1
- package/esm2022/lib/matterport-extensions/view-frustum-mesh/ViewFrustumMesh.mjs +22 -22
- package/esm2022/lib/mattertagData.mjs +1 -1
- package/esm2022/lib/ngx-smarterplan-core.module.mjs +1 -1
- package/esm2022/lib/ngx-smarterplan-core.service.mjs +1 -1
- package/esm2022/lib/pipes/duration-to-string.pipe.mjs +1 -1
- package/esm2022/lib/pipes/format-date-number-to-digits.pipe.mjs +1 -1
- package/esm2022/lib/pipes/hashtag-from-id.pipe.mjs +1 -1
- package/esm2022/lib/pipes/safe-url.pipe.mjs +1 -1
- package/esm2022/lib/pipes/time-date-to-local-string.pipe.mjs +1 -1
- package/esm2022/lib/pipes/username-from-id.pipe.mjs +1 -1
- package/esm2022/lib/services/amplify-cache.service.mjs +1 -1
- package/esm2022/lib/services/base-tab.service.mjs +1 -1
- package/esm2022/lib/services/baseVisibility.service.mjs +1 -1
- package/esm2022/lib/services/content.service.mjs +1 -1
- package/esm2022/lib/services/filter.service.mjs +16 -1
- package/esm2022/lib/services/intervention.service.mjs +1 -1
- package/esm2022/lib/services/locale.service.mjs +1 -1
- package/esm2022/lib/services/matterport-import.service.mjs +1 -1
- package/esm2022/lib/services/matterport-measurement.service.mjs +1 -1
- package/esm2022/lib/services/matterport-navigation.service.mjs +1 -1
- package/esm2022/lib/services/matterport-object3d.service.mjs +1 -1
- package/esm2022/lib/services/matterport-pointer.service.mjs +6 -6
- package/esm2022/lib/services/matterport-tag-copy.service.mjs +930 -138
- package/esm2022/lib/services/matterport-tag.service.mjs +1 -1
- package/esm2022/lib/services/matterport.service.mjs +17 -17
- package/esm2022/lib/services/models/affectation.service.mjs +1 -1
- package/esm2022/lib/services/models/base-object.service.mjs +1 -1
- package/esm2022/lib/services/models/capture.service.mjs +1 -1
- package/esm2022/lib/services/models/comment.service.mjs +1 -1
- package/esm2022/lib/services/models/domain.service.mjs +1 -1
- package/esm2022/lib/services/models/equipment.service.mjs +46 -3
- package/esm2022/lib/services/models/event.service.mjs +1 -1
- package/esm2022/lib/services/models/feature.service.mjs +47 -5
- package/esm2022/lib/services/models/hashtag.service.mjs +1 -1
- package/esm2022/lib/services/models/inventory-storage.mjs +1 -1
- package/esm2022/lib/services/models/inventory.service.mjs +3 -3
- package/esm2022/lib/services/models/layer.service.mjs +1 -1
- package/esm2022/lib/services/models/measurement.service.mjs +3 -1
- package/esm2022/lib/services/models/mission.service.mjs +1 -1
- package/esm2022/lib/services/models/navigation.service.mjs +1 -1
- package/esm2022/lib/services/models/node.service.mjs +1 -1
- package/esm2022/lib/services/models/object3D.service.mjs +23 -6
- package/esm2022/lib/services/models/operation.service.mjs +1 -1
- package/esm2022/lib/services/models/organisation.service.mjs +1 -1
- package/esm2022/lib/services/models/plan.service.mjs +1 -1
- package/esm2022/lib/services/models/poi.service.mjs +67 -30
- package/esm2022/lib/services/models/profile.service.mjs +1 -1
- package/esm2022/lib/services/models/property.service.mjs +1 -1
- package/esm2022/lib/services/models/space.service.mjs +1 -1
- package/esm2022/lib/services/models/template.service.mjs +1 -1
- package/esm2022/lib/services/models/ticket.service.mjs +43 -3
- package/esm2022/lib/services/models/visit.service.mjs +1 -1
- package/esm2022/lib/services/models/zone.service.mjs +1 -1
- package/esm2022/lib/services/navigator.service.mjs +1 -1
- package/esm2022/lib/services/obj-to-glb.mjs +1 -1
- package/esm2022/lib/services/retry-when-throttled.mjs +1 -1
- package/esm2022/lib/services/s3.service.mjs +22 -5
- package/esm2022/lib/services/search.service.mjs +1 -1
- package/esm2022/lib/services/support.service.mjs +1 -1
- package/esm2022/lib/services/sweep-locator.service.mjs +1 -1
- package/esm2022/lib/services/tag.service.mjs +16 -16
- package/esm2022/lib/services/threejs-import.service.mjs +1 -1
- package/esm2022/lib/services/threejs.service.mjs +1 -1
- package/esm2022/lib/services/user.service.mjs +18 -1
- package/esm2022/lib/services/utils/matterport-framing.util.mjs +1 -1
- package/esm2022/lib/services/utils/matterport-transform.util.mjs +26 -1
- package/esm2022/lib/services/utils/object3d-model.util.mjs +155 -0
- package/esm2022/lib/services/utils/tag-archive.util.mjs +89 -0
- package/esm2022/lib/services/validators.service.mjs +1 -1
- package/esm2022/lib/services/viewer.service.mjs +1 -1
- package/esm2022/lib/services/zone-drawer.service.mjs +1 -1
- package/esm2022/lib/services/zoneChange.service.mjs +1 -1
- package/esm2022/lib/tokens/matterport-sdk-key.token.mjs +1 -1
- package/esm2022/lib/tokens/object3d-model-upload.token.mjs +14 -0
- package/esm2022/lib/types.service.mjs +1 -1
- package/esm2022/lib/validators/email.directive.mjs +1 -1
- package/esm2022/lib/validators/no-empty.directive.mjs +1 -1
- package/esm2022/lib/validators/number.directive.mjs +1 -1
- package/esm2022/lib/validators/text.directive.mjs +1 -1
- package/esm2022/public-api.mjs +4 -1
- package/fesm2022/smarterplan-ngx-smarterplan-core.mjs +1666 -368
- package/fesm2022/smarterplan-ngx-smarterplan-core.mjs.map +1 -1
- package/lib/services/filter.service.d.ts +9 -0
- package/lib/services/matterport-tag-copy.service.d.ts +233 -13
- package/lib/services/models/equipment.service.d.ts +4 -0
- package/lib/services/models/feature.service.d.ts +4 -0
- package/lib/services/models/object3D.service.d.ts +5 -1
- package/lib/services/models/poi.service.d.ts +23 -0
- package/lib/services/models/ticket.service.d.ts +4 -0
- package/lib/services/s3.service.d.ts +15 -0
- package/lib/services/user.service.d.ts +7 -0
- package/lib/services/utils/matterport-transform.util.d.ts +14 -0
- package/lib/services/utils/object3d-model.util.d.ts +58 -0
- package/lib/services/utils/tag-archive.util.d.ts +97 -0
- package/lib/tokens/object3d-model-upload.token.d.ts +10 -0
- package/package.json +2 -1
- package/public-api.d.ts +3 -0
- package/src/assets/viewers/splat/convert.html +11 -11
- package/src/assets/viewers/splat/index.html +90 -90
- package/src/assets/viewers/splat/webp.wasm +0 -0
- package/src/assets/vs-app.json +67 -67
|
@@ -8,9 +8,9 @@ import * as i1$2 from '@ng-bootstrap/ng-bootstrap';
|
|
|
8
8
|
import { NgbDate, NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
|
9
9
|
import * as i1 from '@angular/router';
|
|
10
10
|
import { RouterModule } from '@angular/router';
|
|
11
|
-
import { Subject, BehaviorSubject, takeUntil, Observable } from 'rxjs';
|
|
11
|
+
import { Subject, BehaviorSubject, filter, takeUntil, Observable } from 'rxjs';
|
|
12
12
|
import * as THREE from 'three';
|
|
13
|
-
import { Matrix4, Vector3, Color, Object3D, Euler, PerspectiveCamera, CylinderBufferGeometry, BoxGeometry, MeshBasicMaterial, NormalBlending, BackSide, Mesh, EdgesGeometry, AdditiveBlending, ShaderMaterial, AnimationMixer, VectorKeyframeTrack, InterpolateSmooth, AnimationClip, LoopOnce, Group, PlaneBufferGeometry, CanvasTexture, Texture, LinearFilter, Box3, MathUtils } from 'three';
|
|
13
|
+
import { Matrix4, Vector3, Color, Object3D, Euler, PerspectiveCamera, CylinderBufferGeometry, BoxGeometry, MeshBasicMaterial, NormalBlending, BackSide, Mesh, EdgesGeometry, AdditiveBlending, ShaderMaterial, AnimationMixer, VectorKeyframeTrack, InterpolateSmooth, AnimationClip, LoopOnce, Group, PlaneBufferGeometry, CanvasTexture, Texture, LinearFilter, Box3, MathUtils, Quaternion } from 'three';
|
|
14
14
|
import * as BufferGeometryUtils from 'three/examples/jsm/utils/BufferGeometryUtils.js';
|
|
15
15
|
import { Storage, Auth, API, graphqlOperation, Cache } from 'aws-amplify';
|
|
16
16
|
import { DateTime } from 'luxon';
|
|
@@ -47,6 +47,7 @@ import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
|
47
47
|
import checkIcon from '@iconify/icons-mdi/check';
|
|
48
48
|
import * as CryptoJS from 'crypto-js';
|
|
49
49
|
import { v4 } from 'uuid';
|
|
50
|
+
import { strToU8, zipSync, unzipSync, strFromU8 } from 'fflate';
|
|
50
51
|
|
|
51
52
|
class NgxSmarterplanCoreService {
|
|
52
53
|
constructor() { }
|
|
@@ -775,30 +776,30 @@ class SecurityCamera extends SceneComponent {
|
|
|
775
776
|
}
|
|
776
777
|
}
|
|
777
778
|
function vertexShader$1() {
|
|
778
|
-
return `
|
|
779
|
-
uniform mat4 lightMatrix;
|
|
780
|
-
|
|
781
|
-
varying vec4 vLightCoords;
|
|
782
|
-
|
|
783
|
-
void main() {
|
|
784
|
-
// create a UV region [0,1] x [0,1] to represent what the lightMatrix "sees"
|
|
785
|
-
vLightCoords = lightMatrix * modelMatrix * vec4(position, 1.0);
|
|
786
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
787
|
-
}
|
|
779
|
+
return `
|
|
780
|
+
uniform mat4 lightMatrix;
|
|
781
|
+
|
|
782
|
+
varying vec4 vLightCoords;
|
|
783
|
+
|
|
784
|
+
void main() {
|
|
785
|
+
// create a UV region [0,1] x [0,1] to represent what the lightMatrix "sees"
|
|
786
|
+
vLightCoords = lightMatrix * modelMatrix * vec4(position, 1.0);
|
|
787
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
788
|
+
}
|
|
788
789
|
`;
|
|
789
790
|
}
|
|
790
791
|
function fragmentShader$1() {
|
|
791
|
-
return `
|
|
792
|
-
uniform vec3 color;
|
|
793
|
-
|
|
794
|
-
varying vec4 vLightCoords;
|
|
795
|
-
|
|
796
|
-
void main() {
|
|
797
|
-
vec2 lightUV = vLightCoords.xy / vLightCoords.w;
|
|
798
|
-
float inView = float(max(lightUV.x, lightUV.y) <= 1.0 && min(lightUV.x, lightUV.y) >= 0.0 && vLightCoords.z > 0.0);
|
|
799
|
-
|
|
800
|
-
gl_FragColor = vec4(color, min(inView, 0.2));
|
|
801
|
-
}
|
|
792
|
+
return `
|
|
793
|
+
uniform vec3 color;
|
|
794
|
+
|
|
795
|
+
varying vec4 vLightCoords;
|
|
796
|
+
|
|
797
|
+
void main() {
|
|
798
|
+
vec2 lightUV = vLightCoords.xy / vLightCoords.w;
|
|
799
|
+
float inView = float(max(lightUV.x, lightUV.y) <= 1.0 && min(lightUV.x, lightUV.y) >= 0.0 && vLightCoords.z > 0.0);
|
|
800
|
+
|
|
801
|
+
gl_FragColor = vec4(color, min(inView, 0.2));
|
|
802
|
+
}
|
|
802
803
|
`;
|
|
803
804
|
}
|
|
804
805
|
function updateHighlightUniforms$1(projector, uniforms) {
|
|
@@ -991,30 +992,30 @@ class ViewFrustumMesh extends SceneComponent {
|
|
|
991
992
|
}
|
|
992
993
|
}
|
|
993
994
|
function vertexShader() {
|
|
994
|
-
return `
|
|
995
|
-
uniform mat4 lightMatrix;
|
|
996
|
-
|
|
997
|
-
varying vec4 vLightCoords;
|
|
998
|
-
|
|
999
|
-
void main() {
|
|
1000
|
-
// create a UV region [0,1] x [0,1] to represent what the lightMatrix "sees"
|
|
1001
|
-
vLightCoords = lightMatrix * modelMatrix * vec4(position, 1.0);
|
|
1002
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1003
|
-
}
|
|
995
|
+
return `
|
|
996
|
+
uniform mat4 lightMatrix;
|
|
997
|
+
|
|
998
|
+
varying vec4 vLightCoords;
|
|
999
|
+
|
|
1000
|
+
void main() {
|
|
1001
|
+
// create a UV region [0,1] x [0,1] to represent what the lightMatrix "sees"
|
|
1002
|
+
vLightCoords = lightMatrix * modelMatrix * vec4(position, 1.0);
|
|
1003
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1004
|
+
}
|
|
1004
1005
|
`;
|
|
1005
1006
|
}
|
|
1006
1007
|
function fragmentShader() {
|
|
1007
|
-
return `
|
|
1008
|
-
uniform vec3 color;
|
|
1009
|
-
|
|
1010
|
-
varying vec4 vLightCoords;
|
|
1011
|
-
|
|
1012
|
-
void main() {
|
|
1013
|
-
vec2 lightUV = vLightCoords.xy / vLightCoords.w;
|
|
1014
|
-
float inView = float(max(lightUV.x, lightUV.y) <= 1.0 && min(lightUV.x, lightUV.y) >= 0.0 && vLightCoords.z > 0.0);
|
|
1015
|
-
|
|
1016
|
-
gl_FragColor = vec4(color, min(inView, 0.2));
|
|
1017
|
-
}
|
|
1008
|
+
return `
|
|
1009
|
+
uniform vec3 color;
|
|
1010
|
+
|
|
1011
|
+
varying vec4 vLightCoords;
|
|
1012
|
+
|
|
1013
|
+
void main() {
|
|
1014
|
+
vec2 lightUV = vLightCoords.xy / vLightCoords.w;
|
|
1015
|
+
float inView = float(max(lightUV.x, lightUV.y) <= 1.0 && min(lightUV.x, lightUV.y) >= 0.0 && vLightCoords.z > 0.0);
|
|
1016
|
+
|
|
1017
|
+
gl_FragColor = vec4(color, min(inView, 0.2));
|
|
1018
|
+
}
|
|
1018
1019
|
`;
|
|
1019
1020
|
}
|
|
1020
1021
|
function updateHighlightUniforms(projector, uniforms) {
|
|
@@ -1248,17 +1249,34 @@ const copyFileInS3 = async (sourceKey, destKey) => {
|
|
|
1248
1249
|
* IMPORTANT: like copyFileInS3, this must NOT swallow errors.
|
|
1249
1250
|
*/
|
|
1250
1251
|
const copyFileInS3ViaDownload = async (sourceKey, destKey) => {
|
|
1251
|
-
const downloaded = await
|
|
1252
|
+
const downloaded = await downloadS3Object(sourceKey);
|
|
1253
|
+
return uploadS3Object(destKey, downloaded.body, downloaded.contentType);
|
|
1254
|
+
};
|
|
1255
|
+
/**
|
|
1256
|
+
* Downloads an S3 object (public level) as a Blob, with its content type.
|
|
1257
|
+
* Used by the tag export, which packs the files into an archive so they can be re-uploaded
|
|
1258
|
+
* on another environment (another bucket).
|
|
1259
|
+
* IMPORTANT: does NOT swallow errors — callers need NoSuchKey to tell a missing file apart.
|
|
1260
|
+
*/
|
|
1261
|
+
const downloadS3Object = async (key) => {
|
|
1262
|
+
const downloaded = await Storage.get(key, {
|
|
1252
1263
|
download: true,
|
|
1253
1264
|
level: "public",
|
|
1254
1265
|
});
|
|
1255
1266
|
const body = downloaded?.Body;
|
|
1256
1267
|
if (!body) {
|
|
1257
|
-
throw new Error(`Empty download for "${
|
|
1268
|
+
throw new Error(`Empty download for "${key}"`);
|
|
1258
1269
|
}
|
|
1259
|
-
|
|
1270
|
+
return { body, contentType: downloaded.ContentType || null };
|
|
1271
|
+
};
|
|
1272
|
+
/**
|
|
1273
|
+
* Uploads raw content (Blob or bytes) under an exact S3 key (public level) and returns that key.
|
|
1274
|
+
* IMPORTANT: does NOT swallow errors.
|
|
1275
|
+
*/
|
|
1276
|
+
const uploadS3Object = async (key, body, contentType = null) => {
|
|
1277
|
+
const result = await Storage.put(key, body, {
|
|
1260
1278
|
level: "public",
|
|
1261
|
-
contentType:
|
|
1279
|
+
contentType: contentType || undefined,
|
|
1262
1280
|
});
|
|
1263
1281
|
return result.key;
|
|
1264
1282
|
};
|
|
@@ -1946,6 +1964,23 @@ class BaseUserService {
|
|
|
1946
1964
|
const highestLevel = getHighestLevelForMissions(this.currentMissions);
|
|
1947
1965
|
return levels.filter((level) => getLevelsBelow(highestLevel).includes(level));
|
|
1948
1966
|
}
|
|
1967
|
+
/**
|
|
1968
|
+
* The access levels the user sees in every one of the spaces, by the rule the lists are
|
|
1969
|
+
* filtered with: those of their highest mission in a space, and all of them where they have no
|
|
1970
|
+
* mission, as nothing is filtered there. A form offering a level beyond these would make an
|
|
1971
|
+
* object its own author cannot see.
|
|
1972
|
+
*/
|
|
1973
|
+
getAvailableLevelsForSpaces(spaceIDs) {
|
|
1974
|
+
const levels = enumToArray(LevelStatus);
|
|
1975
|
+
return spaceIDs.reduce((visible, spaceID) => {
|
|
1976
|
+
const spaceMissions = (this.currentMissions ?? []).filter((mission) => mission.spaceID === spaceID);
|
|
1977
|
+
if (spaceMissions.length === 0) {
|
|
1978
|
+
return visible;
|
|
1979
|
+
}
|
|
1980
|
+
const below = getLevelsBelow(getHighestLevelForMissions(spaceMissions));
|
|
1981
|
+
return visible.filter((level) => below.includes(level));
|
|
1982
|
+
}, levels);
|
|
1983
|
+
}
|
|
1949
1984
|
getAvailableRolesForCurrentUser() {
|
|
1950
1985
|
if (!this.currentMissions) {
|
|
1951
1986
|
return [RoleStatus.VISITOR];
|
|
@@ -2130,6 +2165,13 @@ class PoiService {
|
|
|
2130
2165
|
destroy$ = new Subject();
|
|
2131
2166
|
/** Elements whose POI was written in this session: a copy loaded earlier with the element is outdated. */
|
|
2132
2167
|
changedElementIDs = new Set();
|
|
2168
|
+
/**
|
|
2169
|
+
* Every POI this service has just created, updated or deleted. The lists sorted by zone read the
|
|
2170
|
+
* zone off the POI, so they have to be sorted again when it moves.
|
|
2171
|
+
*/
|
|
2172
|
+
poiWritten = new Subject();
|
|
2173
|
+
/** The last POI written for each element in this session, by element ID. */
|
|
2174
|
+
lastWrites = new Map();
|
|
2133
2175
|
constructor(apiInjected, awsKinesisAnalyticsInjected, userService, zoneChangeService // inject ZoneChangeService instead of NavigatorService to fix circular dependancy
|
|
2134
2176
|
) {
|
|
2135
2177
|
this.userService = userService;
|
|
@@ -2209,17 +2251,47 @@ class PoiService {
|
|
|
2209
2251
|
}, 'AWSKinesis');
|
|
2210
2252
|
}
|
|
2211
2253
|
this.markChanged(poi);
|
|
2212
|
-
return this.API.CreatePOI(poi);
|
|
2254
|
+
return this.written(await this.API.CreatePOI(poi), false);
|
|
2213
2255
|
}
|
|
2214
2256
|
poiIsVirtual(poi) {
|
|
2215
2257
|
const { coordinate } = poi;
|
|
2216
2258
|
return !coordinate;
|
|
2217
2259
|
}
|
|
2218
2260
|
async updatePoi(poi) {
|
|
2219
|
-
return this.markChanged(await this.API.UpdatePOI(poi));
|
|
2261
|
+
return this.written(this.markChanged(await this.API.UpdatePOI(poi)), false);
|
|
2220
2262
|
}
|
|
2221
2263
|
async deletePoi(poiID) {
|
|
2222
|
-
return this.markChanged(await this.API.DeletePOI({ id: poiID }));
|
|
2264
|
+
return this.written(this.markChanged(await this.API.DeletePOI({ id: poiID })), true);
|
|
2265
|
+
}
|
|
2266
|
+
written(poi, deleted) {
|
|
2267
|
+
if (poi?.elementID) {
|
|
2268
|
+
const write = { poi, deleted };
|
|
2269
|
+
this.lastWrites.set(poi.elementID, write);
|
|
2270
|
+
this.poiWritten.next(write);
|
|
2271
|
+
}
|
|
2272
|
+
return poi;
|
|
2273
|
+
}
|
|
2274
|
+
/**
|
|
2275
|
+
* Puts in the objects the POI this session last wrote for them, where it is more recent than the
|
|
2276
|
+
* one they were loaded with. The lists are read from indexes that may not show a write made a
|
|
2277
|
+
* moment ago, and a zone read off the old POI would be the wrong one.
|
|
2278
|
+
*/
|
|
2279
|
+
withLatestPois(objects) {
|
|
2280
|
+
for (const object of objects ?? []) {
|
|
2281
|
+
const write = object?.id ? this.lastWrites.get(object.id) : undefined;
|
|
2282
|
+
if (!write) {
|
|
2283
|
+
continue;
|
|
2284
|
+
}
|
|
2285
|
+
// updatedAt is returned with every POI, though the POI type does not declare it.
|
|
2286
|
+
const loaded = object.pois?.items?.[0];
|
|
2287
|
+
const written = write.poi;
|
|
2288
|
+
// Written by someone else since: that one is the current POI.
|
|
2289
|
+
if (loaded && (loaded.updatedAt ?? '') > (written.updatedAt ?? '')) {
|
|
2290
|
+
continue;
|
|
2291
|
+
}
|
|
2292
|
+
object.pois = { ...object.pois, items: write.deleted ? [] : [write.poi] };
|
|
2293
|
+
}
|
|
2294
|
+
return objects;
|
|
2223
2295
|
}
|
|
2224
2296
|
async getPoisByMatterportSweepByType(sweep, type) {
|
|
2225
2297
|
return this.API.ListPOIS({ matterportSweepID: { eq: sweep } }, 300)
|
|
@@ -2242,32 +2314,32 @@ class PoiService {
|
|
|
2242
2314
|
if (!sweeps || sweeps.length === 0) {
|
|
2243
2315
|
return [];
|
|
2244
2316
|
}
|
|
2245
|
-
const queryStatement = `
|
|
2246
|
-
query ListPOISLight($filter: ModelPOIFilterInput, $limit: Int, $nextToken: String) {
|
|
2247
|
-
listPOIS(filter: $filter, limit: $limit, nextToken: $nextToken) {
|
|
2248
|
-
items {
|
|
2249
|
-
id
|
|
2250
|
-
coordinate
|
|
2251
|
-
specific
|
|
2252
|
-
private
|
|
2253
|
-
global
|
|
2254
|
-
type
|
|
2255
|
-
elementID
|
|
2256
|
-
level
|
|
2257
|
-
role
|
|
2258
|
-
category
|
|
2259
|
-
domainID
|
|
2260
|
-
metadata
|
|
2261
|
-
tagIcon
|
|
2262
|
-
tagDescription
|
|
2263
|
-
tagImageID
|
|
2264
|
-
matterportSweepID
|
|
2265
|
-
createdAt
|
|
2266
|
-
updatedAt
|
|
2267
|
-
}
|
|
2268
|
-
nextToken
|
|
2269
|
-
}
|
|
2270
|
-
}
|
|
2317
|
+
const queryStatement = `
|
|
2318
|
+
query ListPOISLight($filter: ModelPOIFilterInput, $limit: Int, $nextToken: String) {
|
|
2319
|
+
listPOIS(filter: $filter, limit: $limit, nextToken: $nextToken) {
|
|
2320
|
+
items {
|
|
2321
|
+
id
|
|
2322
|
+
coordinate
|
|
2323
|
+
specific
|
|
2324
|
+
private
|
|
2325
|
+
global
|
|
2326
|
+
type
|
|
2327
|
+
elementID
|
|
2328
|
+
level
|
|
2329
|
+
role
|
|
2330
|
+
category
|
|
2331
|
+
domainID
|
|
2332
|
+
metadata
|
|
2333
|
+
tagIcon
|
|
2334
|
+
tagDescription
|
|
2335
|
+
tagImageID
|
|
2336
|
+
matterportSweepID
|
|
2337
|
+
createdAt
|
|
2338
|
+
updatedAt
|
|
2339
|
+
}
|
|
2340
|
+
nextToken
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2271
2343
|
`;
|
|
2272
2344
|
const CHUNK_SIZE = 50; // safe margin for an "or" filter expression's practical size
|
|
2273
2345
|
const chunks = [];
|
|
@@ -3135,11 +3207,11 @@ class MatterportPointerService {
|
|
|
3135
3207
|
}
|
|
3136
3208
|
updateCursorDisplay(poseMatterport) {
|
|
3137
3209
|
if (this.textDisplayCursorPositionPanel && poseMatterport) {
|
|
3138
|
-
this.textDisplayCursorPositionPanel.innerHTML = `position:
|
|
3139
|
-
${pointToString(poseMatterport.position)}\n
|
|
3140
|
-
normal:
|
|
3141
|
-
${pointToString(poseMatterport.normal)}\n
|
|
3142
|
-
floorId:
|
|
3210
|
+
this.textDisplayCursorPositionPanel.innerHTML = `position:
|
|
3211
|
+
${pointToString(poseMatterport.position)}\n
|
|
3212
|
+
normal:
|
|
3213
|
+
${pointToString(poseMatterport.normal)}\n
|
|
3214
|
+
floorId:
|
|
3143
3215
|
${poseMatterport.floorId}`;
|
|
3144
3216
|
if (this.getCursorPositionButton) {
|
|
3145
3217
|
this.getCursorPositionButton.style.display = 'none';
|
|
@@ -5855,22 +5927,22 @@ class MatterportService {
|
|
|
5855
5927
|
);
|
|
5856
5928
|
}*/
|
|
5857
5929
|
addCustomCss() {
|
|
5858
|
-
const css = `
|
|
5859
|
-
.footer-ui,
|
|
5860
|
-
.showcase-footer,
|
|
5861
|
-
.mp-nova-btn-group,
|
|
5862
|
-
.footer-divider,
|
|
5863
|
-
.logo-link,
|
|
5864
|
-
.footer-logo,
|
|
5865
|
-
.bottom-ui,
|
|
5866
|
-
img.logo-image,
|
|
5867
|
-
img[class^="logo-image"],
|
|
5868
|
-
img[class*=" logo-image"],
|
|
5869
|
-
[data-testid="showcase-footer"] {
|
|
5870
|
-
opacity: 0 !important;
|
|
5871
|
-
visibility: hidden !important;
|
|
5872
|
-
pointer-events: none !important;
|
|
5873
|
-
}
|
|
5930
|
+
const css = `
|
|
5931
|
+
.footer-ui,
|
|
5932
|
+
.showcase-footer,
|
|
5933
|
+
.mp-nova-btn-group,
|
|
5934
|
+
.footer-divider,
|
|
5935
|
+
.logo-link,
|
|
5936
|
+
.footer-logo,
|
|
5937
|
+
.bottom-ui,
|
|
5938
|
+
img.logo-image,
|
|
5939
|
+
img[class^="logo-image"],
|
|
5940
|
+
img[class*=" logo-image"],
|
|
5941
|
+
[data-testid="showcase-footer"] {
|
|
5942
|
+
opacity: 0 !important;
|
|
5943
|
+
visibility: hidden !important;
|
|
5944
|
+
pointer-events: none !important;
|
|
5945
|
+
}
|
|
5874
5946
|
`;
|
|
5875
5947
|
// 1st method: Via Scene SDK
|
|
5876
5948
|
if (this.sdk?.Scene?.addStyle) {
|
|
@@ -11603,11 +11675,11 @@ class ModalSwitchVisitComponent {
|
|
|
11603
11675
|
});
|
|
11604
11676
|
}
|
|
11605
11677
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ModalSwitchVisitComponent, deps: [{ token: i1$2.NgbActiveModal }, { token: i1.Router }, { token: ViewerService }], target: i0.ɵɵFactoryTarget.Component });
|
|
11606
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ModalSwitchVisitComponent, selector: "lib-modal-switch-visit", inputs: { content: "content", model3D: "model3D", spaceID: "spaceID", dataToMove: "dataToMove" }, ngImport: i0, template: "<div class=\"modal-container\">\n <p>{{content}}</p>\n <button class=\"btn btn-outline-primary rounded-pill\" (click)=\"switchVisit()\">{{'Yes, switch visit' | translate }}</button>\n <button class=\"btn btn-outline-primary rounded-pill\"(click)=\"activeModal.close()\">{{'No, stay here' | translate }}</button>\n</div>\n", styles: [".modal-container{margin:10px}button{margin-right:8px}\n"], dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
11678
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ModalSwitchVisitComponent, selector: "lib-modal-switch-visit", inputs: { content: "content", model3D: "model3D", spaceID: "spaceID", dataToMove: "dataToMove" }, ngImport: i0, template: "<div class=\"modal-container\">\r\n <p>{{content}}</p>\r\n <button class=\"btn btn-outline-primary rounded-pill\" (click)=\"switchVisit()\">{{'Yes, switch visit' | translate }}</button>\r\n <button class=\"btn btn-outline-primary rounded-pill\"(click)=\"activeModal.close()\">{{'No, stay here' | translate }}</button>\r\n</div>\r\n", styles: [".modal-container{margin:10px}button{margin-right:8px}\n"], dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
11607
11679
|
}
|
|
11608
11680
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ModalSwitchVisitComponent, decorators: [{
|
|
11609
11681
|
type: Component,
|
|
11610
|
-
args: [{ selector: 'lib-modal-switch-visit', template: "<div class=\"modal-container\">\n <p>{{content}}</p>\n <button class=\"btn btn-outline-primary rounded-pill\" (click)=\"switchVisit()\">{{'Yes, switch visit' | translate }}</button>\n <button class=\"btn btn-outline-primary rounded-pill\"(click)=\"activeModal.close()\">{{'No, stay here' | translate }}</button>\n</div>\n", styles: [".modal-container{margin:10px}button{margin-right:8px}\n"] }]
|
|
11682
|
+
args: [{ selector: 'lib-modal-switch-visit', template: "<div class=\"modal-container\">\r\n <p>{{content}}</p>\r\n <button class=\"btn btn-outline-primary rounded-pill\" (click)=\"switchVisit()\">{{'Yes, switch visit' | translate }}</button>\r\n <button class=\"btn btn-outline-primary rounded-pill\"(click)=\"activeModal.close()\">{{'No, stay here' | translate }}</button>\r\n</div>\r\n", styles: [".modal-container{margin:10px}button{margin-right:8px}\n"] }]
|
|
11611
11683
|
}], ctorParameters: () => [{ type: i1$2.NgbActiveModal }, { type: i1.Router }, { type: ViewerService }], propDecorators: { content: [{
|
|
11612
11684
|
type: Input
|
|
11613
11685
|
}], model3D: [{
|
|
@@ -12228,11 +12300,11 @@ class CsvExportComponent {
|
|
|
12228
12300
|
link.remove();
|
|
12229
12301
|
}
|
|
12230
12302
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CsvExportComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12231
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CsvExportComponent, selector: "lib-csv-export", inputs: { headers: "headers", rowsInput: "rowsInput", getRows: "getRows", title: "title", buttonLabel: "buttonLabel" }, ngImport: i0, template: "<span [style.cursor]=\"'pointer'\" (click)=\"onClickDownload()\" class=\"download-csv d-flex\">\n <span class=\"iconify\" [icIcon]=\"fileDownloadIcon\"></span>\n {{ buttonLabel | translate}}\n</span>\n", styles: [".download-csv{color:var(--smarterplan-primary)}\n"], dependencies: [{ kind: "directive", type: i1$3.IconDirective, selector: "ic-icon,[icIcon]", inputs: ["icIcon", "icon", "color", "inline", "box", "size", "width", "height", "align", "hFlip", "vFlip", "flip", "rotate"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
12303
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CsvExportComponent, selector: "lib-csv-export", inputs: { headers: "headers", rowsInput: "rowsInput", getRows: "getRows", title: "title", buttonLabel: "buttonLabel" }, ngImport: i0, template: "<span [style.cursor]=\"'pointer'\" (click)=\"onClickDownload()\" class=\"download-csv d-flex\">\r\n <span class=\"iconify\" [icIcon]=\"fileDownloadIcon\"></span>\r\n {{ buttonLabel | translate}}\r\n</span>\r\n", styles: [".download-csv{color:var(--smarterplan-primary)}\n"], dependencies: [{ kind: "directive", type: i1$3.IconDirective, selector: "ic-icon,[icIcon]", inputs: ["icIcon", "icon", "color", "inline", "box", "size", "width", "height", "align", "hFlip", "vFlip", "flip", "rotate"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
12232
12304
|
}
|
|
12233
12305
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CsvExportComponent, decorators: [{
|
|
12234
12306
|
type: Component,
|
|
12235
|
-
args: [{ selector: 'lib-csv-export', template: "<span [style.cursor]=\"'pointer'\" (click)=\"onClickDownload()\" class=\"download-csv d-flex\">\n <span class=\"iconify\" [icIcon]=\"fileDownloadIcon\"></span>\n {{ buttonLabel | translate}}\n</span>\n", styles: [".download-csv{color:var(--smarterplan-primary)}\n"] }]
|
|
12307
|
+
args: [{ selector: 'lib-csv-export', template: "<span [style.cursor]=\"'pointer'\" (click)=\"onClickDownload()\" class=\"download-csv d-flex\">\r\n <span class=\"iconify\" [icIcon]=\"fileDownloadIcon\"></span>\r\n {{ buttonLabel | translate}}\r\n</span>\r\n", styles: [".download-csv{color:var(--smarterplan-primary)}\n"] }]
|
|
12236
12308
|
}], propDecorators: { headers: [{
|
|
12237
12309
|
type: Input
|
|
12238
12310
|
}], rowsInput: [{
|
|
@@ -12499,6 +12571,21 @@ class FilterService {
|
|
|
12499
12571
|
}));
|
|
12500
12572
|
return filteredObjects;
|
|
12501
12573
|
}
|
|
12574
|
+
/** Whether an object belongs to the zone, by the same rule as filterObjectsForZone; true without a zone. */
|
|
12575
|
+
async isInZone(object, zoneID = null, zone = null) {
|
|
12576
|
+
if (!zoneID) {
|
|
12577
|
+
return true;
|
|
12578
|
+
}
|
|
12579
|
+
return (await this.filterObjectsForZone([object], zoneID, zone)).length > 0;
|
|
12580
|
+
}
|
|
12581
|
+
/**
|
|
12582
|
+
* A zone's list once one object's POI has changed: the objects of the space that were in it, in
|
|
12583
|
+
* the space's order, with that object in it or not as `inZone` says.
|
|
12584
|
+
*/
|
|
12585
|
+
zoneListAfterMove(space, zone, objectID, inZone) {
|
|
12586
|
+
const inZoneIDs = new Set((zone ?? []).map((object) => object.id));
|
|
12587
|
+
return (space ?? []).filter((object) => object.id === objectID ? inZone : inZoneIDs.has(object.id));
|
|
12588
|
+
}
|
|
12502
12589
|
filterEquipmentsByDomainList(equipments, domainIDList) {
|
|
12503
12590
|
let filtered = [];
|
|
12504
12591
|
const filteredByDomain = equipments.filter((equip) => domainIDList.includes(equip.domainID));
|
|
@@ -15123,6 +15210,8 @@ class TicketsService extends BaseObjectService {
|
|
|
15123
15210
|
floorsPerSpace = null;
|
|
15124
15211
|
selectedFloor = null;
|
|
15125
15212
|
destroy$ = new Subject();
|
|
15213
|
+
/** Counts the calls to initTickets, so that only the latest one publishes its lists. */
|
|
15214
|
+
initTicketsRun = 0;
|
|
15126
15215
|
constructor(awsKinesisAnalyticsInjected, apiInjected, operationService, eventService, affectationService, poiService, userService, navigatorService, filterService, interventionService, navigationService, visitService, viewerService, zoneChangeService, modalService) {
|
|
15127
15216
|
super(poiService, navigationService, visitService);
|
|
15128
15217
|
this.operationService = operationService;
|
|
@@ -15157,11 +15246,39 @@ class TicketsService extends BaseObjectService {
|
|
|
15157
15246
|
this.selectedFloor = floor;
|
|
15158
15247
|
}
|
|
15159
15248
|
});
|
|
15249
|
+
// A ticket belongs to the zone of its POI's sweep. The POI is written after the ticket - when it
|
|
15250
|
+
// is created, the refresh that addTicket triggers reads the ticket without it - and again
|
|
15251
|
+
// whenever its tag is moved: sort the ticket again with the POI the API returned.
|
|
15252
|
+
this.poiService.poiWritten
|
|
15253
|
+
.pipe(filter(({ poi }) => poi.type === PoiType.TICKET))
|
|
15254
|
+
.subscribe(({ poi }) => this.sortAgainIntoZone(poi.elementID).catch((e) => console.log(e.message)));
|
|
15255
|
+
}
|
|
15256
|
+
/** Moves a loaded ticket into or out of the current zone's list, as its last written POI says. */
|
|
15257
|
+
async sortAgainIntoZone(ticketID) {
|
|
15258
|
+
const ticket = this.currentTickets.space?.find((t) => t.id === ticketID);
|
|
15259
|
+
if (!ticket) {
|
|
15260
|
+
// Not loaded, or being loaded: the load puts the POI in through withLatestPois.
|
|
15261
|
+
return;
|
|
15262
|
+
}
|
|
15263
|
+
const zoneID = this.zoneIDFilter;
|
|
15264
|
+
this.poiService.withLatestPois([ticket]);
|
|
15265
|
+
const inZone = await this.filterService.isInZone(ticket, zoneID);
|
|
15266
|
+
// Another zone, or other lists, since: their load has sorted the ticket already.
|
|
15267
|
+
if (zoneID !== this.zoneIDFilter || !this.currentTickets.space?.includes(ticket)) {
|
|
15268
|
+
return;
|
|
15269
|
+
}
|
|
15270
|
+
this.currentTickets.zone = this.filterService.zoneListAfterMove(this.currentTickets.space, this.currentTickets.zone, ticketID, inZone);
|
|
15271
|
+
this.ticketTags.next(this.currentTickets.zone);
|
|
15272
|
+
this.ticketsUpdated.next(this.currentTickets);
|
|
15160
15273
|
}
|
|
15161
15274
|
async initTickets() {
|
|
15162
15275
|
if (this.userService.getSpModule() === SpModule.MUSEUM) {
|
|
15163
15276
|
return;
|
|
15164
15277
|
}
|
|
15278
|
+
const run = ++this.initTicketsRun;
|
|
15279
|
+
// Calls overlap - one per change - and their requests can resolve in any order: a call that
|
|
15280
|
+
// started earlier would publish the tickets as they were before the change.
|
|
15281
|
+
const hasNewerCall = () => run !== this.initTicketsRun;
|
|
15165
15282
|
let ticketsFiltered = [];
|
|
15166
15283
|
if (this.currentSpaceID) {
|
|
15167
15284
|
this.updating.next(true);
|
|
@@ -15172,6 +15289,10 @@ class TicketsService extends BaseObjectService {
|
|
|
15172
15289
|
});
|
|
15173
15290
|
ticketsFiltered =
|
|
15174
15291
|
await this.filterService.filterTicketsForCurrentUserInSpace(ticketsFiltered, this.currentSpaceID);
|
|
15292
|
+
if (hasNewerCall()) {
|
|
15293
|
+
return;
|
|
15294
|
+
}
|
|
15295
|
+
this.poiService.withLatestPois(ticketsFiltered);
|
|
15175
15296
|
// @ts-ignore
|
|
15176
15297
|
if (this.dateFilter && this.dateFilter[0] != "Invalid Date" && this.dateFilter[1] != "Invalid Date") {
|
|
15177
15298
|
ticketsFiltered = this.filterService.filterObjectsForDateRange(ticketsFiltered, this.dateFilter);
|
|
@@ -15180,10 +15301,14 @@ class TicketsService extends BaseObjectService {
|
|
|
15180
15301
|
if (this.ticketTypeFilter) {
|
|
15181
15302
|
ticketsFiltered = ticketsFiltered.filter((ticket) => this.ticketTypeFilter.includes(ticket.type));
|
|
15182
15303
|
}
|
|
15183
|
-
|
|
15304
|
+
const ticketsSpace = ticketsFiltered;
|
|
15184
15305
|
if (this.zoneIDFilter) {
|
|
15185
15306
|
ticketsFiltered = await this.filterService.filterObjectsForZone(ticketsFiltered, this.zoneIDFilter);
|
|
15186
15307
|
}
|
|
15308
|
+
if (hasNewerCall()) {
|
|
15309
|
+
return;
|
|
15310
|
+
}
|
|
15311
|
+
this.currentTickets.space = ticketsSpace;
|
|
15187
15312
|
this.currentTickets.zone = ticketsFiltered;
|
|
15188
15313
|
this.ticketTags.next(ticketsFiltered);
|
|
15189
15314
|
this.ticketsUpdated.next(this.currentTickets);
|
|
@@ -15191,6 +15316,8 @@ class TicketsService extends BaseObjectService {
|
|
|
15191
15316
|
}
|
|
15192
15317
|
else {
|
|
15193
15318
|
this.ticketTags.next(null);
|
|
15319
|
+
// An earlier call may have started loading, and it now leaves the result to this one.
|
|
15320
|
+
this.updating.next(false);
|
|
15194
15321
|
}
|
|
15195
15322
|
}
|
|
15196
15323
|
async adaptTicket(ticket) {
|
|
@@ -15669,6 +15796,8 @@ class EquipmentService extends BaseObjectService {
|
|
|
15669
15796
|
awsKinesisAnalytics; //AWS
|
|
15670
15797
|
isMuseumUser = false;
|
|
15671
15798
|
destroy$ = new Subject();
|
|
15799
|
+
/** Counts the calls to initEquips, so that only the latest one publishes its lists. */
|
|
15800
|
+
initEquipsRun = 0;
|
|
15672
15801
|
constructor(apiInjected, awsKinesisAnalyticsInjected, poiService, navigationService, visitService, operationService, ticketsService, navigatorService, filterService, userService, viewerService, modalService, zoneChangeService) {
|
|
15673
15802
|
super(poiService, navigationService, visitService);
|
|
15674
15803
|
this.operationService = operationService;
|
|
@@ -15697,6 +15826,32 @@ class EquipmentService extends BaseObjectService {
|
|
|
15697
15826
|
this.selectedFloor = floor;
|
|
15698
15827
|
}
|
|
15699
15828
|
});
|
|
15829
|
+
// An equipment belongs to the zone of its POI's sweep: when its tag moves, sort it again with
|
|
15830
|
+
// the POI the API returned.
|
|
15831
|
+
this.poiService.poiWritten
|
|
15832
|
+
.pipe(filter(({ poi }) => poi.type === PoiType.EQUIPMENT))
|
|
15833
|
+
.subscribe(({ poi }) => this.sortAgainIntoZone(poi.elementID).catch((e) => console.log(e.message)));
|
|
15834
|
+
}
|
|
15835
|
+
/** Moves a loaded equipment into or out of the current zone's list, as its last written POI says. */
|
|
15836
|
+
async sortAgainIntoZone(equipmentID) {
|
|
15837
|
+
const equipment = this.currentEquipments.space?.find((e) => e.id === equipmentID);
|
|
15838
|
+
if (!equipment) {
|
|
15839
|
+
// Not loaded, or being loaded: the load puts the POI in through withLatestPois.
|
|
15840
|
+
return;
|
|
15841
|
+
}
|
|
15842
|
+
const zoneID = this.zoneIDFilter;
|
|
15843
|
+
this.poiService.withLatestPois([equipment]);
|
|
15844
|
+
const inZone = await this.filterService.isInZone(equipment, zoneID, this.currentZone);
|
|
15845
|
+
// Another zone, or other lists, since: their load has sorted the equipment already.
|
|
15846
|
+
if (zoneID !== this.zoneIDFilter || !this.currentEquipments.space?.includes(equipment)) {
|
|
15847
|
+
return;
|
|
15848
|
+
}
|
|
15849
|
+
const zone = this.filterService.zoneListAfterMove(this.currentEquipments.space, this.currentEquipments.zonesMap.get(zoneID), equipmentID, inZone);
|
|
15850
|
+
// The lists kept for the other zones may hold it or miss it now: they are sorted again from
|
|
15851
|
+
// the space's list when the user goes back to them.
|
|
15852
|
+
this.currentEquipments.zonesMap = new Map([[zoneID, zone]]);
|
|
15853
|
+
this.equipmentsTags.next(zone);
|
|
15854
|
+
this.equipmentsUpdated.next({ space: this.currentEquipments.space, zone });
|
|
15700
15855
|
}
|
|
15701
15856
|
async readEquipment(id) {
|
|
15702
15857
|
return this.API.__proto__.GetEquipment(id).then(async (receivedEquip) => {
|
|
@@ -16029,10 +16184,18 @@ class EquipmentService extends BaseObjectService {
|
|
|
16029
16184
|
if (!this.currentSpaceID || this.userService.getSpModule() === SpModule.MUSEUM) {
|
|
16030
16185
|
return;
|
|
16031
16186
|
}
|
|
16187
|
+
const run = ++this.initEquipsRun;
|
|
16188
|
+
// Calls overlap - one per change - and their requests can resolve in any order: a call that
|
|
16189
|
+
// started earlier would publish the equipments as they were before the change.
|
|
16190
|
+
const hasNewerCall = () => run !== this.initEquipsRun;
|
|
16032
16191
|
this.updating.next(true);
|
|
16033
16192
|
this.currentlyUpdating = true;
|
|
16034
16193
|
let eqList = await this.getEquipmentsForSpace(this.currentSpaceID);
|
|
16035
16194
|
eqList = await this.filterService.filterEquipmentsForCurrentUserInSpace(this.currentSpaceID, eqList);
|
|
16195
|
+
if (hasNewerCall()) {
|
|
16196
|
+
return;
|
|
16197
|
+
}
|
|
16198
|
+
this.poiService.withLatestPois(eqList);
|
|
16036
16199
|
// console.log(eqList);
|
|
16037
16200
|
if (eqList.length > 0) {
|
|
16038
16201
|
let filteredEquips = eqList.filter((equipment) => !this.isArchived(equipment));
|
|
@@ -16040,14 +16203,21 @@ class EquipmentService extends BaseObjectService {
|
|
|
16040
16203
|
equip.documentationImageUrlSigned =
|
|
16041
16204
|
await getSignedImageUrlForEquipment(equip);
|
|
16042
16205
|
}));
|
|
16206
|
+
if (hasNewerCall()) {
|
|
16207
|
+
return;
|
|
16208
|
+
}
|
|
16043
16209
|
this.equipmentsUnfiltered.next(filteredEquips);
|
|
16044
16210
|
if (this.equipmentDomainFilter) {
|
|
16045
16211
|
filteredEquips = this.filterService.filterEquipmentsByDomainList(filteredEquips, this.equipmentDomainFilter);
|
|
16046
16212
|
}
|
|
16047
|
-
|
|
16213
|
+
const equipsSpace = filteredEquips;
|
|
16048
16214
|
if (this.zoneIDFilter) {
|
|
16049
16215
|
filteredEquips = (await this.filterService.filterObjectsForZone(filteredEquips, this.zoneIDFilter, this.currentZone));
|
|
16050
16216
|
}
|
|
16217
|
+
if (hasNewerCall()) {
|
|
16218
|
+
return;
|
|
16219
|
+
}
|
|
16220
|
+
this.currentEquipments.space = equipsSpace;
|
|
16051
16221
|
this.currentEquipments.zonesMap.set(this.zoneIDFilter, filteredEquips);
|
|
16052
16222
|
this.equipmentsTags.next(filteredEquips); // adding tags only for the current zone
|
|
16053
16223
|
this.equipmentsUpdated.next({
|
|
@@ -16538,11 +16708,11 @@ class SearchBarComponent {
|
|
|
16538
16708
|
this.searchEvent.emit(results);
|
|
16539
16709
|
}
|
|
16540
16710
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchBarComponent, deps: [{ token: SearchService }], target: i0.ɵɵFactoryTarget.Component });
|
|
16541
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchBarComponent, selector: "lib-search-bar", inputs: { searchable: "searchable", objectType: "objectType" }, outputs: { searchEvent: "searchEvent" }, ngImport: i0, template: "<div class=\"col-md-8 searchbar\">\n <div class=\"row depend\">\n <div class=\"col-md-5\">\n <input id=\"searchbar\" type=\"text\" class=\"form-control\" placeholder=\"keyword\" />\n </div>\n <div class=\"col-md-5\">\n <button class=\"btn btn-outline-primary rounded-pill\" (click)=\"onSubmit()\">{{ 'Search' |\n translate}}</button>\n </div>\n </div>\n</div>", styles: [".searchbar{margin-bottom:10px}\n"], dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
16711
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchBarComponent, selector: "lib-search-bar", inputs: { searchable: "searchable", objectType: "objectType" }, outputs: { searchEvent: "searchEvent" }, ngImport: i0, template: "<div class=\"col-md-8 searchbar\">\r\n <div class=\"row depend\">\r\n <div class=\"col-md-5\">\r\n <input id=\"searchbar\" type=\"text\" class=\"form-control\" placeholder=\"keyword\" />\r\n </div>\r\n <div class=\"col-md-5\">\r\n <button class=\"btn btn-outline-primary rounded-pill\" (click)=\"onSubmit()\">{{ 'Search' |\r\n translate}}</button>\r\n </div>\r\n </div>\r\n</div>", styles: [".searchbar{margin-bottom:10px}\n"], dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
16542
16712
|
}
|
|
16543
16713
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchBarComponent, decorators: [{
|
|
16544
16714
|
type: Component,
|
|
16545
|
-
args: [{ selector: 'lib-search-bar', template: "<div class=\"col-md-8 searchbar\">\n <div class=\"row depend\">\n <div class=\"col-md-5\">\n <input id=\"searchbar\" type=\"text\" class=\"form-control\" placeholder=\"keyword\" />\n </div>\n <div class=\"col-md-5\">\n <button class=\"btn btn-outline-primary rounded-pill\" (click)=\"onSubmit()\">{{ 'Search' |\n translate}}</button>\n </div>\n </div>\n</div>", styles: [".searchbar{margin-bottom:10px}\n"] }]
|
|
16715
|
+
args: [{ selector: 'lib-search-bar', template: "<div class=\"col-md-8 searchbar\">\r\n <div class=\"row depend\">\r\n <div class=\"col-md-5\">\r\n <input id=\"searchbar\" type=\"text\" class=\"form-control\" placeholder=\"keyword\" />\r\n </div>\r\n <div class=\"col-md-5\">\r\n <button class=\"btn btn-outline-primary rounded-pill\" (click)=\"onSubmit()\">{{ 'Search' |\r\n translate}}</button>\r\n </div>\r\n </div>\r\n</div>", styles: [".searchbar{margin-bottom:10px}\n"] }]
|
|
16546
16716
|
}], ctorParameters: () => [{ type: SearchService }], propDecorators: { searchable: [{
|
|
16547
16717
|
type: Input
|
|
16548
16718
|
}], objectType: [{
|
|
@@ -16990,11 +17160,11 @@ class LoaderComponent {
|
|
|
16990
17160
|
document.documentElement.style.setProperty('--color', this.color);
|
|
16991
17161
|
}
|
|
16992
17162
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
16993
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LoaderComponent, selector: "lib-loader", inputs: { useLogo: "useLogo", color: "color" }, ngImport: i0, template: "<div class=\"sk-fading-circle\">\n <img *ngIf=\"useLogo\" src=\"../../../../assets/icons/smarterplan.svg\">\n <div class=\"sk-circle1 sk-circle\"></div>\n <div class=\"sk-circle2 sk-circle\"></div>\n <div class=\"sk-circle3 sk-circle\"></div>\n <div class=\"sk-circle4 sk-circle\"></div>\n <div class=\"sk-circle5 sk-circle\"></div>\n <div class=\"sk-circle6 sk-circle\"></div>\n <div class=\"sk-circle7 sk-circle\"></div>\n <div class=\"sk-circle8 sk-circle\"></div>\n <div class=\"sk-circle9 sk-circle\"></div>\n <div class=\"sk-circle10 sk-circle\"></div>\n <div class=\"sk-circle11 sk-circle\"></div>\n <div class=\"sk-circle12 sk-circle\"></div>\n</div>\n", styles: [".sk-fading-circle{width:88px;height:88px;position:relative}.sk-fading-circle img{width:2rem;position:absolute;left:calc(50% - 16px);top:calc(50% - 16px)}.sk-fading-circle .sk-circle{width:100%;height:100%;position:absolute;left:0;top:0}.sk-fading-circle .sk-circle:before{content:\"\";display:block;margin:0 auto;width:15%;height:15%;background-color:var(--color);border-radius:100%;-webkit-animation:sk-circleFadeDelay 1.2s infinite ease-in-out both;animation:sk-circleFadeDelay 1.2s infinite ease-in-out both}.sk-fading-circle .sk-circle2{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg)}.sk-fading-circle .sk-circle3{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}.sk-fading-circle .sk-circle4{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.sk-fading-circle .sk-circle5{-webkit-transform:rotate(120deg);-ms-transform:rotate(120deg);transform:rotate(120deg)}.sk-fading-circle .sk-circle6{-webkit-transform:rotate(150deg);-ms-transform:rotate(150deg);transform:rotate(150deg)}.sk-fading-circle .sk-circle7{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sk-fading-circle .sk-circle8{-webkit-transform:rotate(210deg);-ms-transform:rotate(210deg);transform:rotate(210deg)}.sk-fading-circle .sk-circle9{-webkit-transform:rotate(240deg);-ms-transform:rotate(240deg);transform:rotate(240deg)}.sk-fading-circle .sk-circle10{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sk-fading-circle .sk-circle11{-webkit-transform:rotate(300deg);-ms-transform:rotate(300deg);transform:rotate(300deg)}.sk-fading-circle .sk-circle12{-webkit-transform:rotate(330deg);-ms-transform:rotate(330deg);transform:rotate(330deg)}.sk-fading-circle .sk-circle2:before{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.sk-fading-circle .sk-circle3:before{-webkit-animation-delay:-1s;animation-delay:-1s}.sk-fading-circle .sk-circle4:before{-webkit-animation-delay:-.9s;animation-delay:-.9s}.sk-fading-circle .sk-circle5:before{-webkit-animation-delay:-.8s;animation-delay:-.8s}.sk-fading-circle .sk-circle6:before{-webkit-animation-delay:-.7s;animation-delay:-.7s}.sk-fading-circle .sk-circle7:before{-webkit-animation-delay:-.6s;animation-delay:-.6s}.sk-fading-circle .sk-circle8:before{-webkit-animation-delay:-.5s;animation-delay:-.5s}.sk-fading-circle .sk-circle9:before{-webkit-animation-delay:-.4s;animation-delay:-.4s}.sk-fading-circle .sk-circle10:before{-webkit-animation-delay:-.3s;animation-delay:-.3s}.sk-fading-circle .sk-circle11:before{-webkit-animation-delay:-.2s;animation-delay:-.2s}.sk-fading-circle .sk-circle12:before{-webkit-animation-delay:-.1s;animation-delay:-.1s}@-webkit-keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}@keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
17163
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LoaderComponent, selector: "lib-loader", inputs: { useLogo: "useLogo", color: "color" }, ngImport: i0, template: "<div class=\"sk-fading-circle\">\r\n <img *ngIf=\"useLogo\" src=\"../../../../assets/icons/smarterplan.svg\">\r\n <div class=\"sk-circle1 sk-circle\"></div>\r\n <div class=\"sk-circle2 sk-circle\"></div>\r\n <div class=\"sk-circle3 sk-circle\"></div>\r\n <div class=\"sk-circle4 sk-circle\"></div>\r\n <div class=\"sk-circle5 sk-circle\"></div>\r\n <div class=\"sk-circle6 sk-circle\"></div>\r\n <div class=\"sk-circle7 sk-circle\"></div>\r\n <div class=\"sk-circle8 sk-circle\"></div>\r\n <div class=\"sk-circle9 sk-circle\"></div>\r\n <div class=\"sk-circle10 sk-circle\"></div>\r\n <div class=\"sk-circle11 sk-circle\"></div>\r\n <div class=\"sk-circle12 sk-circle\"></div>\r\n</div>\r\n", styles: [".sk-fading-circle{width:88px;height:88px;position:relative}.sk-fading-circle img{width:2rem;position:absolute;left:calc(50% - 16px);top:calc(50% - 16px)}.sk-fading-circle .sk-circle{width:100%;height:100%;position:absolute;left:0;top:0}.sk-fading-circle .sk-circle:before{content:\"\";display:block;margin:0 auto;width:15%;height:15%;background-color:var(--color);border-radius:100%;-webkit-animation:sk-circleFadeDelay 1.2s infinite ease-in-out both;animation:sk-circleFadeDelay 1.2s infinite ease-in-out both}.sk-fading-circle .sk-circle2{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg)}.sk-fading-circle .sk-circle3{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}.sk-fading-circle .sk-circle4{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.sk-fading-circle .sk-circle5{-webkit-transform:rotate(120deg);-ms-transform:rotate(120deg);transform:rotate(120deg)}.sk-fading-circle .sk-circle6{-webkit-transform:rotate(150deg);-ms-transform:rotate(150deg);transform:rotate(150deg)}.sk-fading-circle .sk-circle7{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sk-fading-circle .sk-circle8{-webkit-transform:rotate(210deg);-ms-transform:rotate(210deg);transform:rotate(210deg)}.sk-fading-circle .sk-circle9{-webkit-transform:rotate(240deg);-ms-transform:rotate(240deg);transform:rotate(240deg)}.sk-fading-circle .sk-circle10{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sk-fading-circle .sk-circle11{-webkit-transform:rotate(300deg);-ms-transform:rotate(300deg);transform:rotate(300deg)}.sk-fading-circle .sk-circle12{-webkit-transform:rotate(330deg);-ms-transform:rotate(330deg);transform:rotate(330deg)}.sk-fading-circle .sk-circle2:before{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.sk-fading-circle .sk-circle3:before{-webkit-animation-delay:-1s;animation-delay:-1s}.sk-fading-circle .sk-circle4:before{-webkit-animation-delay:-.9s;animation-delay:-.9s}.sk-fading-circle .sk-circle5:before{-webkit-animation-delay:-.8s;animation-delay:-.8s}.sk-fading-circle .sk-circle6:before{-webkit-animation-delay:-.7s;animation-delay:-.7s}.sk-fading-circle .sk-circle7:before{-webkit-animation-delay:-.6s;animation-delay:-.6s}.sk-fading-circle .sk-circle8:before{-webkit-animation-delay:-.5s;animation-delay:-.5s}.sk-fading-circle .sk-circle9:before{-webkit-animation-delay:-.4s;animation-delay:-.4s}.sk-fading-circle .sk-circle10:before{-webkit-animation-delay:-.3s;animation-delay:-.3s}.sk-fading-circle .sk-circle11:before{-webkit-animation-delay:-.2s;animation-delay:-.2s}.sk-fading-circle .sk-circle12:before{-webkit-animation-delay:-.1s;animation-delay:-.1s}@-webkit-keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}@keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
16994
17164
|
}
|
|
16995
17165
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoaderComponent, decorators: [{
|
|
16996
17166
|
type: Component,
|
|
16997
|
-
args: [{ selector: 'lib-loader', template: "<div class=\"sk-fading-circle\">\n <img *ngIf=\"useLogo\" src=\"../../../../assets/icons/smarterplan.svg\">\n <div class=\"sk-circle1 sk-circle\"></div>\n <div class=\"sk-circle2 sk-circle\"></div>\n <div class=\"sk-circle3 sk-circle\"></div>\n <div class=\"sk-circle4 sk-circle\"></div>\n <div class=\"sk-circle5 sk-circle\"></div>\n <div class=\"sk-circle6 sk-circle\"></div>\n <div class=\"sk-circle7 sk-circle\"></div>\n <div class=\"sk-circle8 sk-circle\"></div>\n <div class=\"sk-circle9 sk-circle\"></div>\n <div class=\"sk-circle10 sk-circle\"></div>\n <div class=\"sk-circle11 sk-circle\"></div>\n <div class=\"sk-circle12 sk-circle\"></div>\n</div>\n", styles: [".sk-fading-circle{width:88px;height:88px;position:relative}.sk-fading-circle img{width:2rem;position:absolute;left:calc(50% - 16px);top:calc(50% - 16px)}.sk-fading-circle .sk-circle{width:100%;height:100%;position:absolute;left:0;top:0}.sk-fading-circle .sk-circle:before{content:\"\";display:block;margin:0 auto;width:15%;height:15%;background-color:var(--color);border-radius:100%;-webkit-animation:sk-circleFadeDelay 1.2s infinite ease-in-out both;animation:sk-circleFadeDelay 1.2s infinite ease-in-out both}.sk-fading-circle .sk-circle2{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg)}.sk-fading-circle .sk-circle3{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}.sk-fading-circle .sk-circle4{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.sk-fading-circle .sk-circle5{-webkit-transform:rotate(120deg);-ms-transform:rotate(120deg);transform:rotate(120deg)}.sk-fading-circle .sk-circle6{-webkit-transform:rotate(150deg);-ms-transform:rotate(150deg);transform:rotate(150deg)}.sk-fading-circle .sk-circle7{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sk-fading-circle .sk-circle8{-webkit-transform:rotate(210deg);-ms-transform:rotate(210deg);transform:rotate(210deg)}.sk-fading-circle .sk-circle9{-webkit-transform:rotate(240deg);-ms-transform:rotate(240deg);transform:rotate(240deg)}.sk-fading-circle .sk-circle10{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sk-fading-circle .sk-circle11{-webkit-transform:rotate(300deg);-ms-transform:rotate(300deg);transform:rotate(300deg)}.sk-fading-circle .sk-circle12{-webkit-transform:rotate(330deg);-ms-transform:rotate(330deg);transform:rotate(330deg)}.sk-fading-circle .sk-circle2:before{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.sk-fading-circle .sk-circle3:before{-webkit-animation-delay:-1s;animation-delay:-1s}.sk-fading-circle .sk-circle4:before{-webkit-animation-delay:-.9s;animation-delay:-.9s}.sk-fading-circle .sk-circle5:before{-webkit-animation-delay:-.8s;animation-delay:-.8s}.sk-fading-circle .sk-circle6:before{-webkit-animation-delay:-.7s;animation-delay:-.7s}.sk-fading-circle .sk-circle7:before{-webkit-animation-delay:-.6s;animation-delay:-.6s}.sk-fading-circle .sk-circle8:before{-webkit-animation-delay:-.5s;animation-delay:-.5s}.sk-fading-circle .sk-circle9:before{-webkit-animation-delay:-.4s;animation-delay:-.4s}.sk-fading-circle .sk-circle10:before{-webkit-animation-delay:-.3s;animation-delay:-.3s}.sk-fading-circle .sk-circle11:before{-webkit-animation-delay:-.2s;animation-delay:-.2s}.sk-fading-circle .sk-circle12:before{-webkit-animation-delay:-.1s;animation-delay:-.1s}@-webkit-keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}@keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}\n"] }]
|
|
17167
|
+
args: [{ selector: 'lib-loader', template: "<div class=\"sk-fading-circle\">\r\n <img *ngIf=\"useLogo\" src=\"../../../../assets/icons/smarterplan.svg\">\r\n <div class=\"sk-circle1 sk-circle\"></div>\r\n <div class=\"sk-circle2 sk-circle\"></div>\r\n <div class=\"sk-circle3 sk-circle\"></div>\r\n <div class=\"sk-circle4 sk-circle\"></div>\r\n <div class=\"sk-circle5 sk-circle\"></div>\r\n <div class=\"sk-circle6 sk-circle\"></div>\r\n <div class=\"sk-circle7 sk-circle\"></div>\r\n <div class=\"sk-circle8 sk-circle\"></div>\r\n <div class=\"sk-circle9 sk-circle\"></div>\r\n <div class=\"sk-circle10 sk-circle\"></div>\r\n <div class=\"sk-circle11 sk-circle\"></div>\r\n <div class=\"sk-circle12 sk-circle\"></div>\r\n</div>\r\n", styles: [".sk-fading-circle{width:88px;height:88px;position:relative}.sk-fading-circle img{width:2rem;position:absolute;left:calc(50% - 16px);top:calc(50% - 16px)}.sk-fading-circle .sk-circle{width:100%;height:100%;position:absolute;left:0;top:0}.sk-fading-circle .sk-circle:before{content:\"\";display:block;margin:0 auto;width:15%;height:15%;background-color:var(--color);border-radius:100%;-webkit-animation:sk-circleFadeDelay 1.2s infinite ease-in-out both;animation:sk-circleFadeDelay 1.2s infinite ease-in-out both}.sk-fading-circle .sk-circle2{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg)}.sk-fading-circle .sk-circle3{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}.sk-fading-circle .sk-circle4{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.sk-fading-circle .sk-circle5{-webkit-transform:rotate(120deg);-ms-transform:rotate(120deg);transform:rotate(120deg)}.sk-fading-circle .sk-circle6{-webkit-transform:rotate(150deg);-ms-transform:rotate(150deg);transform:rotate(150deg)}.sk-fading-circle .sk-circle7{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sk-fading-circle .sk-circle8{-webkit-transform:rotate(210deg);-ms-transform:rotate(210deg);transform:rotate(210deg)}.sk-fading-circle .sk-circle9{-webkit-transform:rotate(240deg);-ms-transform:rotate(240deg);transform:rotate(240deg)}.sk-fading-circle .sk-circle10{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sk-fading-circle .sk-circle11{-webkit-transform:rotate(300deg);-ms-transform:rotate(300deg);transform:rotate(300deg)}.sk-fading-circle .sk-circle12{-webkit-transform:rotate(330deg);-ms-transform:rotate(330deg);transform:rotate(330deg)}.sk-fading-circle .sk-circle2:before{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.sk-fading-circle .sk-circle3:before{-webkit-animation-delay:-1s;animation-delay:-1s}.sk-fading-circle .sk-circle4:before{-webkit-animation-delay:-.9s;animation-delay:-.9s}.sk-fading-circle .sk-circle5:before{-webkit-animation-delay:-.8s;animation-delay:-.8s}.sk-fading-circle .sk-circle6:before{-webkit-animation-delay:-.7s;animation-delay:-.7s}.sk-fading-circle .sk-circle7:before{-webkit-animation-delay:-.6s;animation-delay:-.6s}.sk-fading-circle .sk-circle8:before{-webkit-animation-delay:-.5s;animation-delay:-.5s}.sk-fading-circle .sk-circle9:before{-webkit-animation-delay:-.4s;animation-delay:-.4s}.sk-fading-circle .sk-circle10:before{-webkit-animation-delay:-.3s;animation-delay:-.3s}.sk-fading-circle .sk-circle11:before{-webkit-animation-delay:-.2s;animation-delay:-.2s}.sk-fading-circle .sk-circle12:before{-webkit-animation-delay:-.1s;animation-delay:-.1s}@-webkit-keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}@keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}\n"] }]
|
|
16998
17168
|
}], ctorParameters: () => [], propDecorators: { useLogo: [{
|
|
16999
17169
|
type: Input
|
|
17000
17170
|
}], color: [{
|
|
@@ -17052,11 +17222,11 @@ class SupportModalComponent {
|
|
|
17052
17222
|
}
|
|
17053
17223
|
}
|
|
17054
17224
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SupportModalComponent, deps: [{ token: SupportService }, { token: i1$2.NgbActiveModal }, { token: i3.UntypedFormBuilder }, { token: BaseUserService }, { token: ValidatorsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
17055
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SupportModalComponent, selector: "app-support-modal", ngImport: i0, template: "<div class=\"modal-header\">\n <h5 class=\"modal-title\" translate=\"Help\"></h5>\n</div>\n<div class=\"modal-body\">\n <div class=\"support-loader-container\">\n <lib-loader *ngIf=\"loading\"></lib-loader>\n </div>\n <form (ngSubmit)=\"onSubmit()\" [formGroup]=\"supportForm\" style=\"margin-top:1rem;\" *ngIf=\"!loading && status==='new'\">\n <div>\n <label>{{'Title' | translate}} *</label>\n <div>\n <input type=\"text\" class=\"form-control\" formControlName=\"title\" data-testid=\"new-support-title\"\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['title'])}\"\n maxlength=\"255\">\n </div>\n <div class=\"invalid-feedback\">\n <span data-testid=\"new-support-title-invalid\" [translate]=\"validatorsService.getError(supportForm.controls['title'])\"\n *ngIf=\" validatorsService.isControlError(supportForm.controls['title'])\"></span>\n </div>\n </div>\n <div *ngIf=\"!currentUser\">\n <label>{{'Email' | translate}} *</label>\n <div>\n <input type=\"email\" class=\"form-control\" formControlName=\"email\" data-testid=\"new-support-email\"\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['email'])}\"\n maxlength=\"255\">\n </div>\n <div class=\"invalid-feedback\">\n <span data-testid=\"new-support-email-invalid\" [translate]=\"validatorsService.getError(supportForm.controls['email'])\"\n *ngIf=\" validatorsService.isControlError(supportForm.controls['email'])\"></span>\n </div>\n </div>\n <div>\n <label>{{'Description' | translate}} *</label>\n <div>\n <textarea formControlName=\"description\" class=\"form-control\"\n data-testid=\"new-support-description\"\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['description'])}\"></textarea>\n </div>\n <div class=\"invalid-feedback\" >\n <span data-testid=\"new-support-description-invalid\" [translate]=\" validatorsService.getError(supportForm.controls['description'])\"\n *ngIf=\"validatorsService.isControlError(supportForm.controls['description'])\"></span>\n </div>\n </div>\n </form>\n\n <div *ngIf=\"status ==='send'\" translate=\"Your request has been registered\" data-testid=\"new-support-send-info\">\n </div>\n <div *ngIf=\"status ==='error'\" translate=\"An error has occurred, please renew your request\"\n data-testid=\"new-support-error-info\">\n\n </div>\n</div>\n<div class=\"modal-footer\">\n <button type=\"button\" class=\"btn rounded-pill btn-museum\" data-dismiss=\"modal\" translate=\"Close\" (click)=\"onClose()\"\n data-testid=\"new-support-close-btn\"></button>\n <button *ngIf=\"!loading && status==='new'\" type=\"button\" class=\"btn rounded-pill btn-museum\" translate=\"Submit\"\n (click)=\"onSubmit()\" [disabled]=\"!supportForm.valid\" data-testid=\"new-support-submit-btn\"></button>\n</div>", styles: [".support-loader-container{width:88px;margin:auto}.invalid-feedback{height:16px}\n"], dependencies: [{ kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "component", type: LoaderComponent, selector: "lib-loader", inputs: ["useLogo", "color"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
17225
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SupportModalComponent, selector: "app-support-modal", ngImport: i0, template: "<div class=\"modal-header\">\r\n <h5 class=\"modal-title\" translate=\"Help\"></h5>\r\n</div>\r\n<div class=\"modal-body\">\r\n <div class=\"support-loader-container\">\r\n <lib-loader *ngIf=\"loading\"></lib-loader>\r\n </div>\r\n <form (ngSubmit)=\"onSubmit()\" [formGroup]=\"supportForm\" style=\"margin-top:1rem;\" *ngIf=\"!loading && status==='new'\">\r\n <div>\r\n <label>{{'Title' | translate}} *</label>\r\n <div>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"title\" data-testid=\"new-support-title\"\r\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['title'])}\"\r\n maxlength=\"255\">\r\n </div>\r\n <div class=\"invalid-feedback\">\r\n <span data-testid=\"new-support-title-invalid\" [translate]=\"validatorsService.getError(supportForm.controls['title'])\"\r\n *ngIf=\" validatorsService.isControlError(supportForm.controls['title'])\"></span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"!currentUser\">\r\n <label>{{'Email' | translate}} *</label>\r\n <div>\r\n <input type=\"email\" class=\"form-control\" formControlName=\"email\" data-testid=\"new-support-email\"\r\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['email'])}\"\r\n maxlength=\"255\">\r\n </div>\r\n <div class=\"invalid-feedback\">\r\n <span data-testid=\"new-support-email-invalid\" [translate]=\"validatorsService.getError(supportForm.controls['email'])\"\r\n *ngIf=\" validatorsService.isControlError(supportForm.controls['email'])\"></span>\r\n </div>\r\n </div>\r\n <div>\r\n <label>{{'Description' | translate}} *</label>\r\n <div>\r\n <textarea formControlName=\"description\" class=\"form-control\"\r\n data-testid=\"new-support-description\"\r\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['description'])}\"></textarea>\r\n </div>\r\n <div class=\"invalid-feedback\" >\r\n <span data-testid=\"new-support-description-invalid\" [translate]=\" validatorsService.getError(supportForm.controls['description'])\"\r\n *ngIf=\"validatorsService.isControlError(supportForm.controls['description'])\"></span>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n <div *ngIf=\"status ==='send'\" translate=\"Your request has been registered\" data-testid=\"new-support-send-info\">\r\n </div>\r\n <div *ngIf=\"status ==='error'\" translate=\"An error has occurred, please renew your request\"\r\n data-testid=\"new-support-error-info\">\r\n\r\n </div>\r\n</div>\r\n<div class=\"modal-footer\">\r\n <button type=\"button\" class=\"btn rounded-pill btn-museum\" data-dismiss=\"modal\" translate=\"Close\" (click)=\"onClose()\"\r\n data-testid=\"new-support-close-btn\"></button>\r\n <button *ngIf=\"!loading && status==='new'\" type=\"button\" class=\"btn rounded-pill btn-museum\" translate=\"Submit\"\r\n (click)=\"onSubmit()\" [disabled]=\"!supportForm.valid\" data-testid=\"new-support-submit-btn\"></button>\r\n</div>", styles: [".support-loader-container{width:88px;margin:auto}.invalid-feedback{height:16px}\n"], dependencies: [{ kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "component", type: LoaderComponent, selector: "lib-loader", inputs: ["useLogo", "color"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
17056
17226
|
}
|
|
17057
17227
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SupportModalComponent, decorators: [{
|
|
17058
17228
|
type: Component,
|
|
17059
|
-
args: [{ selector: 'app-support-modal', template: "<div class=\"modal-header\">\n <h5 class=\"modal-title\" translate=\"Help\"></h5>\n</div>\n<div class=\"modal-body\">\n <div class=\"support-loader-container\">\n <lib-loader *ngIf=\"loading\"></lib-loader>\n </div>\n <form (ngSubmit)=\"onSubmit()\" [formGroup]=\"supportForm\" style=\"margin-top:1rem;\" *ngIf=\"!loading && status==='new'\">\n <div>\n <label>{{'Title' | translate}} *</label>\n <div>\n <input type=\"text\" class=\"form-control\" formControlName=\"title\" data-testid=\"new-support-title\"\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['title'])}\"\n maxlength=\"255\">\n </div>\n <div class=\"invalid-feedback\">\n <span data-testid=\"new-support-title-invalid\" [translate]=\"validatorsService.getError(supportForm.controls['title'])\"\n *ngIf=\" validatorsService.isControlError(supportForm.controls['title'])\"></span>\n </div>\n </div>\n <div *ngIf=\"!currentUser\">\n <label>{{'Email' | translate}} *</label>\n <div>\n <input type=\"email\" class=\"form-control\" formControlName=\"email\" data-testid=\"new-support-email\"\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['email'])}\"\n maxlength=\"255\">\n </div>\n <div class=\"invalid-feedback\">\n <span data-testid=\"new-support-email-invalid\" [translate]=\"validatorsService.getError(supportForm.controls['email'])\"\n *ngIf=\" validatorsService.isControlError(supportForm.controls['email'])\"></span>\n </div>\n </div>\n <div>\n <label>{{'Description' | translate}} *</label>\n <div>\n <textarea formControlName=\"description\" class=\"form-control\"\n data-testid=\"new-support-description\"\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['description'])}\"></textarea>\n </div>\n <div class=\"invalid-feedback\" >\n <span data-testid=\"new-support-description-invalid\" [translate]=\" validatorsService.getError(supportForm.controls['description'])\"\n *ngIf=\"validatorsService.isControlError(supportForm.controls['description'])\"></span>\n </div>\n </div>\n </form>\n\n <div *ngIf=\"status ==='send'\" translate=\"Your request has been registered\" data-testid=\"new-support-send-info\">\n </div>\n <div *ngIf=\"status ==='error'\" translate=\"An error has occurred, please renew your request\"\n data-testid=\"new-support-error-info\">\n\n </div>\n</div>\n<div class=\"modal-footer\">\n <button type=\"button\" class=\"btn rounded-pill btn-museum\" data-dismiss=\"modal\" translate=\"Close\" (click)=\"onClose()\"\n data-testid=\"new-support-close-btn\"></button>\n <button *ngIf=\"!loading && status==='new'\" type=\"button\" class=\"btn rounded-pill btn-museum\" translate=\"Submit\"\n (click)=\"onSubmit()\" [disabled]=\"!supportForm.valid\" data-testid=\"new-support-submit-btn\"></button>\n</div>", styles: [".support-loader-container{width:88px;margin:auto}.invalid-feedback{height:16px}\n"] }]
|
|
17229
|
+
args: [{ selector: 'app-support-modal', template: "<div class=\"modal-header\">\r\n <h5 class=\"modal-title\" translate=\"Help\"></h5>\r\n</div>\r\n<div class=\"modal-body\">\r\n <div class=\"support-loader-container\">\r\n <lib-loader *ngIf=\"loading\"></lib-loader>\r\n </div>\r\n <form (ngSubmit)=\"onSubmit()\" [formGroup]=\"supportForm\" style=\"margin-top:1rem;\" *ngIf=\"!loading && status==='new'\">\r\n <div>\r\n <label>{{'Title' | translate}} *</label>\r\n <div>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"title\" data-testid=\"new-support-title\"\r\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['title'])}\"\r\n maxlength=\"255\">\r\n </div>\r\n <div class=\"invalid-feedback\">\r\n <span data-testid=\"new-support-title-invalid\" [translate]=\"validatorsService.getError(supportForm.controls['title'])\"\r\n *ngIf=\" validatorsService.isControlError(supportForm.controls['title'])\"></span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"!currentUser\">\r\n <label>{{'Email' | translate}} *</label>\r\n <div>\r\n <input type=\"email\" class=\"form-control\" formControlName=\"email\" data-testid=\"new-support-email\"\r\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['email'])}\"\r\n maxlength=\"255\">\r\n </div>\r\n <div class=\"invalid-feedback\">\r\n <span data-testid=\"new-support-email-invalid\" [translate]=\"validatorsService.getError(supportForm.controls['email'])\"\r\n *ngIf=\" validatorsService.isControlError(supportForm.controls['email'])\"></span>\r\n </div>\r\n </div>\r\n <div>\r\n <label>{{'Description' | translate}} *</label>\r\n <div>\r\n <textarea formControlName=\"description\" class=\"form-control\"\r\n data-testid=\"new-support-description\"\r\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['description'])}\"></textarea>\r\n </div>\r\n <div class=\"invalid-feedback\" >\r\n <span data-testid=\"new-support-description-invalid\" [translate]=\" validatorsService.getError(supportForm.controls['description'])\"\r\n *ngIf=\"validatorsService.isControlError(supportForm.controls['description'])\"></span>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n <div *ngIf=\"status ==='send'\" translate=\"Your request has been registered\" data-testid=\"new-support-send-info\">\r\n </div>\r\n <div *ngIf=\"status ==='error'\" translate=\"An error has occurred, please renew your request\"\r\n data-testid=\"new-support-error-info\">\r\n\r\n </div>\r\n</div>\r\n<div class=\"modal-footer\">\r\n <button type=\"button\" class=\"btn rounded-pill btn-museum\" data-dismiss=\"modal\" translate=\"Close\" (click)=\"onClose()\"\r\n data-testid=\"new-support-close-btn\"></button>\r\n <button *ngIf=\"!loading && status==='new'\" type=\"button\" class=\"btn rounded-pill btn-museum\" translate=\"Submit\"\r\n (click)=\"onSubmit()\" [disabled]=\"!supportForm.valid\" data-testid=\"new-support-submit-btn\"></button>\r\n</div>", styles: [".support-loader-container{width:88px;margin:auto}.invalid-feedback{height:16px}\n"] }]
|
|
17060
17230
|
}], ctorParameters: () => [{ type: SupportService }, { type: i1$2.NgbActiveModal }, { type: i3.UntypedFormBuilder }, { type: BaseUserService }, { type: ValidatorsService }] });
|
|
17061
17231
|
|
|
17062
17232
|
class LocaleService {
|
|
@@ -17280,6 +17450,8 @@ class FeatureService extends BaseObjectService {
|
|
|
17280
17450
|
currentHashtags = [];
|
|
17281
17451
|
createObservable = new Subject();
|
|
17282
17452
|
deleteObservable = new Subject();
|
|
17453
|
+
/** Counts the calls to initFeatures, so that only the latest one publishes its lists. */
|
|
17454
|
+
initFeaturesRun = 0;
|
|
17283
17455
|
constructor(apiInjected, navigatorService, filterService, poiService, commentService, userService, navigationService, visitService, hashtagService, zoneChangeService) {
|
|
17284
17456
|
super(poiService, navigationService, visitService);
|
|
17285
17457
|
this.navigatorService = navigatorService;
|
|
@@ -17334,6 +17506,33 @@ class FeatureService extends BaseObjectService {
|
|
|
17334
17506
|
this.updateDueToCreate(feature);
|
|
17335
17507
|
}
|
|
17336
17508
|
});
|
|
17509
|
+
// An info point or a desk belongs to the zone of its POI's sweep: when its tag moves, sort it
|
|
17510
|
+
// again with the POI the API returned.
|
|
17511
|
+
this.poiService.poiWritten
|
|
17512
|
+
.pipe(filter(({ poi }) => poi.type === PoiType.DATA || poi.type === PoiType.DESK))
|
|
17513
|
+
.subscribe(({ poi }) => {
|
|
17514
|
+
if (this.currentSpaceID && !this.userService.isMuseumUser(this.currentSpaceID)) {
|
|
17515
|
+
this.sortAgainIntoZone(poi.elementID).catch((e) => console.log(e.message));
|
|
17516
|
+
}
|
|
17517
|
+
});
|
|
17518
|
+
}
|
|
17519
|
+
/** Moves a loaded info point or desk into or out of the current zone's list, as its last written POI says. */
|
|
17520
|
+
async sortAgainIntoZone(featureID) {
|
|
17521
|
+
const feature = this.currentFeatures.space?.find((f) => f.id === featureID);
|
|
17522
|
+
if (!feature) {
|
|
17523
|
+
// Not loaded, or being loaded: the load puts the POI in through withLatestPois.
|
|
17524
|
+
return;
|
|
17525
|
+
}
|
|
17526
|
+
const zoneID = this.zoneIDFilter;
|
|
17527
|
+
this.poiService.withLatestPois([feature]);
|
|
17528
|
+
const inZone = await this.filterService.isInZone(feature, zoneID);
|
|
17529
|
+
// Another zone, or other lists, since: their load has sorted the feature already.
|
|
17530
|
+
if (zoneID !== this.zoneIDFilter || !this.currentFeatures.space?.includes(feature)) {
|
|
17531
|
+
return;
|
|
17532
|
+
}
|
|
17533
|
+
const zone = this.filterService.zoneListAfterMove(this.currentFeatures.space, this.currentFeatures.zone, featureID, inZone);
|
|
17534
|
+
this.featureTags.next(zone);
|
|
17535
|
+
this.featureUpdated.next({ space: this.currentFeatures.space, zone });
|
|
17337
17536
|
}
|
|
17338
17537
|
/*
|
|
17339
17538
|
* CRUD
|
|
@@ -17376,10 +17575,19 @@ class FeatureService extends BaseObjectService {
|
|
|
17376
17575
|
if (!this.currentSpaceID) {
|
|
17377
17576
|
return;
|
|
17378
17577
|
}
|
|
17578
|
+
const run = ++this.initFeaturesRun;
|
|
17579
|
+
// Calls overlap - one per change - and their requests can resolve in any order: a call that
|
|
17580
|
+
// started earlier would publish the info points and desks as they were before the change.
|
|
17581
|
+
const hasNewerCall = () => run !== this.initFeaturesRun;
|
|
17379
17582
|
this.updating.next(true);
|
|
17380
17583
|
this.isUpdating = true;
|
|
17381
17584
|
const featureList = await this.getFeaturesForSpace(this.currentSpaceID);
|
|
17382
|
-
|
|
17585
|
+
const hashtags = await this.hashtagService.getHashtagsForSpace(this.currentSpaceID);
|
|
17586
|
+
if (hasNewerCall()) {
|
|
17587
|
+
return;
|
|
17588
|
+
}
|
|
17589
|
+
this.poiService.withLatestPois(featureList);
|
|
17590
|
+
this.currentHashtags = hashtags;
|
|
17383
17591
|
// console.log(this.currentHashtags);
|
|
17384
17592
|
this.featuresUnfiltered.next(featureList);
|
|
17385
17593
|
if (featureList.length > 0) {
|
|
@@ -17393,12 +17601,16 @@ class FeatureService extends BaseObjectService {
|
|
|
17393
17601
|
filteredDesks = filteredDesks.filter((feature) => this.deskDomainFilter.find((domain) => feature.domain && domain === feature.domain.id));
|
|
17394
17602
|
}
|
|
17395
17603
|
filteredFeatures = [...filteredPointInterest, ...filteredDesks];
|
|
17396
|
-
|
|
17397
|
-
// emit on tags should be after setting current.space !!
|
|
17604
|
+
const featuresSpace = filteredFeatures.sort((a, b) => a.index - b.index);
|
|
17398
17605
|
if (this.zoneIDFilter) {
|
|
17399
17606
|
filteredFeatures =
|
|
17400
17607
|
(await this.filterService.filterObjectsForZone(filteredFeatures, this.zoneIDFilter));
|
|
17401
17608
|
}
|
|
17609
|
+
if (hasNewerCall()) {
|
|
17610
|
+
return;
|
|
17611
|
+
}
|
|
17612
|
+
// emit on tags should be after setting current.space !!
|
|
17613
|
+
this.currentFeatures.space = featuresSpace;
|
|
17402
17614
|
this.featureTags.next(filteredFeatures); // for this zone
|
|
17403
17615
|
this.currentFeatures.zone = filteredFeatures.sort((a, b) => a.index - b.index);
|
|
17404
17616
|
// console.log(this.currentFeatures);
|
|
@@ -17750,6 +17962,8 @@ class MeasurementService {
|
|
|
17750
17962
|
if (this.currentSpaceID) {
|
|
17751
17963
|
this.updating.next(true);
|
|
17752
17964
|
let measurements = await this.getMeasurementsForSpaceForUser(this.currentSpaceID);
|
|
17965
|
+
// The list may be read before it shows the POI of a measurement just taken.
|
|
17966
|
+
this.poiService.withLatestPois(measurements.map((measure) => measure.comment));
|
|
17753
17967
|
if (measurements.length > 0) {
|
|
17754
17968
|
if (this.dateFilter) {
|
|
17755
17969
|
measurements = this.filterService.filterMeasurementsForDateRange(measurements, this.dateFilter);
|
|
@@ -18517,11 +18731,11 @@ class NavigationBarComponent {
|
|
|
18517
18731
|
this.baseVisibilityService.isChangePositionVisible.next(false);
|
|
18518
18732
|
}
|
|
18519
18733
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NavigationBarComponent, deps: [{ token: 'currentAwsKinesisAnalyticsService' }, { token: i1.Router }, { token: SpaceService }, { token: BaseUserService }, { token: ZoneService }, { token: VisitService }, { token: ViewerService }, { token: NavigatorService }, { token: ZoneChangeService }, { token: BaseVisibilityService }], target: i0.ɵɵFactoryTarget.Component });
|
|
18520
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: NavigationBarComponent, selector: "lib-navigation-bar", viewQueries: [{ propertyName: "navbarSelectMenu", first: true, predicate: ["navbarSelectMenu"], descendants: true }], ngImport: i0, template: "<nav class=\"navbar navbar-expand-md navbar-dark navbar-inverse second-nav\">\n <div class=\"d-flex w-100\">\n <div #navbarSelectMenu class=\"w-100\" id=\"nav-item-container-blue\">\n <div class=\"d-flex flex-column flex-md-row p-1 mt-2\">\n <select class=\"form-control flex-fill flex-lg-fill-unset location select-menu\"\n [(ngModel)]=\"selectedLocation\" (ngModelChange)=\"onLocationClick()\">\n <option [ngValue]=\"null\" selected>{{ 'Location' | translate }}</option>\n <option *ngFor=\"let loc of locations; index as index\" [ngValue]=\"loc\"> {{ loc.name }}</option>\n </select>\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu\" (change)=\"onVisitClick($event)\"\n *ngIf=\"visitsPerSpace && visitsPerSpace.length > 1\">\n <option value=\"default\" selected disabled hidden>{{'Visit' | translate}}</option>\n <option *ngFor=\"let visit of visitsPerSpace; index as index\" value=\"{{index}}\">{{ visit.name}}\n </option>\n </select>\n <select class=\"form-control flex-fill flex-lg-fill-unset floor select-menu\" [(ngModel)]=\"selectedFloor\"\n (ngModelChange)=\"onFloorClick()\">\n <option [ngValue]=\"null\" selected>{{'Floor' | translate}}</option>\n <option *ngFor=\"let floor of floorsPerSpace\" [ngValue]=\"floor\">{{ floor.name}}</option>\n </select>\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu zone\" [(ngModel)]=\"selectedZone\"\n (ngModelChange)=\"onZoneClick()\">\n <option [ngValue]=\"null\" selected>{{'Zone' | translate}}</option>\n <option *ngFor=\"let zone of zonesPerFloor\" [ngValue]=\"zone\"><span\n *ngIf=\"zone.code_ref\">{{zone.code_ref}}_</span>{{zone.name}}</option>\n </select>\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu\" [(ngModel)]=\"selectedChildZone\"\n *ngIf=\"childrenZones && childrenZones.length>0\" (ngModelChange)=\"onChildZoneClick()\">\n <option [ngValue]=\"null\" selected disabled>{{'Zone' | translate}}</option>\n <option *ngFor=\"let zone of childrenZones\" [ngValue]=\"zone\">{{ zone.name}}</option>\n </select>\n <button (click)=\"goTo()\"\n class=\"btn btn-outline-primary rounded-pill mx-2 w-md-fit-content h-md-fit-content align-self-md-center btn-3d d-none d-lg-block\"\n [disabled]=\"!selectedLocation || !selectedModel3d || !canGo()\">\n <i class=\"icon-go-to-3d d-inline-block\"></i> {{'3D visit' | translate}}\n </button>\n </div>\n <div class=\"row align-items-center justify-content-center ml-0 p-1\" *ngIf=\"showLocation()\">\n <p class=\"fw-bold lh-base align-middle text-center\">\n {{ showLocation() }}\n </p>\n </div>\n <div class=\"row align-items-center justify-content-center ml-0 p-1 d-block d-lg-none\">\n <button (click)=\"goTo()\"\n class=\"btn btn-outline-primary rounded-pill w-25 mx-2 w-md-fit-content h-md-fit-content align-self-md-center btn-3d\"\n [disabled]=\"!selectedLocation || !selectedModel3d || !canGo()\">\n <i class=\"icon-go-to-3d d-inline-block\"></i> {{'3D visit' | translate}}\n </button>\n </div>\n </div>\n </div>\n</nav>", styles: [":host{position:sticky;top:0;height:123px}.navbar{z-index:200;padding:.4rem 1rem}.navbar.second-nav{z-index:199;background-color:var(--smarterplan-primary)}input,select{margin-right:15px}.select{background:transparent;border:none;color:#fff;margin:6px 20px 0}@media (min-width: 992px){.flex-lg-fill-unset{flex:unset!important}}.form-control{width:100%;min-width:80px;max-width:18%}.location{width:auto;max-width:35%}.floor,.zone{width:auto;max-width:30%}button{color:#fff;padding:5px 10px;font-size:1.1em}.navbar-toggler{margin-right:1em}.select-menu{max-width:inherit}.btn-3d .icon-go-to-3d{width:30px;height:30px;background:url('data:image/svg+xml,<?xml version=\"1.0\" encoding=\"utf-8\"?>%0A<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->%0A<svg version=\"1.1\" id=\"Calque_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"%0A%09 viewBox=\"0 0 60 60\" style=\"enable-background:new 0 0 60 60;\" xml:space=\"preserve\">%0A<style type=\"text/css\">%0A%09.st0{fill:%23565656;}%0A<\\/style>%0A<g>%0A%09<path class=\"st0\" d=\"M43.9,32.1V17.7c0-0.4-0.2-0.7-0.5-0.9l-12.8-8c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.4,0.1-0.6,0.2l-12.8,8%0A%09%09c-0.3,0.2-0.5,0.5-0.5,0.9v14.4c0,0.4,0.2,0.7,0.5,0.9l12.8,8c0.3,0.2,0.8,0.2,1.1,0l12.8-8C43.7,32.8,43.9,32.5,43.9,32.1z%0A%09%09 M28.9,38.2l-10.7-6.7v-12l10.7,6.7V38.2z M30,24.4l-10.8-6.8L30,10.9l10.8,6.8L30,24.4z M41.8,31.5l-10.7,6.7v-12l10.7-6.7V31.5z\"%0A%09%09/>%0A%09<path class=\"st0\" d=\"M56.1,29.3l-10.3-6.8v2l1.4,1v0l0.8,0.5l0,0l7,4.8c0.3,0.2,0.4,0.5,0.4,0.8c0,0.3-0.2,0.6-0.4,0.8l-6.8,4.7%0A%09%09l0,0l-0.9,0.7v0l-2.9,2v0l-13.8,9.6c-0.3,0.2-0.8,0.2-1.1,0l-14.2-9.8l-2.6-1.8v0L5,32.4c-0.3-0.2-0.4-0.5-0.4-0.8%0A%09%09c0-0.3,0.2-0.6,0.4-0.8l0,0l7.3-5l0,0l0.5-0.3v0l1.4-1v-2L3.9,29.3c-0.8,0.5-1.2,1.4-1.2,2.4c0,0.9,0.5,1.8,1.2,2.4l8.8,6.1v0%0A%09%09l4.5,3.1l11.2,7.7c1,0.7,2.3,0.7,3.3,0l13.7-9.5l1.9-1.3v0l8.8-6.1c0.8-0.5,1.2-1.4,1.2-2.4S56.9,29.8,56.1,29.3z\"/>%0A</g>%0A</svg>%0A');border:none;vertical-align:middle;fill:var(--smarterplan-primary)}.btn-3d:hover:enabled .icon-go-to-3d{background:url('data:image/svg+xml,<?xml version=\"1.0\" encoding=\"utf-8\"?>%0A<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->%0A<svg version=\"1.1\" id=\"Calque_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"%0A%09 viewBox=\"0 0 60 60\" style=\"enable-background:new 0 0 60 60;\" xml:space=\"preserve\">%0A<style type=\"text/css\">%0A%09.st0{fill:%23FFFFFF;}%0A<\\/style>%0A<g>%0A%09<path class=\"st0\" d=\"M43.9,32.1V17.7c0-0.4-0.2-0.7-0.5-0.9l-12.8-8c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.4,0.1-0.6,0.2l-12.8,8%0A%09%09c-0.3,0.2-0.5,0.5-0.5,0.9v14.4c0,0.4,0.2,0.7,0.5,0.9l12.8,8c0.3,0.2,0.8,0.2,1.1,0l12.8-8C43.7,32.8,43.9,32.5,43.9,32.1z%0A%09%09 M28.9,38.2l-10.7-6.7v-12l10.7,6.7V38.2z M30,24.4l-10.8-6.8L30,10.9l10.8,6.8L30,24.4z M41.8,31.5l-10.7,6.7v-12l10.7-6.7V31.5z\"%0A%09%09/>%0A%09<path class=\"st0\" d=\"M56.1,29.3l-10.3-6.8v2l1.4,1v0l0.8,0.5l0,0l7,4.8c0.3,0.2,0.4,0.5,0.4,0.8c0,0.3-0.2,0.6-0.4,0.8l-6.8,4.7%0A%09%09l0,0l-0.9,0.7v0l-2.9,2v0l-13.8,9.6c-0.3,0.2-0.8,0.2-1.1,0l-14.2-9.8l-2.6-1.8v0L5,32.4c-0.3-0.2-0.4-0.5-0.4-0.8%0A%09%09c0-0.3,0.2-0.6,0.4-0.8l0,0l7.3-5l0,0l0.5-0.3v0l1.4-1v-2L3.9,29.3c-0.8,0.5-1.2,1.4-1.2,2.4c0,0.9,0.5,1.8,1.2,2.4l8.8,6.1v0%0A%09%09l4.5,3.1l11.2,7.7c1,0.7,2.3,0.7,3.3,0l13.7-9.5l1.9-1.3v0l8.8-6.1c0.8-0.5,1.2-1.4,1.2-2.4S56.9,29.8,56.1,29.3z\"/>%0A</g>%0A</svg>%0A')}.btn-3d[disabled]:hover .icon-go-to-3d{fill:var(--smarterplan-primary)}.outer_circle{background-color:#ebebeb;border-radius:50%;width:32px;height:32px;padding:1px}@media (max-width: 767px){.navbar{padding:.2rem .5rem}.form-control,.location,.floor,.zone{max-width:100%;margin-bottom:15px}input,select{margin-right:0;margin-bottom:15px}}\n"], dependencies: [{ kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
18734
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: NavigationBarComponent, selector: "lib-navigation-bar", viewQueries: [{ propertyName: "navbarSelectMenu", first: true, predicate: ["navbarSelectMenu"], descendants: true }], ngImport: i0, template: "<nav class=\"navbar navbar-expand-md navbar-dark navbar-inverse second-nav\">\r\n <div class=\"d-flex w-100\">\r\n <div #navbarSelectMenu class=\"w-100\" id=\"nav-item-container-blue\">\r\n <div class=\"d-flex flex-column flex-md-row p-1 mt-2\">\r\n <select class=\"form-control flex-fill flex-lg-fill-unset location select-menu\"\r\n [(ngModel)]=\"selectedLocation\" (ngModelChange)=\"onLocationClick()\">\r\n <option [ngValue]=\"null\" selected>{{ 'Location' | translate }}</option>\r\n <option *ngFor=\"let loc of locations; index as index\" [ngValue]=\"loc\"> {{ loc.name }}</option>\r\n </select>\r\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu\" (change)=\"onVisitClick($event)\"\r\n *ngIf=\"visitsPerSpace && visitsPerSpace.length > 1\">\r\n <option value=\"default\" selected disabled hidden>{{'Visit' | translate}}</option>\r\n <option *ngFor=\"let visit of visitsPerSpace; index as index\" value=\"{{index}}\">{{ visit.name}}\r\n </option>\r\n </select>\r\n <select class=\"form-control flex-fill flex-lg-fill-unset floor select-menu\" [(ngModel)]=\"selectedFloor\"\r\n (ngModelChange)=\"onFloorClick()\">\r\n <option [ngValue]=\"null\" selected>{{'Floor' | translate}}</option>\r\n <option *ngFor=\"let floor of floorsPerSpace\" [ngValue]=\"floor\">{{ floor.name}}</option>\r\n </select>\r\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu zone\" [(ngModel)]=\"selectedZone\"\r\n (ngModelChange)=\"onZoneClick()\">\r\n <option [ngValue]=\"null\" selected>{{'Zone' | translate}}</option>\r\n <option *ngFor=\"let zone of zonesPerFloor\" [ngValue]=\"zone\"><span\r\n *ngIf=\"zone.code_ref\">{{zone.code_ref}}_</span>{{zone.name}}</option>\r\n </select>\r\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu\" [(ngModel)]=\"selectedChildZone\"\r\n *ngIf=\"childrenZones && childrenZones.length>0\" (ngModelChange)=\"onChildZoneClick()\">\r\n <option [ngValue]=\"null\" selected disabled>{{'Zone' | translate}}</option>\r\n <option *ngFor=\"let zone of childrenZones\" [ngValue]=\"zone\">{{ zone.name}}</option>\r\n </select>\r\n <button (click)=\"goTo()\"\r\n class=\"btn btn-outline-primary rounded-pill mx-2 w-md-fit-content h-md-fit-content align-self-md-center btn-3d d-none d-lg-block\"\r\n [disabled]=\"!selectedLocation || !selectedModel3d || !canGo()\">\r\n <i class=\"icon-go-to-3d d-inline-block\"></i> {{'3D visit' | translate}}\r\n </button>\r\n </div>\r\n <div class=\"row align-items-center justify-content-center ml-0 p-1\" *ngIf=\"showLocation()\">\r\n <p class=\"fw-bold lh-base align-middle text-center\">\r\n {{ showLocation() }}\r\n </p>\r\n </div>\r\n <div class=\"row align-items-center justify-content-center ml-0 p-1 d-block d-lg-none\">\r\n <button (click)=\"goTo()\"\r\n class=\"btn btn-outline-primary rounded-pill w-25 mx-2 w-md-fit-content h-md-fit-content align-self-md-center btn-3d\"\r\n [disabled]=\"!selectedLocation || !selectedModel3d || !canGo()\">\r\n <i class=\"icon-go-to-3d d-inline-block\"></i> {{'3D visit' | translate}}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</nav>", styles: [":host{position:sticky;top:0;height:123px}.navbar{z-index:200;padding:.4rem 1rem}.navbar.second-nav{z-index:199;background-color:var(--smarterplan-primary)}input,select{margin-right:15px}.select{background:transparent;border:none;color:#fff;margin:6px 20px 0}@media (min-width: 992px){.flex-lg-fill-unset{flex:unset!important}}.form-control{width:100%;min-width:80px;max-width:18%}.location{width:auto;max-width:35%}.floor,.zone{width:auto;max-width:30%}button{color:#fff;padding:5px 10px;font-size:1.1em}.navbar-toggler{margin-right:1em}.select-menu{max-width:inherit}.btn-3d .icon-go-to-3d{width:30px;height:30px;background:url('data:image/svg+xml,<?xml version=\"1.0\" encoding=\"utf-8\"?>%0D%0A<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->%0D%0A<svg version=\"1.1\" id=\"Calque_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"%0D%0A%09 viewBox=\"0 0 60 60\" style=\"enable-background:new 0 0 60 60;\" xml:space=\"preserve\">%0D%0A<style type=\"text/css\">%0D%0A%09.st0{fill:%23565656;}%0D%0A<\\/style>%0D%0A<g>%0D%0A%09<path class=\"st0\" d=\"M43.9,32.1V17.7c0-0.4-0.2-0.7-0.5-0.9l-12.8-8c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.4,0.1-0.6,0.2l-12.8,8%0D%0A%09%09c-0.3,0.2-0.5,0.5-0.5,0.9v14.4c0,0.4,0.2,0.7,0.5,0.9l12.8,8c0.3,0.2,0.8,0.2,1.1,0l12.8-8C43.7,32.8,43.9,32.5,43.9,32.1z%0D%0A%09%09 M28.9,38.2l-10.7-6.7v-12l10.7,6.7V38.2z M30,24.4l-10.8-6.8L30,10.9l10.8,6.8L30,24.4z M41.8,31.5l-10.7,6.7v-12l10.7-6.7V31.5z\"%0D%0A%09%09/>%0D%0A%09<path class=\"st0\" d=\"M56.1,29.3l-10.3-6.8v2l1.4,1v0l0.8,0.5l0,0l7,4.8c0.3,0.2,0.4,0.5,0.4,0.8c0,0.3-0.2,0.6-0.4,0.8l-6.8,4.7%0D%0A%09%09l0,0l-0.9,0.7v0l-2.9,2v0l-13.8,9.6c-0.3,0.2-0.8,0.2-1.1,0l-14.2-9.8l-2.6-1.8v0L5,32.4c-0.3-0.2-0.4-0.5-0.4-0.8%0D%0A%09%09c0-0.3,0.2-0.6,0.4-0.8l0,0l7.3-5l0,0l0.5-0.3v0l1.4-1v-2L3.9,29.3c-0.8,0.5-1.2,1.4-1.2,2.4c0,0.9,0.5,1.8,1.2,2.4l8.8,6.1v0%0D%0A%09%09l4.5,3.1l11.2,7.7c1,0.7,2.3,0.7,3.3,0l13.7-9.5l1.9-1.3v0l8.8-6.1c0.8-0.5,1.2-1.4,1.2-2.4S56.9,29.8,56.1,29.3z\"/>%0D%0A</g>%0D%0A</svg>%0D%0A');border:none;vertical-align:middle;fill:var(--smarterplan-primary)}.btn-3d:hover:enabled .icon-go-to-3d{background:url('data:image/svg+xml,<?xml version=\"1.0\" encoding=\"utf-8\"?>%0D%0A<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->%0D%0A<svg version=\"1.1\" id=\"Calque_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"%0D%0A%09 viewBox=\"0 0 60 60\" style=\"enable-background:new 0 0 60 60;\" xml:space=\"preserve\">%0D%0A<style type=\"text/css\">%0D%0A%09.st0{fill:%23FFFFFF;}%0D%0A<\\/style>%0D%0A<g>%0D%0A%09<path class=\"st0\" d=\"M43.9,32.1V17.7c0-0.4-0.2-0.7-0.5-0.9l-12.8-8c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.4,0.1-0.6,0.2l-12.8,8%0D%0A%09%09c-0.3,0.2-0.5,0.5-0.5,0.9v14.4c0,0.4,0.2,0.7,0.5,0.9l12.8,8c0.3,0.2,0.8,0.2,1.1,0l12.8-8C43.7,32.8,43.9,32.5,43.9,32.1z%0D%0A%09%09 M28.9,38.2l-10.7-6.7v-12l10.7,6.7V38.2z M30,24.4l-10.8-6.8L30,10.9l10.8,6.8L30,24.4z M41.8,31.5l-10.7,6.7v-12l10.7-6.7V31.5z\"%0D%0A%09%09/>%0D%0A%09<path class=\"st0\" d=\"M56.1,29.3l-10.3-6.8v2l1.4,1v0l0.8,0.5l0,0l7,4.8c0.3,0.2,0.4,0.5,0.4,0.8c0,0.3-0.2,0.6-0.4,0.8l-6.8,4.7%0D%0A%09%09l0,0l-0.9,0.7v0l-2.9,2v0l-13.8,9.6c-0.3,0.2-0.8,0.2-1.1,0l-14.2-9.8l-2.6-1.8v0L5,32.4c-0.3-0.2-0.4-0.5-0.4-0.8%0D%0A%09%09c0-0.3,0.2-0.6,0.4-0.8l0,0l7.3-5l0,0l0.5-0.3v0l1.4-1v-2L3.9,29.3c-0.8,0.5-1.2,1.4-1.2,2.4c0,0.9,0.5,1.8,1.2,2.4l8.8,6.1v0%0D%0A%09%09l4.5,3.1l11.2,7.7c1,0.7,2.3,0.7,3.3,0l13.7-9.5l1.9-1.3v0l8.8-6.1c0.8-0.5,1.2-1.4,1.2-2.4S56.9,29.8,56.1,29.3z\"/>%0D%0A</g>%0D%0A</svg>%0D%0A')}.btn-3d[disabled]:hover .icon-go-to-3d{fill:var(--smarterplan-primary)}.outer_circle{background-color:#ebebeb;border-radius:50%;width:32px;height:32px;padding:1px}@media (max-width: 767px){.navbar{padding:.2rem .5rem}.form-control,.location,.floor,.zone{max-width:100%;margin-bottom:15px}input,select{margin-right:0;margin-bottom:15px}}\n"], dependencies: [{ kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
18521
18735
|
}
|
|
18522
18736
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NavigationBarComponent, decorators: [{
|
|
18523
18737
|
type: Component,
|
|
18524
|
-
args: [{ selector: 'lib-navigation-bar', template: "<nav class=\"navbar navbar-expand-md navbar-dark navbar-inverse second-nav\">\n <div class=\"d-flex w-100\">\n <div #navbarSelectMenu class=\"w-100\" id=\"nav-item-container-blue\">\n <div class=\"d-flex flex-column flex-md-row p-1 mt-2\">\n <select class=\"form-control flex-fill flex-lg-fill-unset location select-menu\"\n [(ngModel)]=\"selectedLocation\" (ngModelChange)=\"onLocationClick()\">\n <option [ngValue]=\"null\" selected>{{ 'Location' | translate }}</option>\n <option *ngFor=\"let loc of locations; index as index\" [ngValue]=\"loc\"> {{ loc.name }}</option>\n </select>\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu\" (change)=\"onVisitClick($event)\"\n *ngIf=\"visitsPerSpace && visitsPerSpace.length > 1\">\n <option value=\"default\" selected disabled hidden>{{'Visit' | translate}}</option>\n <option *ngFor=\"let visit of visitsPerSpace; index as index\" value=\"{{index}}\">{{ visit.name}}\n </option>\n </select>\n <select class=\"form-control flex-fill flex-lg-fill-unset floor select-menu\" [(ngModel)]=\"selectedFloor\"\n (ngModelChange)=\"onFloorClick()\">\n <option [ngValue]=\"null\" selected>{{'Floor' | translate}}</option>\n <option *ngFor=\"let floor of floorsPerSpace\" [ngValue]=\"floor\">{{ floor.name}}</option>\n </select>\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu zone\" [(ngModel)]=\"selectedZone\"\n (ngModelChange)=\"onZoneClick()\">\n <option [ngValue]=\"null\" selected>{{'Zone' | translate}}</option>\n <option *ngFor=\"let zone of zonesPerFloor\" [ngValue]=\"zone\"><span\n *ngIf=\"zone.code_ref\">{{zone.code_ref}}_</span>{{zone.name}}</option>\n </select>\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu\" [(ngModel)]=\"selectedChildZone\"\n *ngIf=\"childrenZones && childrenZones.length>0\" (ngModelChange)=\"onChildZoneClick()\">\n <option [ngValue]=\"null\" selected disabled>{{'Zone' | translate}}</option>\n <option *ngFor=\"let zone of childrenZones\" [ngValue]=\"zone\">{{ zone.name}}</option>\n </select>\n <button (click)=\"goTo()\"\n class=\"btn btn-outline-primary rounded-pill mx-2 w-md-fit-content h-md-fit-content align-self-md-center btn-3d d-none d-lg-block\"\n [disabled]=\"!selectedLocation || !selectedModel3d || !canGo()\">\n <i class=\"icon-go-to-3d d-inline-block\"></i> {{'3D visit' | translate}}\n </button>\n </div>\n <div class=\"row align-items-center justify-content-center ml-0 p-1\" *ngIf=\"showLocation()\">\n <p class=\"fw-bold lh-base align-middle text-center\">\n {{ showLocation() }}\n </p>\n </div>\n <div class=\"row align-items-center justify-content-center ml-0 p-1 d-block d-lg-none\">\n <button (click)=\"goTo()\"\n class=\"btn btn-outline-primary rounded-pill w-25 mx-2 w-md-fit-content h-md-fit-content align-self-md-center btn-3d\"\n [disabled]=\"!selectedLocation || !selectedModel3d || !canGo()\">\n <i class=\"icon-go-to-3d d-inline-block\"></i> {{'3D visit' | translate}}\n </button>\n </div>\n </div>\n </div>\n</nav>", styles: [":host{position:sticky;top:0;height:123px}.navbar{z-index:200;padding:.4rem 1rem}.navbar.second-nav{z-index:199;background-color:var(--smarterplan-primary)}input,select{margin-right:15px}.select{background:transparent;border:none;color:#fff;margin:6px 20px 0}@media (min-width: 992px){.flex-lg-fill-unset{flex:unset!important}}.form-control{width:100%;min-width:80px;max-width:18%}.location{width:auto;max-width:35%}.floor,.zone{width:auto;max-width:30%}button{color:#fff;padding:5px 10px;font-size:1.1em}.navbar-toggler{margin-right:1em}.select-menu{max-width:inherit}.btn-3d .icon-go-to-3d{width:30px;height:30px;background:url('data:image/svg+xml,<?xml version=\"1.0\" encoding=\"utf-8\"?>%0A<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->%0A<svg version=\"1.1\" id=\"Calque_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"%0A%09 viewBox=\"0 0 60 60\" style=\"enable-background:new 0 0 60 60;\" xml:space=\"preserve\">%0A<style type=\"text/css\">%0A%09.st0{fill:%23565656;}%0A<\\/style>%0A<g>%0A%09<path class=\"st0\" d=\"M43.9,32.1V17.7c0-0.4-0.2-0.7-0.5-0.9l-12.8-8c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.4,0.1-0.6,0.2l-12.8,8%0A%09%09c-0.3,0.2-0.5,0.5-0.5,0.9v14.4c0,0.4,0.2,0.7,0.5,0.9l12.8,8c0.3,0.2,0.8,0.2,1.1,0l12.8-8C43.7,32.8,43.9,32.5,43.9,32.1z%0A%09%09 M28.9,38.2l-10.7-6.7v-12l10.7,6.7V38.2z M30,24.4l-10.8-6.8L30,10.9l10.8,6.8L30,24.4z M41.8,31.5l-10.7,6.7v-12l10.7-6.7V31.5z\"%0A%09%09/>%0A%09<path class=\"st0\" d=\"M56.1,29.3l-10.3-6.8v2l1.4,1v0l0.8,0.5l0,0l7,4.8c0.3,0.2,0.4,0.5,0.4,0.8c0,0.3-0.2,0.6-0.4,0.8l-6.8,4.7%0A%09%09l0,0l-0.9,0.7v0l-2.9,2v0l-13.8,9.6c-0.3,0.2-0.8,0.2-1.1,0l-14.2-9.8l-2.6-1.8v0L5,32.4c-0.3-0.2-0.4-0.5-0.4-0.8%0A%09%09c0-0.3,0.2-0.6,0.4-0.8l0,0l7.3-5l0,0l0.5-0.3v0l1.4-1v-2L3.9,29.3c-0.8,0.5-1.2,1.4-1.2,2.4c0,0.9,0.5,1.8,1.2,2.4l8.8,6.1v0%0A%09%09l4.5,3.1l11.2,7.7c1,0.7,2.3,0.7,3.3,0l13.7-9.5l1.9-1.3v0l8.8-6.1c0.8-0.5,1.2-1.4,1.2-2.4S56.9,29.8,56.1,29.3z\"/>%0A</g>%0A</svg>%0A');border:none;vertical-align:middle;fill:var(--smarterplan-primary)}.btn-3d:hover:enabled .icon-go-to-3d{background:url('data:image/svg+xml,<?xml version=\"1.0\" encoding=\"utf-8\"?>%0A<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->%0A<svg version=\"1.1\" id=\"Calque_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"%0A%09 viewBox=\"0 0 60 60\" style=\"enable-background:new 0 0 60 60;\" xml:space=\"preserve\">%0A<style type=\"text/css\">%0A%09.st0{fill:%23FFFFFF;}%0A<\\/style>%0A<g>%0A%09<path class=\"st0\" d=\"M43.9,32.1V17.7c0-0.4-0.2-0.7-0.5-0.9l-12.8-8c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.4,0.1-0.6,0.2l-12.8,8%0A%09%09c-0.3,0.2-0.5,0.5-0.5,0.9v14.4c0,0.4,0.2,0.7,0.5,0.9l12.8,8c0.3,0.2,0.8,0.2,1.1,0l12.8-8C43.7,32.8,43.9,32.5,43.9,32.1z%0A%09%09 M28.9,38.2l-10.7-6.7v-12l10.7,6.7V38.2z M30,24.4l-10.8-6.8L30,10.9l10.8,6.8L30,24.4z M41.8,31.5l-10.7,6.7v-12l10.7-6.7V31.5z\"%0A%09%09/>%0A%09<path class=\"st0\" d=\"M56.1,29.3l-10.3-6.8v2l1.4,1v0l0.8,0.5l0,0l7,4.8c0.3,0.2,0.4,0.5,0.4,0.8c0,0.3-0.2,0.6-0.4,0.8l-6.8,4.7%0A%09%09l0,0l-0.9,0.7v0l-2.9,2v0l-13.8,9.6c-0.3,0.2-0.8,0.2-1.1,0l-14.2-9.8l-2.6-1.8v0L5,32.4c-0.3-0.2-0.4-0.5-0.4-0.8%0A%09%09c0-0.3,0.2-0.6,0.4-0.8l0,0l7.3-5l0,0l0.5-0.3v0l1.4-1v-2L3.9,29.3c-0.8,0.5-1.2,1.4-1.2,2.4c0,0.9,0.5,1.8,1.2,2.4l8.8,6.1v0%0A%09%09l4.5,3.1l11.2,7.7c1,0.7,2.3,0.7,3.3,0l13.7-9.5l1.9-1.3v0l8.8-6.1c0.8-0.5,1.2-1.4,1.2-2.4S56.9,29.8,56.1,29.3z\"/>%0A</g>%0A</svg>%0A')}.btn-3d[disabled]:hover .icon-go-to-3d{fill:var(--smarterplan-primary)}.outer_circle{background-color:#ebebeb;border-radius:50%;width:32px;height:32px;padding:1px}@media (max-width: 767px){.navbar{padding:.2rem .5rem}.form-control,.location,.floor,.zone{max-width:100%;margin-bottom:15px}input,select{margin-right:0;margin-bottom:15px}}\n"] }]
|
|
18738
|
+
args: [{ selector: 'lib-navigation-bar', template: "<nav class=\"navbar navbar-expand-md navbar-dark navbar-inverse second-nav\">\r\n <div class=\"d-flex w-100\">\r\n <div #navbarSelectMenu class=\"w-100\" id=\"nav-item-container-blue\">\r\n <div class=\"d-flex flex-column flex-md-row p-1 mt-2\">\r\n <select class=\"form-control flex-fill flex-lg-fill-unset location select-menu\"\r\n [(ngModel)]=\"selectedLocation\" (ngModelChange)=\"onLocationClick()\">\r\n <option [ngValue]=\"null\" selected>{{ 'Location' | translate }}</option>\r\n <option *ngFor=\"let loc of locations; index as index\" [ngValue]=\"loc\"> {{ loc.name }}</option>\r\n </select>\r\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu\" (change)=\"onVisitClick($event)\"\r\n *ngIf=\"visitsPerSpace && visitsPerSpace.length > 1\">\r\n <option value=\"default\" selected disabled hidden>{{'Visit' | translate}}</option>\r\n <option *ngFor=\"let visit of visitsPerSpace; index as index\" value=\"{{index}}\">{{ visit.name}}\r\n </option>\r\n </select>\r\n <select class=\"form-control flex-fill flex-lg-fill-unset floor select-menu\" [(ngModel)]=\"selectedFloor\"\r\n (ngModelChange)=\"onFloorClick()\">\r\n <option [ngValue]=\"null\" selected>{{'Floor' | translate}}</option>\r\n <option *ngFor=\"let floor of floorsPerSpace\" [ngValue]=\"floor\">{{ floor.name}}</option>\r\n </select>\r\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu zone\" [(ngModel)]=\"selectedZone\"\r\n (ngModelChange)=\"onZoneClick()\">\r\n <option [ngValue]=\"null\" selected>{{'Zone' | translate}}</option>\r\n <option *ngFor=\"let zone of zonesPerFloor\" [ngValue]=\"zone\"><span\r\n *ngIf=\"zone.code_ref\">{{zone.code_ref}}_</span>{{zone.name}}</option>\r\n </select>\r\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu\" [(ngModel)]=\"selectedChildZone\"\r\n *ngIf=\"childrenZones && childrenZones.length>0\" (ngModelChange)=\"onChildZoneClick()\">\r\n <option [ngValue]=\"null\" selected disabled>{{'Zone' | translate}}</option>\r\n <option *ngFor=\"let zone of childrenZones\" [ngValue]=\"zone\">{{ zone.name}}</option>\r\n </select>\r\n <button (click)=\"goTo()\"\r\n class=\"btn btn-outline-primary rounded-pill mx-2 w-md-fit-content h-md-fit-content align-self-md-center btn-3d d-none d-lg-block\"\r\n [disabled]=\"!selectedLocation || !selectedModel3d || !canGo()\">\r\n <i class=\"icon-go-to-3d d-inline-block\"></i> {{'3D visit' | translate}}\r\n </button>\r\n </div>\r\n <div class=\"row align-items-center justify-content-center ml-0 p-1\" *ngIf=\"showLocation()\">\r\n <p class=\"fw-bold lh-base align-middle text-center\">\r\n {{ showLocation() }}\r\n </p>\r\n </div>\r\n <div class=\"row align-items-center justify-content-center ml-0 p-1 d-block d-lg-none\">\r\n <button (click)=\"goTo()\"\r\n class=\"btn btn-outline-primary rounded-pill w-25 mx-2 w-md-fit-content h-md-fit-content align-self-md-center btn-3d\"\r\n [disabled]=\"!selectedLocation || !selectedModel3d || !canGo()\">\r\n <i class=\"icon-go-to-3d d-inline-block\"></i> {{'3D visit' | translate}}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</nav>", styles: [":host{position:sticky;top:0;height:123px}.navbar{z-index:200;padding:.4rem 1rem}.navbar.second-nav{z-index:199;background-color:var(--smarterplan-primary)}input,select{margin-right:15px}.select{background:transparent;border:none;color:#fff;margin:6px 20px 0}@media (min-width: 992px){.flex-lg-fill-unset{flex:unset!important}}.form-control{width:100%;min-width:80px;max-width:18%}.location{width:auto;max-width:35%}.floor,.zone{width:auto;max-width:30%}button{color:#fff;padding:5px 10px;font-size:1.1em}.navbar-toggler{margin-right:1em}.select-menu{max-width:inherit}.btn-3d .icon-go-to-3d{width:30px;height:30px;background:url('data:image/svg+xml,<?xml version=\"1.0\" encoding=\"utf-8\"?>%0D%0A<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->%0D%0A<svg version=\"1.1\" id=\"Calque_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"%0D%0A%09 viewBox=\"0 0 60 60\" style=\"enable-background:new 0 0 60 60;\" xml:space=\"preserve\">%0D%0A<style type=\"text/css\">%0D%0A%09.st0{fill:%23565656;}%0D%0A<\\/style>%0D%0A<g>%0D%0A%09<path class=\"st0\" d=\"M43.9,32.1V17.7c0-0.4-0.2-0.7-0.5-0.9l-12.8-8c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.4,0.1-0.6,0.2l-12.8,8%0D%0A%09%09c-0.3,0.2-0.5,0.5-0.5,0.9v14.4c0,0.4,0.2,0.7,0.5,0.9l12.8,8c0.3,0.2,0.8,0.2,1.1,0l12.8-8C43.7,32.8,43.9,32.5,43.9,32.1z%0D%0A%09%09 M28.9,38.2l-10.7-6.7v-12l10.7,6.7V38.2z M30,24.4l-10.8-6.8L30,10.9l10.8,6.8L30,24.4z M41.8,31.5l-10.7,6.7v-12l10.7-6.7V31.5z\"%0D%0A%09%09/>%0D%0A%09<path class=\"st0\" d=\"M56.1,29.3l-10.3-6.8v2l1.4,1v0l0.8,0.5l0,0l7,4.8c0.3,0.2,0.4,0.5,0.4,0.8c0,0.3-0.2,0.6-0.4,0.8l-6.8,4.7%0D%0A%09%09l0,0l-0.9,0.7v0l-2.9,2v0l-13.8,9.6c-0.3,0.2-0.8,0.2-1.1,0l-14.2-9.8l-2.6-1.8v0L5,32.4c-0.3-0.2-0.4-0.5-0.4-0.8%0D%0A%09%09c0-0.3,0.2-0.6,0.4-0.8l0,0l7.3-5l0,0l0.5-0.3v0l1.4-1v-2L3.9,29.3c-0.8,0.5-1.2,1.4-1.2,2.4c0,0.9,0.5,1.8,1.2,2.4l8.8,6.1v0%0D%0A%09%09l4.5,3.1l11.2,7.7c1,0.7,2.3,0.7,3.3,0l13.7-9.5l1.9-1.3v0l8.8-6.1c0.8-0.5,1.2-1.4,1.2-2.4S56.9,29.8,56.1,29.3z\"/>%0D%0A</g>%0D%0A</svg>%0D%0A');border:none;vertical-align:middle;fill:var(--smarterplan-primary)}.btn-3d:hover:enabled .icon-go-to-3d{background:url('data:image/svg+xml,<?xml version=\"1.0\" encoding=\"utf-8\"?>%0D%0A<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->%0D%0A<svg version=\"1.1\" id=\"Calque_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"%0D%0A%09 viewBox=\"0 0 60 60\" style=\"enable-background:new 0 0 60 60;\" xml:space=\"preserve\">%0D%0A<style type=\"text/css\">%0D%0A%09.st0{fill:%23FFFFFF;}%0D%0A<\\/style>%0D%0A<g>%0D%0A%09<path class=\"st0\" d=\"M43.9,32.1V17.7c0-0.4-0.2-0.7-0.5-0.9l-12.8-8c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.4,0.1-0.6,0.2l-12.8,8%0D%0A%09%09c-0.3,0.2-0.5,0.5-0.5,0.9v14.4c0,0.4,0.2,0.7,0.5,0.9l12.8,8c0.3,0.2,0.8,0.2,1.1,0l12.8-8C43.7,32.8,43.9,32.5,43.9,32.1z%0D%0A%09%09 M28.9,38.2l-10.7-6.7v-12l10.7,6.7V38.2z M30,24.4l-10.8-6.8L30,10.9l10.8,6.8L30,24.4z M41.8,31.5l-10.7,6.7v-12l10.7-6.7V31.5z\"%0D%0A%09%09/>%0D%0A%09<path class=\"st0\" d=\"M56.1,29.3l-10.3-6.8v2l1.4,1v0l0.8,0.5l0,0l7,4.8c0.3,0.2,0.4,0.5,0.4,0.8c0,0.3-0.2,0.6-0.4,0.8l-6.8,4.7%0D%0A%09%09l0,0l-0.9,0.7v0l-2.9,2v0l-13.8,9.6c-0.3,0.2-0.8,0.2-1.1,0l-14.2-9.8l-2.6-1.8v0L5,32.4c-0.3-0.2-0.4-0.5-0.4-0.8%0D%0A%09%09c0-0.3,0.2-0.6,0.4-0.8l0,0l7.3-5l0,0l0.5-0.3v0l1.4-1v-2L3.9,29.3c-0.8,0.5-1.2,1.4-1.2,2.4c0,0.9,0.5,1.8,1.2,2.4l8.8,6.1v0%0D%0A%09%09l4.5,3.1l11.2,7.7c1,0.7,2.3,0.7,3.3,0l13.7-9.5l1.9-1.3v0l8.8-6.1c0.8-0.5,1.2-1.4,1.2-2.4S56.9,29.8,56.1,29.3z\"/>%0D%0A</g>%0D%0A</svg>%0D%0A')}.btn-3d[disabled]:hover .icon-go-to-3d{fill:var(--smarterplan-primary)}.outer_circle{background-color:#ebebeb;border-radius:50%;width:32px;height:32px;padding:1px}@media (max-width: 767px){.navbar{padding:.2rem .5rem}.form-control,.location,.floor,.zone{max-width:100%;margin-bottom:15px}input,select{margin-right:0;margin-bottom:15px}}\n"] }]
|
|
18525
18739
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
18526
18740
|
type: Inject,
|
|
18527
18741
|
args: ['currentAwsKinesisAnalyticsService']
|
|
@@ -18791,11 +19005,11 @@ class MenuBarComponent {
|
|
|
18791
19005
|
}
|
|
18792
19006
|
}
|
|
18793
19007
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MenuBarComponent, deps: [{ token: i1.Router }, { token: LocaleService }, { token: BaseUserService }, { token: NavigatorService }, { token: SupportService }, { token: BaseVisibilityService }, { token: i1$2.NgbCalendar }, { token: i1$2.NgbDateParserFormatter }, { token: FilterService }, { token: AmplifyCacheService }], target: i0.ɵɵFactoryTarget.Component });
|
|
18794
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: MenuBarComponent, selector: "lib-menu-bar", inputs: { cacheName: "cacheName" }, ngImport: i0, template: "<div id=\"menu-bar\">\n <div *ngIf=\"!isVisitor\">\n <nav class=\"navbar navbar-expand-md navbar-light p-0\">\n <div class=\"container-fluid\" *ngIf=\"isVisible\">\n <div class=\"navbar-brand order-md-0\" [routerLink]=\"['/dashboard']\">\n <img alt=\"SmarterPlan\" src=\"../assets/images/logos/logo-immo.png\">\n </div>\n <div class=\"ms-auto nav-item dropdown profile_pic-container order-md-2\">\n <div class=\"profile_pic dropdown-toggle\" data-testid=\"dropdown-menu-button\" data-bs-toggle=\"dropdown\">\n <lib-avatar></lib-avatar>\n </div>\n <div class=\"dropdown-menu dropdown-menu-right\">\n <p *ngIf=\"user && mission\" class=\"p-2\">\n <span class=\"username\">{{ user.displayName }}</span><br />\n <span class=\"user-role\">{{ mission.role }}</span><br />\n <span class=\"org\">{{ mission.organisation ? mission.organisation.name : \"No organisation\" |\n translate}}</span>\n </p>\n <div class=\"dropdown-divider\"></div>\n <!-- <a class=\"dropdown-item\" routerLink=\"/debug\" *ngIf=\"isManager\">Debug</a> -->\n <a class=\"dropdown-item\" (click)=\"localeService.modal()\">{{'Language' | translate}}</a>\n <a class=\"dropdown-item\" routerLink=\"/dashboard\">{{'Data management' | translate}}</a>\n <a class=\"dropdown-item\" data-testid=\"user-management-btn\" routerLink=\"/admin\" *ngIf=\"isManager\">\n {{'Users management' | translate}}</a>\n <a class=\"dropdown-item\" routerLink=\"/profile\">\n {{'Profile' | translate}}</a>\n <div class=\"dropdown-divider\"></div>\n <button class=\"dropdown-item\" (click)=\"openSupportForm()\">{{\"Help\" | translate}}</button>\n <button data-testid=\"logout-auth-btn\" class=\"dropdown-item\" (click)=\"signOut()\">{{\"Logout\" |\n translate}}</button>\n </div>\n </div>\n <button class=\"navbar-toggler order-md-1\" (click)=\"navbarCollapse.toggle()\" type=\"button\"\n [attr.aria-expanded]=\"!isCollapsed\" aria-controls=\"navbar-collapse\">\n <span class=\"navbar-toggler-icon\"></span>\n </button>\n <div class=\"navbar-collapse order-md-1\" #navbarCollapse=\"ngbCollapse\" [(ngbCollapse)]=\"isCollapsed\"\n [animation]=\"false\">\n <form\n class=\"form-inline m-0 mt-2 form-container d-flex justify-content-start align-items-start align-items-md-center flex-column flex-md-row flex-nowrap filters-menu-block\">\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-0\">\n <input class=\"form-control search-button m-1\" placeholder=\"keyword\" id=\"mainSearchBar\" type=\"text\">\n <button class=\"btn btn-outline-primary rounded-pill m-1 w-fit-content h-fit-content align-self-md-center\"\n (click)=\"onSubmit()\">{{'Search' |\n translate}}</button>\n </div>\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-0\">\n <div class=\"input-group date-selector m-1\">\n <input #dpFromDate class=\"form-control\" placeholder=\"dd/MM/yyyy\" name=\"dpFromDate\"\n [value]=\"fromDate | formatDateNumberToDigits\"\n (input)=\"fromDate = validateInput(fromDate, dpFromDate.value)\">\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary calendar\" (click)=\"datepicker.toggle()\"\n type=\"button\"></button>\n </div>\n </div>\n <input name=\"datepicker\" class=\"form-control visually-hidden\" ngbDatepicker #datepicker=\"ngbDatepicker\"\n [autoClose]=\"'outside'\" (dateSelect)=\"onDateSelection($event)\" [displayMonths]=\"2\" [dayTemplate]=\"t\"\n outsideDays=\"hidden\" [startDate]=\"fromDate || calendar.getToday()\" [container]=\"'body'\" tabindex=\"-1\">\n <ng-template #t let-date let-focused=\"focused\">\n <span class=\"custom-day\" [class.focused]=\"focused\" [class.range]=\"isRange(date)\"\n [class.faded]=\"isHovered(date) || isInside(date)\" (mouseenter)=\"hoveredDate = date\"\n (mouseleave)=\"hoveredDate = null\">\n {{ date.day }}\n </span>\n </ng-template>\n <span class=\"ms-1 p-2\">{{'to' | translate}}</span>\n <div class=\"input-group date-selector m-1\">\n <input #dpToDate class=\"form-control\" placeholder=\"dd/MM/yyyy\" name=\"dpToDate\"\n [value]=\"toDate | formatDateNumberToDigits\" (input)=\"toDate = validateInput(toDate, dpToDate.value)\">\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary calendar\" (click)=\"datepicker.toggle()\"\n type=\"button\"></button>\n </div>\n </div>\n </div>\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-1 justify-content-evenly\">\n <button\n class=\"btn btn-primary rounded-pill ms-1 w-25 w-md-fit-content h-md-fit-content align-self-md-center\"\n type=\"button\" (click)=\"onApply()\" *ngIf=\"!isDateFilterApplied || dateChanged\">\n {{'Apply' | translate}}\n </button>\n <span\n class=\"appliedText ms-1 py-2 align-self-md-center pb-md-0 mx-2 w-md-fit-content h-md-fit-content align-self-md-center\"\n *ngIf=\"isDateFilterApplied && !dateChanged\">\n <span class=\"iconify\" [icIcon]=\"checkIcon\" width=\"15\" height=\"15\"></span>\n {{\"Applied\" | translate}}\n </span>\n <button\n class=\"btn btn-outline-primary rounded-pill w-25 mx-2 w-md-fit-content h-md-fit-content align-self-md-center\"\n type=\"button\" (click)=\"onClearDates()\">{{'Clear'\n |\n translate}}</button>\n <div\n class=\"change-position-button align-self-end pb-2 align-self-md-center mx-2 pb-md-0 flex-nowrap w-25 w-md-fit-content h-md-fit-content\">\n <input type=\"checkbox\" class=\"btn-check\" id=\"btn-check-outlined\" autocomplete=\"off\">\n <label class=\"link-primary cursor-pointer text-decoration-underline\" (click)=\"onChangePositionClick()\"\n for=\"btn-check-outlined\">{{\n (isChangePositionVisible ? \"Close\" : \"Move to\") | translate }}</label>\n </div>\n </div>\n </form>\n </div>\n </div>\n </nav>\n <lib-navigation-bar *ngIf=\"isVisible && isChangePositionVisible\"></lib-navigation-bar>\n </div>\n <div *ngIf=\"isVisitor && isVisible\">\n <div class=\"visitor-div\">\n <div class=\"logo-container\" data-testid=\"dropdown-menu-button\">\n <img class=\"img-logo\" alt=\"SmarterPlanLogo\" src=\"../assets/images/logos/logo-reserve.png\">\n </div>\n <div class=\"avatar-container-menu\">\n <div class=\"profile_pic dropdown-toggle cursor-pointer\" data-bs-toggle=\"dropdown\">\n <lib-avatar></lib-avatar>\n </div>\n <div class=\"dropdown-menu dropdown-menu-right\">\n <button class=\"dropdown-item\" (click)=\"localeService.modal()\">{{'Language' | translate}}</button>\n <button class=\"dropdown-item\" (click)=\"openSupportForm()\">{{\"Help\" | translate}}</button>\n <button data-testid=\"logout-auth-btn\" class=\"dropdown-item\" (click)=\"signOut()\">{{\"Logout\" |\n translate}}</button>\n </div>\n </div>\n </div>\n </div>\n</div>", styles: ["#menu-bar{position:sticky;top:0;z-index:200}.navbar{z-index:200}.navbar-brand{padding-top:5px;padding-bottom:5px;cursor:pointer}.navbar-brand img{height:70px}.profile_pic{border-radius:50%;height:45px;width:45px;margin:8px;border:.2px solid rgb(150,150,150)}.navbar-nav .profile-pic-container .dropdown-menu{position:absolute}.navbar.second-nav{z-index:199;background-color:var(--smarterplan-primary)}.profile_pic.dropdown-toggle:after{display:none}.navbar-light{border-bottom:1px solid var(--smarterplan-primary);background-color:#fff}.navbar form{width:100%;margin:0;padding:0}input,select{margin-right:15px}.select{background:transparent;border:none;color:#fff;margin:6px 20px 0;width:auto}button{padding:5px 10px}button:disabled,button[disabled]{color:#c04f4f}.navbar-toggler{margin-right:1em}.icon{height:40px;width:40px;color:var(--smarterplan-primary)}.search-button-container{width:auto;align-items:stretch;justify-items:start}.search-button-container .search-button{width:auto;border-radius:1rem!important}.visitor-div{background-color:var(--smarterplan-primary);height:60px;display:flex;justify-content:space-between}.profile_pic-container{margin-right:1em}.logo-container,.img-logo{height:100%}.change-position-button{margin-left:2rem}.change-position-button label,.change-position-button .btn-check:checked,.change-position-button .btn-check:focus,.change-position-button .btn-outline-primary,.change-position-button .btn{box-shadow:none!important;outline:0}.change-position-button label{border-radius:16px}.change-position-button .btn-check:checked+.btn{background-color:var(--smarterplan-primary);color:#fff!important}.filters-menu-block{width:auto}@media (min-width: 1200px){.navbar-brand img{height:100px}.profile_pic{height:60px;width:60px;margin:15px}}@media (min-width: 992px) and (max-width: 1199.98px){.navbar-brand img{height:80px}.profile_pic{height:50px;width:50px;margin:12px}}@media (min-width: 768px) and (max-width: 991.98px){.navbar-brand img{height:60px}.profile_pic{height:40px;width:40px;margin:10px}}@media (max-width: 767.98px){.navbar-brand img{height:50px}.profile_pic{height:30px;width:30px;margin:8px}.search-button-container,.filters-menu-block{width:100%}}.form-container{margin:.5rem 0}.navbar-collapse.show{display:flex;padding-bottom:.5rem}.hidden{width:0;margin:0;border:none;padding:0}.custom-day{text-align:center;padding:.185rem .25rem;display:inline-block;height:2rem;width:2rem}.custom-day.focused{background-color:#e6e6e6}.custom-day.range,.custom-day:hover{background-color:var(--smarterplan-primary-lighter);color:#fff}.custom-day.faded{background-color:var(--smarterplan-primary-transparent)}.calendar{height:100%}.appliedText,.appliedText span{color:var(--smarterplan-primary)}@media (max-width: 767px){.form-inline{flex-direction:column}}.hidden{opacity:0}.date-selector{flex-wrap:nowrap}.date-selector input{min-width:80px;margin:0}@media (min-width: 768px){.w-md-fit-content{width:fit-content!important}.h-md-content{height:fit-content!important}}\n"], dependencies: [{ kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$2.NgbCollapse, selector: "[ngbCollapse]", inputs: ["animation", "ngbCollapse", "horizontal"], outputs: ["ngbCollapseChange", "shown", "hidden"], exportAs: ["ngbCollapse"] }, { kind: "directive", type: i1$2.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["autoClose", "contentTemplate", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "popperOptions", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays", "disabled"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { kind: "directive", type: i1$3.IconDirective, selector: "ic-icon,[icIcon]", inputs: ["icIcon", "icon", "color", "inline", "box", "size", "width", "height", "align", "hFlip", "vFlip", "flip", "rotate"] }, { kind: "component", type: AvatarComponent, selector: "lib-avatar", inputs: ["size", "userID"] }, { kind: "component", type: NavigationBarComponent, selector: "lib-navigation-bar" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: FormatDateNumberToDigitsPipe, name: "formatDateNumberToDigits" }] });
|
|
19008
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: MenuBarComponent, selector: "lib-menu-bar", inputs: { cacheName: "cacheName" }, ngImport: i0, template: "<div id=\"menu-bar\">\r\n <div *ngIf=\"!isVisitor\">\r\n <nav class=\"navbar navbar-expand-md navbar-light p-0\">\r\n <div class=\"container-fluid\" *ngIf=\"isVisible\">\r\n <div class=\"navbar-brand order-md-0\" [routerLink]=\"['/dashboard']\">\r\n <img alt=\"SmarterPlan\" src=\"../assets/images/logos/logo-immo.png\">\r\n </div>\r\n <div class=\"ms-auto nav-item dropdown profile_pic-container order-md-2\">\r\n <div class=\"profile_pic dropdown-toggle\" data-testid=\"dropdown-menu-button\" data-bs-toggle=\"dropdown\">\r\n <lib-avatar></lib-avatar>\r\n </div>\r\n <div class=\"dropdown-menu dropdown-menu-right\">\r\n <p *ngIf=\"user && mission\" class=\"p-2\">\r\n <span class=\"username\">{{ user.displayName }}</span><br />\r\n <span class=\"user-role\">{{ mission.role }}</span><br />\r\n <span class=\"org\">{{ mission.organisation ? mission.organisation.name : \"No organisation\" |\r\n translate}}</span>\r\n </p>\r\n <div class=\"dropdown-divider\"></div>\r\n <!-- <a class=\"dropdown-item\" routerLink=\"/debug\" *ngIf=\"isManager\">Debug</a> -->\r\n <a class=\"dropdown-item\" (click)=\"localeService.modal()\">{{'Language' | translate}}</a>\r\n <a class=\"dropdown-item\" routerLink=\"/dashboard\">{{'Data management' | translate}}</a>\r\n <a class=\"dropdown-item\" data-testid=\"user-management-btn\" routerLink=\"/admin\" *ngIf=\"isManager\">\r\n {{'Users management' | translate}}</a>\r\n <a class=\"dropdown-item\" routerLink=\"/profile\">\r\n {{'Profile' | translate}}</a>\r\n <div class=\"dropdown-divider\"></div>\r\n <button class=\"dropdown-item\" (click)=\"openSupportForm()\">{{\"Help\" | translate}}</button>\r\n <button data-testid=\"logout-auth-btn\" class=\"dropdown-item\" (click)=\"signOut()\">{{\"Logout\" |\r\n translate}}</button>\r\n </div>\r\n </div>\r\n <button class=\"navbar-toggler order-md-1\" (click)=\"navbarCollapse.toggle()\" type=\"button\"\r\n [attr.aria-expanded]=\"!isCollapsed\" aria-controls=\"navbar-collapse\">\r\n <span class=\"navbar-toggler-icon\"></span>\r\n </button>\r\n <div class=\"navbar-collapse order-md-1\" #navbarCollapse=\"ngbCollapse\" [(ngbCollapse)]=\"isCollapsed\"\r\n [animation]=\"false\">\r\n <form\r\n class=\"form-inline m-0 mt-2 form-container d-flex justify-content-start align-items-start align-items-md-center flex-column flex-md-row flex-nowrap filters-menu-block\">\r\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-0\">\r\n <input class=\"form-control search-button m-1\" placeholder=\"keyword\" id=\"mainSearchBar\" type=\"text\">\r\n <button class=\"btn btn-outline-primary rounded-pill m-1 w-fit-content h-fit-content align-self-md-center\"\r\n (click)=\"onSubmit()\">{{'Search' |\r\n translate}}</button>\r\n </div>\r\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-0\">\r\n <div class=\"input-group date-selector m-1\">\r\n <input #dpFromDate class=\"form-control\" placeholder=\"dd/MM/yyyy\" name=\"dpFromDate\"\r\n [value]=\"fromDate | formatDateNumberToDigits\"\r\n (input)=\"fromDate = validateInput(fromDate, dpFromDate.value)\">\r\n <div class=\"input-group-append\">\r\n <button class=\"btn btn-outline-secondary calendar\" (click)=\"datepicker.toggle()\"\r\n type=\"button\"></button>\r\n </div>\r\n </div>\r\n <input name=\"datepicker\" class=\"form-control visually-hidden\" ngbDatepicker #datepicker=\"ngbDatepicker\"\r\n [autoClose]=\"'outside'\" (dateSelect)=\"onDateSelection($event)\" [displayMonths]=\"2\" [dayTemplate]=\"t\"\r\n outsideDays=\"hidden\" [startDate]=\"fromDate || calendar.getToday()\" [container]=\"'body'\" tabindex=\"-1\">\r\n <ng-template #t let-date let-focused=\"focused\">\r\n <span class=\"custom-day\" [class.focused]=\"focused\" [class.range]=\"isRange(date)\"\r\n [class.faded]=\"isHovered(date) || isInside(date)\" (mouseenter)=\"hoveredDate = date\"\r\n (mouseleave)=\"hoveredDate = null\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n <span class=\"ms-1 p-2\">{{'to' | translate}}</span>\r\n <div class=\"input-group date-selector m-1\">\r\n <input #dpToDate class=\"form-control\" placeholder=\"dd/MM/yyyy\" name=\"dpToDate\"\r\n [value]=\"toDate | formatDateNumberToDigits\" (input)=\"toDate = validateInput(toDate, dpToDate.value)\">\r\n <div class=\"input-group-append\">\r\n <button class=\"btn btn-outline-secondary calendar\" (click)=\"datepicker.toggle()\"\r\n type=\"button\"></button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-1 justify-content-evenly\">\r\n <button\r\n class=\"btn btn-primary rounded-pill ms-1 w-25 w-md-fit-content h-md-fit-content align-self-md-center\"\r\n type=\"button\" (click)=\"onApply()\" *ngIf=\"!isDateFilterApplied || dateChanged\">\r\n {{'Apply' | translate}}\r\n </button>\r\n <span\r\n class=\"appliedText ms-1 py-2 align-self-md-center pb-md-0 mx-2 w-md-fit-content h-md-fit-content align-self-md-center\"\r\n *ngIf=\"isDateFilterApplied && !dateChanged\">\r\n <span class=\"iconify\" [icIcon]=\"checkIcon\" width=\"15\" height=\"15\"></span>\r\n {{\"Applied\" | translate}}\r\n </span>\r\n <button\r\n class=\"btn btn-outline-primary rounded-pill w-25 mx-2 w-md-fit-content h-md-fit-content align-self-md-center\"\r\n type=\"button\" (click)=\"onClearDates()\">{{'Clear'\r\n |\r\n translate}}</button>\r\n <div\r\n class=\"change-position-button align-self-end pb-2 align-self-md-center mx-2 pb-md-0 flex-nowrap w-25 w-md-fit-content h-md-fit-content\">\r\n <input type=\"checkbox\" class=\"btn-check\" id=\"btn-check-outlined\" autocomplete=\"off\">\r\n <label class=\"link-primary cursor-pointer text-decoration-underline\" (click)=\"onChangePositionClick()\"\r\n for=\"btn-check-outlined\">{{\r\n (isChangePositionVisible ? \"Close\" : \"Move to\") | translate }}</label>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n </nav>\r\n <lib-navigation-bar *ngIf=\"isVisible && isChangePositionVisible\"></lib-navigation-bar>\r\n </div>\r\n <div *ngIf=\"isVisitor && isVisible\">\r\n <div class=\"visitor-div\">\r\n <div class=\"logo-container\" data-testid=\"dropdown-menu-button\">\r\n <img class=\"img-logo\" alt=\"SmarterPlanLogo\" src=\"../assets/images/logos/logo-reserve.png\">\r\n </div>\r\n <div class=\"avatar-container-menu\">\r\n <div class=\"profile_pic dropdown-toggle cursor-pointer\" data-bs-toggle=\"dropdown\">\r\n <lib-avatar></lib-avatar>\r\n </div>\r\n <div class=\"dropdown-menu dropdown-menu-right\">\r\n <button class=\"dropdown-item\" (click)=\"localeService.modal()\">{{'Language' | translate}}</button>\r\n <button class=\"dropdown-item\" (click)=\"openSupportForm()\">{{\"Help\" | translate}}</button>\r\n <button data-testid=\"logout-auth-btn\" class=\"dropdown-item\" (click)=\"signOut()\">{{\"Logout\" |\r\n translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: ["#menu-bar{position:sticky;top:0;z-index:200}.navbar{z-index:200}.navbar-brand{padding-top:5px;padding-bottom:5px;cursor:pointer}.navbar-brand img{height:70px}.profile_pic{border-radius:50%;height:45px;width:45px;margin:8px;border:.2px solid rgb(150,150,150)}.navbar-nav .profile-pic-container .dropdown-menu{position:absolute}.navbar.second-nav{z-index:199;background-color:var(--smarterplan-primary)}.profile_pic.dropdown-toggle:after{display:none}.navbar-light{border-bottom:1px solid var(--smarterplan-primary);background-color:#fff}.navbar form{width:100%;margin:0;padding:0}input,select{margin-right:15px}.select{background:transparent;border:none;color:#fff;margin:6px 20px 0;width:auto}button{padding:5px 10px}button:disabled,button[disabled]{color:#c04f4f}.navbar-toggler{margin-right:1em}.icon{height:40px;width:40px;color:var(--smarterplan-primary)}.search-button-container{width:auto;align-items:stretch;justify-items:start}.search-button-container .search-button{width:auto;border-radius:1rem!important}.visitor-div{background-color:var(--smarterplan-primary);height:60px;display:flex;justify-content:space-between}.profile_pic-container{margin-right:1em}.logo-container,.img-logo{height:100%}.change-position-button{margin-left:2rem}.change-position-button label,.change-position-button .btn-check:checked,.change-position-button .btn-check:focus,.change-position-button .btn-outline-primary,.change-position-button .btn{box-shadow:none!important;outline:0}.change-position-button label{border-radius:16px}.change-position-button .btn-check:checked+.btn{background-color:var(--smarterplan-primary);color:#fff!important}.filters-menu-block{width:auto}@media (min-width: 1200px){.navbar-brand img{height:100px}.profile_pic{height:60px;width:60px;margin:15px}}@media (min-width: 992px) and (max-width: 1199.98px){.navbar-brand img{height:80px}.profile_pic{height:50px;width:50px;margin:12px}}@media (min-width: 768px) and (max-width: 991.98px){.navbar-brand img{height:60px}.profile_pic{height:40px;width:40px;margin:10px}}@media (max-width: 767.98px){.navbar-brand img{height:50px}.profile_pic{height:30px;width:30px;margin:8px}.search-button-container,.filters-menu-block{width:100%}}.form-container{margin:.5rem 0}.navbar-collapse.show{display:flex;padding-bottom:.5rem}.hidden{width:0;margin:0;border:none;padding:0}.custom-day{text-align:center;padding:.185rem .25rem;display:inline-block;height:2rem;width:2rem}.custom-day.focused{background-color:#e6e6e6}.custom-day.range,.custom-day:hover{background-color:var(--smarterplan-primary-lighter);color:#fff}.custom-day.faded{background-color:var(--smarterplan-primary-transparent)}.calendar{height:100%}.appliedText,.appliedText span{color:var(--smarterplan-primary)}@media (max-width: 767px){.form-inline{flex-direction:column}}.hidden{opacity:0}.date-selector{flex-wrap:nowrap}.date-selector input{min-width:80px;margin:0}@media (min-width: 768px){.w-md-fit-content{width:fit-content!important}.h-md-content{height:fit-content!important}}\n"], dependencies: [{ kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$2.NgbCollapse, selector: "[ngbCollapse]", inputs: ["animation", "ngbCollapse", "horizontal"], outputs: ["ngbCollapseChange", "shown", "hidden"], exportAs: ["ngbCollapse"] }, { kind: "directive", type: i1$2.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["autoClose", "contentTemplate", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "popperOptions", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays", "disabled"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { kind: "directive", type: i1$3.IconDirective, selector: "ic-icon,[icIcon]", inputs: ["icIcon", "icon", "color", "inline", "box", "size", "width", "height", "align", "hFlip", "vFlip", "flip", "rotate"] }, { kind: "component", type: AvatarComponent, selector: "lib-avatar", inputs: ["size", "userID"] }, { kind: "component", type: NavigationBarComponent, selector: "lib-navigation-bar" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: FormatDateNumberToDigitsPipe, name: "formatDateNumberToDigits" }] });
|
|
18795
19009
|
}
|
|
18796
19010
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MenuBarComponent, decorators: [{
|
|
18797
19011
|
type: Component,
|
|
18798
|
-
args: [{ selector: 'lib-menu-bar', template: "<div id=\"menu-bar\">\n <div *ngIf=\"!isVisitor\">\n <nav class=\"navbar navbar-expand-md navbar-light p-0\">\n <div class=\"container-fluid\" *ngIf=\"isVisible\">\n <div class=\"navbar-brand order-md-0\" [routerLink]=\"['/dashboard']\">\n <img alt=\"SmarterPlan\" src=\"../assets/images/logos/logo-immo.png\">\n </div>\n <div class=\"ms-auto nav-item dropdown profile_pic-container order-md-2\">\n <div class=\"profile_pic dropdown-toggle\" data-testid=\"dropdown-menu-button\" data-bs-toggle=\"dropdown\">\n <lib-avatar></lib-avatar>\n </div>\n <div class=\"dropdown-menu dropdown-menu-right\">\n <p *ngIf=\"user && mission\" class=\"p-2\">\n <span class=\"username\">{{ user.displayName }}</span><br />\n <span class=\"user-role\">{{ mission.role }}</span><br />\n <span class=\"org\">{{ mission.organisation ? mission.organisation.name : \"No organisation\" |\n translate}}</span>\n </p>\n <div class=\"dropdown-divider\"></div>\n <!-- <a class=\"dropdown-item\" routerLink=\"/debug\" *ngIf=\"isManager\">Debug</a> -->\n <a class=\"dropdown-item\" (click)=\"localeService.modal()\">{{'Language' | translate}}</a>\n <a class=\"dropdown-item\" routerLink=\"/dashboard\">{{'Data management' | translate}}</a>\n <a class=\"dropdown-item\" data-testid=\"user-management-btn\" routerLink=\"/admin\" *ngIf=\"isManager\">\n {{'Users management' | translate}}</a>\n <a class=\"dropdown-item\" routerLink=\"/profile\">\n {{'Profile' | translate}}</a>\n <div class=\"dropdown-divider\"></div>\n <button class=\"dropdown-item\" (click)=\"openSupportForm()\">{{\"Help\" | translate}}</button>\n <button data-testid=\"logout-auth-btn\" class=\"dropdown-item\" (click)=\"signOut()\">{{\"Logout\" |\n translate}}</button>\n </div>\n </div>\n <button class=\"navbar-toggler order-md-1\" (click)=\"navbarCollapse.toggle()\" type=\"button\"\n [attr.aria-expanded]=\"!isCollapsed\" aria-controls=\"navbar-collapse\">\n <span class=\"navbar-toggler-icon\"></span>\n </button>\n <div class=\"navbar-collapse order-md-1\" #navbarCollapse=\"ngbCollapse\" [(ngbCollapse)]=\"isCollapsed\"\n [animation]=\"false\">\n <form\n class=\"form-inline m-0 mt-2 form-container d-flex justify-content-start align-items-start align-items-md-center flex-column flex-md-row flex-nowrap filters-menu-block\">\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-0\">\n <input class=\"form-control search-button m-1\" placeholder=\"keyword\" id=\"mainSearchBar\" type=\"text\">\n <button class=\"btn btn-outline-primary rounded-pill m-1 w-fit-content h-fit-content align-self-md-center\"\n (click)=\"onSubmit()\">{{'Search' |\n translate}}</button>\n </div>\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-0\">\n <div class=\"input-group date-selector m-1\">\n <input #dpFromDate class=\"form-control\" placeholder=\"dd/MM/yyyy\" name=\"dpFromDate\"\n [value]=\"fromDate | formatDateNumberToDigits\"\n (input)=\"fromDate = validateInput(fromDate, dpFromDate.value)\">\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary calendar\" (click)=\"datepicker.toggle()\"\n type=\"button\"></button>\n </div>\n </div>\n <input name=\"datepicker\" class=\"form-control visually-hidden\" ngbDatepicker #datepicker=\"ngbDatepicker\"\n [autoClose]=\"'outside'\" (dateSelect)=\"onDateSelection($event)\" [displayMonths]=\"2\" [dayTemplate]=\"t\"\n outsideDays=\"hidden\" [startDate]=\"fromDate || calendar.getToday()\" [container]=\"'body'\" tabindex=\"-1\">\n <ng-template #t let-date let-focused=\"focused\">\n <span class=\"custom-day\" [class.focused]=\"focused\" [class.range]=\"isRange(date)\"\n [class.faded]=\"isHovered(date) || isInside(date)\" (mouseenter)=\"hoveredDate = date\"\n (mouseleave)=\"hoveredDate = null\">\n {{ date.day }}\n </span>\n </ng-template>\n <span class=\"ms-1 p-2\">{{'to' | translate}}</span>\n <div class=\"input-group date-selector m-1\">\n <input #dpToDate class=\"form-control\" placeholder=\"dd/MM/yyyy\" name=\"dpToDate\"\n [value]=\"toDate | formatDateNumberToDigits\" (input)=\"toDate = validateInput(toDate, dpToDate.value)\">\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary calendar\" (click)=\"datepicker.toggle()\"\n type=\"button\"></button>\n </div>\n </div>\n </div>\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-1 justify-content-evenly\">\n <button\n class=\"btn btn-primary rounded-pill ms-1 w-25 w-md-fit-content h-md-fit-content align-self-md-center\"\n type=\"button\" (click)=\"onApply()\" *ngIf=\"!isDateFilterApplied || dateChanged\">\n {{'Apply' | translate}}\n </button>\n <span\n class=\"appliedText ms-1 py-2 align-self-md-center pb-md-0 mx-2 w-md-fit-content h-md-fit-content align-self-md-center\"\n *ngIf=\"isDateFilterApplied && !dateChanged\">\n <span class=\"iconify\" [icIcon]=\"checkIcon\" width=\"15\" height=\"15\"></span>\n {{\"Applied\" | translate}}\n </span>\n <button\n class=\"btn btn-outline-primary rounded-pill w-25 mx-2 w-md-fit-content h-md-fit-content align-self-md-center\"\n type=\"button\" (click)=\"onClearDates()\">{{'Clear'\n |\n translate}}</button>\n <div\n class=\"change-position-button align-self-end pb-2 align-self-md-center mx-2 pb-md-0 flex-nowrap w-25 w-md-fit-content h-md-fit-content\">\n <input type=\"checkbox\" class=\"btn-check\" id=\"btn-check-outlined\" autocomplete=\"off\">\n <label class=\"link-primary cursor-pointer text-decoration-underline\" (click)=\"onChangePositionClick()\"\n for=\"btn-check-outlined\">{{\n (isChangePositionVisible ? \"Close\" : \"Move to\") | translate }}</label>\n </div>\n </div>\n </form>\n </div>\n </div>\n </nav>\n <lib-navigation-bar *ngIf=\"isVisible && isChangePositionVisible\"></lib-navigation-bar>\n </div>\n <div *ngIf=\"isVisitor && isVisible\">\n <div class=\"visitor-div\">\n <div class=\"logo-container\" data-testid=\"dropdown-menu-button\">\n <img class=\"img-logo\" alt=\"SmarterPlanLogo\" src=\"../assets/images/logos/logo-reserve.png\">\n </div>\n <div class=\"avatar-container-menu\">\n <div class=\"profile_pic dropdown-toggle cursor-pointer\" data-bs-toggle=\"dropdown\">\n <lib-avatar></lib-avatar>\n </div>\n <div class=\"dropdown-menu dropdown-menu-right\">\n <button class=\"dropdown-item\" (click)=\"localeService.modal()\">{{'Language' | translate}}</button>\n <button class=\"dropdown-item\" (click)=\"openSupportForm()\">{{\"Help\" | translate}}</button>\n <button data-testid=\"logout-auth-btn\" class=\"dropdown-item\" (click)=\"signOut()\">{{\"Logout\" |\n translate}}</button>\n </div>\n </div>\n </div>\n </div>\n</div>", styles: ["#menu-bar{position:sticky;top:0;z-index:200}.navbar{z-index:200}.navbar-brand{padding-top:5px;padding-bottom:5px;cursor:pointer}.navbar-brand img{height:70px}.profile_pic{border-radius:50%;height:45px;width:45px;margin:8px;border:.2px solid rgb(150,150,150)}.navbar-nav .profile-pic-container .dropdown-menu{position:absolute}.navbar.second-nav{z-index:199;background-color:var(--smarterplan-primary)}.profile_pic.dropdown-toggle:after{display:none}.navbar-light{border-bottom:1px solid var(--smarterplan-primary);background-color:#fff}.navbar form{width:100%;margin:0;padding:0}input,select{margin-right:15px}.select{background:transparent;border:none;color:#fff;margin:6px 20px 0;width:auto}button{padding:5px 10px}button:disabled,button[disabled]{color:#c04f4f}.navbar-toggler{margin-right:1em}.icon{height:40px;width:40px;color:var(--smarterplan-primary)}.search-button-container{width:auto;align-items:stretch;justify-items:start}.search-button-container .search-button{width:auto;border-radius:1rem!important}.visitor-div{background-color:var(--smarterplan-primary);height:60px;display:flex;justify-content:space-between}.profile_pic-container{margin-right:1em}.logo-container,.img-logo{height:100%}.change-position-button{margin-left:2rem}.change-position-button label,.change-position-button .btn-check:checked,.change-position-button .btn-check:focus,.change-position-button .btn-outline-primary,.change-position-button .btn{box-shadow:none!important;outline:0}.change-position-button label{border-radius:16px}.change-position-button .btn-check:checked+.btn{background-color:var(--smarterplan-primary);color:#fff!important}.filters-menu-block{width:auto}@media (min-width: 1200px){.navbar-brand img{height:100px}.profile_pic{height:60px;width:60px;margin:15px}}@media (min-width: 992px) and (max-width: 1199.98px){.navbar-brand img{height:80px}.profile_pic{height:50px;width:50px;margin:12px}}@media (min-width: 768px) and (max-width: 991.98px){.navbar-brand img{height:60px}.profile_pic{height:40px;width:40px;margin:10px}}@media (max-width: 767.98px){.navbar-brand img{height:50px}.profile_pic{height:30px;width:30px;margin:8px}.search-button-container,.filters-menu-block{width:100%}}.form-container{margin:.5rem 0}.navbar-collapse.show{display:flex;padding-bottom:.5rem}.hidden{width:0;margin:0;border:none;padding:0}.custom-day{text-align:center;padding:.185rem .25rem;display:inline-block;height:2rem;width:2rem}.custom-day.focused{background-color:#e6e6e6}.custom-day.range,.custom-day:hover{background-color:var(--smarterplan-primary-lighter);color:#fff}.custom-day.faded{background-color:var(--smarterplan-primary-transparent)}.calendar{height:100%}.appliedText,.appliedText span{color:var(--smarterplan-primary)}@media (max-width: 767px){.form-inline{flex-direction:column}}.hidden{opacity:0}.date-selector{flex-wrap:nowrap}.date-selector input{min-width:80px;margin:0}@media (min-width: 768px){.w-md-fit-content{width:fit-content!important}.h-md-content{height:fit-content!important}}\n"] }]
|
|
19012
|
+
args: [{ selector: 'lib-menu-bar', template: "<div id=\"menu-bar\">\r\n <div *ngIf=\"!isVisitor\">\r\n <nav class=\"navbar navbar-expand-md navbar-light p-0\">\r\n <div class=\"container-fluid\" *ngIf=\"isVisible\">\r\n <div class=\"navbar-brand order-md-0\" [routerLink]=\"['/dashboard']\">\r\n <img alt=\"SmarterPlan\" src=\"../assets/images/logos/logo-immo.png\">\r\n </div>\r\n <div class=\"ms-auto nav-item dropdown profile_pic-container order-md-2\">\r\n <div class=\"profile_pic dropdown-toggle\" data-testid=\"dropdown-menu-button\" data-bs-toggle=\"dropdown\">\r\n <lib-avatar></lib-avatar>\r\n </div>\r\n <div class=\"dropdown-menu dropdown-menu-right\">\r\n <p *ngIf=\"user && mission\" class=\"p-2\">\r\n <span class=\"username\">{{ user.displayName }}</span><br />\r\n <span class=\"user-role\">{{ mission.role }}</span><br />\r\n <span class=\"org\">{{ mission.organisation ? mission.organisation.name : \"No organisation\" |\r\n translate}}</span>\r\n </p>\r\n <div class=\"dropdown-divider\"></div>\r\n <!-- <a class=\"dropdown-item\" routerLink=\"/debug\" *ngIf=\"isManager\">Debug</a> -->\r\n <a class=\"dropdown-item\" (click)=\"localeService.modal()\">{{'Language' | translate}}</a>\r\n <a class=\"dropdown-item\" routerLink=\"/dashboard\">{{'Data management' | translate}}</a>\r\n <a class=\"dropdown-item\" data-testid=\"user-management-btn\" routerLink=\"/admin\" *ngIf=\"isManager\">\r\n {{'Users management' | translate}}</a>\r\n <a class=\"dropdown-item\" routerLink=\"/profile\">\r\n {{'Profile' | translate}}</a>\r\n <div class=\"dropdown-divider\"></div>\r\n <button class=\"dropdown-item\" (click)=\"openSupportForm()\">{{\"Help\" | translate}}</button>\r\n <button data-testid=\"logout-auth-btn\" class=\"dropdown-item\" (click)=\"signOut()\">{{\"Logout\" |\r\n translate}}</button>\r\n </div>\r\n </div>\r\n <button class=\"navbar-toggler order-md-1\" (click)=\"navbarCollapse.toggle()\" type=\"button\"\r\n [attr.aria-expanded]=\"!isCollapsed\" aria-controls=\"navbar-collapse\">\r\n <span class=\"navbar-toggler-icon\"></span>\r\n </button>\r\n <div class=\"navbar-collapse order-md-1\" #navbarCollapse=\"ngbCollapse\" [(ngbCollapse)]=\"isCollapsed\"\r\n [animation]=\"false\">\r\n <form\r\n class=\"form-inline m-0 mt-2 form-container d-flex justify-content-start align-items-start align-items-md-center flex-column flex-md-row flex-nowrap filters-menu-block\">\r\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-0\">\r\n <input class=\"form-control search-button m-1\" placeholder=\"keyword\" id=\"mainSearchBar\" type=\"text\">\r\n <button class=\"btn btn-outline-primary rounded-pill m-1 w-fit-content h-fit-content align-self-md-center\"\r\n (click)=\"onSubmit()\">{{'Search' |\r\n translate}}</button>\r\n </div>\r\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-0\">\r\n <div class=\"input-group date-selector m-1\">\r\n <input #dpFromDate class=\"form-control\" placeholder=\"dd/MM/yyyy\" name=\"dpFromDate\"\r\n [value]=\"fromDate | formatDateNumberToDigits\"\r\n (input)=\"fromDate = validateInput(fromDate, dpFromDate.value)\">\r\n <div class=\"input-group-append\">\r\n <button class=\"btn btn-outline-secondary calendar\" (click)=\"datepicker.toggle()\"\r\n type=\"button\"></button>\r\n </div>\r\n </div>\r\n <input name=\"datepicker\" class=\"form-control visually-hidden\" ngbDatepicker #datepicker=\"ngbDatepicker\"\r\n [autoClose]=\"'outside'\" (dateSelect)=\"onDateSelection($event)\" [displayMonths]=\"2\" [dayTemplate]=\"t\"\r\n outsideDays=\"hidden\" [startDate]=\"fromDate || calendar.getToday()\" [container]=\"'body'\" tabindex=\"-1\">\r\n <ng-template #t let-date let-focused=\"focused\">\r\n <span class=\"custom-day\" [class.focused]=\"focused\" [class.range]=\"isRange(date)\"\r\n [class.faded]=\"isHovered(date) || isInside(date)\" (mouseenter)=\"hoveredDate = date\"\r\n (mouseleave)=\"hoveredDate = null\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n <span class=\"ms-1 p-2\">{{'to' | translate}}</span>\r\n <div class=\"input-group date-selector m-1\">\r\n <input #dpToDate class=\"form-control\" placeholder=\"dd/MM/yyyy\" name=\"dpToDate\"\r\n [value]=\"toDate | formatDateNumberToDigits\" (input)=\"toDate = validateInput(toDate, dpToDate.value)\">\r\n <div class=\"input-group-append\">\r\n <button class=\"btn btn-outline-secondary calendar\" (click)=\"datepicker.toggle()\"\r\n type=\"button\"></button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-1 justify-content-evenly\">\r\n <button\r\n class=\"btn btn-primary rounded-pill ms-1 w-25 w-md-fit-content h-md-fit-content align-self-md-center\"\r\n type=\"button\" (click)=\"onApply()\" *ngIf=\"!isDateFilterApplied || dateChanged\">\r\n {{'Apply' | translate}}\r\n </button>\r\n <span\r\n class=\"appliedText ms-1 py-2 align-self-md-center pb-md-0 mx-2 w-md-fit-content h-md-fit-content align-self-md-center\"\r\n *ngIf=\"isDateFilterApplied && !dateChanged\">\r\n <span class=\"iconify\" [icIcon]=\"checkIcon\" width=\"15\" height=\"15\"></span>\r\n {{\"Applied\" | translate}}\r\n </span>\r\n <button\r\n class=\"btn btn-outline-primary rounded-pill w-25 mx-2 w-md-fit-content h-md-fit-content align-self-md-center\"\r\n type=\"button\" (click)=\"onClearDates()\">{{'Clear'\r\n |\r\n translate}}</button>\r\n <div\r\n class=\"change-position-button align-self-end pb-2 align-self-md-center mx-2 pb-md-0 flex-nowrap w-25 w-md-fit-content h-md-fit-content\">\r\n <input type=\"checkbox\" class=\"btn-check\" id=\"btn-check-outlined\" autocomplete=\"off\">\r\n <label class=\"link-primary cursor-pointer text-decoration-underline\" (click)=\"onChangePositionClick()\"\r\n for=\"btn-check-outlined\">{{\r\n (isChangePositionVisible ? \"Close\" : \"Move to\") | translate }}</label>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n </nav>\r\n <lib-navigation-bar *ngIf=\"isVisible && isChangePositionVisible\"></lib-navigation-bar>\r\n </div>\r\n <div *ngIf=\"isVisitor && isVisible\">\r\n <div class=\"visitor-div\">\r\n <div class=\"logo-container\" data-testid=\"dropdown-menu-button\">\r\n <img class=\"img-logo\" alt=\"SmarterPlanLogo\" src=\"../assets/images/logos/logo-reserve.png\">\r\n </div>\r\n <div class=\"avatar-container-menu\">\r\n <div class=\"profile_pic dropdown-toggle cursor-pointer\" data-bs-toggle=\"dropdown\">\r\n <lib-avatar></lib-avatar>\r\n </div>\r\n <div class=\"dropdown-menu dropdown-menu-right\">\r\n <button class=\"dropdown-item\" (click)=\"localeService.modal()\">{{'Language' | translate}}</button>\r\n <button class=\"dropdown-item\" (click)=\"openSupportForm()\">{{\"Help\" | translate}}</button>\r\n <button data-testid=\"logout-auth-btn\" class=\"dropdown-item\" (click)=\"signOut()\">{{\"Logout\" |\r\n translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: ["#menu-bar{position:sticky;top:0;z-index:200}.navbar{z-index:200}.navbar-brand{padding-top:5px;padding-bottom:5px;cursor:pointer}.navbar-brand img{height:70px}.profile_pic{border-radius:50%;height:45px;width:45px;margin:8px;border:.2px solid rgb(150,150,150)}.navbar-nav .profile-pic-container .dropdown-menu{position:absolute}.navbar.second-nav{z-index:199;background-color:var(--smarterplan-primary)}.profile_pic.dropdown-toggle:after{display:none}.navbar-light{border-bottom:1px solid var(--smarterplan-primary);background-color:#fff}.navbar form{width:100%;margin:0;padding:0}input,select{margin-right:15px}.select{background:transparent;border:none;color:#fff;margin:6px 20px 0;width:auto}button{padding:5px 10px}button:disabled,button[disabled]{color:#c04f4f}.navbar-toggler{margin-right:1em}.icon{height:40px;width:40px;color:var(--smarterplan-primary)}.search-button-container{width:auto;align-items:stretch;justify-items:start}.search-button-container .search-button{width:auto;border-radius:1rem!important}.visitor-div{background-color:var(--smarterplan-primary);height:60px;display:flex;justify-content:space-between}.profile_pic-container{margin-right:1em}.logo-container,.img-logo{height:100%}.change-position-button{margin-left:2rem}.change-position-button label,.change-position-button .btn-check:checked,.change-position-button .btn-check:focus,.change-position-button .btn-outline-primary,.change-position-button .btn{box-shadow:none!important;outline:0}.change-position-button label{border-radius:16px}.change-position-button .btn-check:checked+.btn{background-color:var(--smarterplan-primary);color:#fff!important}.filters-menu-block{width:auto}@media (min-width: 1200px){.navbar-brand img{height:100px}.profile_pic{height:60px;width:60px;margin:15px}}@media (min-width: 992px) and (max-width: 1199.98px){.navbar-brand img{height:80px}.profile_pic{height:50px;width:50px;margin:12px}}@media (min-width: 768px) and (max-width: 991.98px){.navbar-brand img{height:60px}.profile_pic{height:40px;width:40px;margin:10px}}@media (max-width: 767.98px){.navbar-brand img{height:50px}.profile_pic{height:30px;width:30px;margin:8px}.search-button-container,.filters-menu-block{width:100%}}.form-container{margin:.5rem 0}.navbar-collapse.show{display:flex;padding-bottom:.5rem}.hidden{width:0;margin:0;border:none;padding:0}.custom-day{text-align:center;padding:.185rem .25rem;display:inline-block;height:2rem;width:2rem}.custom-day.focused{background-color:#e6e6e6}.custom-day.range,.custom-day:hover{background-color:var(--smarterplan-primary-lighter);color:#fff}.custom-day.faded{background-color:var(--smarterplan-primary-transparent)}.calendar{height:100%}.appliedText,.appliedText span{color:var(--smarterplan-primary)}@media (max-width: 767px){.form-inline{flex-direction:column}}.hidden{opacity:0}.date-selector{flex-wrap:nowrap}.date-selector input{min-width:80px;margin:0}@media (min-width: 768px){.w-md-fit-content{width:fit-content!important}.h-md-content{height:fit-content!important}}\n"] }]
|
|
18799
19013
|
}], ctorParameters: () => [{ type: i1.Router }, { type: LocaleService }, { type: BaseUserService }, { type: NavigatorService }, { type: SupportService }, { type: BaseVisibilityService }, { type: i1$2.NgbCalendar }, { type: i1$2.NgbDateParserFormatter }, { type: FilterService }, { type: AmplifyCacheService }], propDecorators: { cacheName: [{
|
|
18800
19014
|
type: Input
|
|
18801
19015
|
}] } });
|
|
@@ -19223,8 +19437,8 @@ class InventoryService {
|
|
|
19223
19437
|
}
|
|
19224
19438
|
/** The space's inventories, the latest first. */
|
|
19225
19439
|
async getRuns(spaceID) {
|
|
19226
|
-
const query = (fields) => `query InventoriesBySpace($spaceID: ID!, $limit: Int) {
|
|
19227
|
-
inventoriesBySpace(spaceID: $spaceID, limit: $limit) { items { ${fields} } }
|
|
19440
|
+
const query = (fields) => `query InventoriesBySpace($spaceID: ID!, $limit: Int) {
|
|
19441
|
+
inventoriesBySpace(spaceID: $spaceID, limit: $limit) { items { ${fields} } }
|
|
19228
19442
|
}`;
|
|
19229
19443
|
let response;
|
|
19230
19444
|
try {
|
|
@@ -19605,11 +19819,11 @@ class InventoryRunsComponent {
|
|
|
19605
19819
|
}
|
|
19606
19820
|
}
|
|
19607
19821
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryRunsComponent, deps: [{ token: InventoryService }], target: i0.ɵɵFactoryTarget.Component });
|
|
19608
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: InventoryRunsComponent, selector: "lib-inventory-runs", inputs: { spaceID: "spaceID", nodeIDs: "nodeIDs", labels: "labels" }, outputs: { runningChange: "runningChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"inventory-runs\" *ngIf=\"runs.length\">\n <h5>{{'Last inventory' | translate}}</h5>\n <div class=\"inventory-run\" *ngFor=\"let run of runs\">\n <div class=\"inventory-run-header\">\n <span class=\"no-lowercase\">{{ labels?.[run.nodeID] ?? run.nodeID }}</span>\n <span class=\"inventory-run-date\">{{ run.createdAt | date:'short' }}</span>\n </div>\n <!-- One that places a finished inventory's detections again: no panorama is analysed. -->\n <div class=\"inventory-run-reused\" *ngIf=\"reusedFrom(run) as source\">\n {{ 'Detections of {{date}} placed again with another cutoff: no panorama is analysed.' | translate: { date: (source.createdAt | date:'short') } }}\n <span class=\"inventory-run-detail\">\n {{ 'Cutoff {{before}} \u2192 {{now}}' | translate: { before: source.cutoffScore, now: run.cutoffScore } }}<ng-container\n *ngIf=\"source.objectsFound != null\">. {{ 'Equipment before' | translate }}: {{ source.objectsFound }}</ng-container>\n </span>\n </div>\n <ng-container [ngSwitch]=\"inventoryService.state(run)\">\n <div *ngSwitchCase=\"'waiting'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{ (reusedFrom(run) ? 'Starting the task on AWS\u2026' : 'Waiting for the analysis to start\u2026') | translate }}\n </div>\n <div *ngSwitchCase=\"'running'\">\n <ng-container [ngSwitch]=\"run.step\">\n <div *ngSwitchCase=\"'DOWNLOADING'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{ (reusedFrom(run) ? 'Taking the saved detections and the panoramas\u2026' : 'Downloading the files of the visit\u2026') | translate }}\n </div>\n <div *ngSwitchCase=\"'PLACING'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{'Placing the objects in 3D\u2026' | translate}}\n </div>\n <div *ngSwitchCase=\"'SAVING'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{'Saving the equipment\u2026' | translate}}\n </div>\n <!-- Nothing to analyse: the objects above the new cutoff are counted at once. -->\n <div *ngSwitchDefault>\n <ng-container *ngIf=\"reusedFrom(run); else analysing\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n <span *ngIf=\"run.objectsFound != null\">\n {{ 'Objects above the cutoff of {{cutoff}}' | translate: { cutoff: run.cutoffScore } }}: {{ run.objectsFound }}\n </span>\n </ng-container>\n </div>\n <ng-template #analysing>\n <ng-container *ngTemplateOutlet=\"panoramas; context: { $implicit: run }\"></ng-container>\n <span class=\"inventory-run-detail\" *ngIf=\"minutesLeft(run) as minutes\">\n {{'About' | translate}} {{ minutes }} {{'min left' | translate}}\n </span>\n <!-- Counted by the image that detects down to a floor; null from older ones. -->\n <span class=\"inventory-run-detail\" *ngIf=\"run.objectsFound != null\">\n {{ 'Objects above the cutoff of {{cutoff}} so far' | translate: { cutoff: run.cutoffScore } }}: {{ run.objectsFound }}\n </span>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"inventoryService.canCancel(run)\">\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill mt-2\"\n *ngIf=\"confirmingCancel !== run.id\" (click)=\"confirmingCancel = run.id\">\n {{'Cancel the inventory' | translate}}</button>\n <div class=\"inventory-run-confirm\" *ngIf=\"confirmingCancel === run.id\">\n <span>{{'It stops after the panorama it is on. Those analysed are kept, to resume from there.' | translate}}</span>\n <div class=\"mt-1\">\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill me-2\"\n [disabled]=\"busy === run.id\" (click)=\"onConfirmCancel(run)\">\n {{'Yes, cancel' | translate}}</button>\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill\"\n [disabled]=\"busy === run.id\" (click)=\"confirmingCancel = null\">\n {{'No, go on' | translate}}</button>\n </div>\n </div>\n </ng-container>\n </div>\n <div *ngSwitchCase=\"'cancelling'\" class=\"text-warning\">\n <ng-container *ngTemplateOutlet=\"panoramas; context: { $implicit: run }\"></ng-container>\n {{'Cancelling: it stops after the panorama it is on\u2026' | translate}}\n </div>\n <div *ngSwitchCase=\"'cancelled'\">\n <span class=\"text-warning\">{{'Cancelled' | translate}}.</span>\n <span class=\"inventory-run-detail\" *ngIf=\"run.imagesTotal\">\n {{'Panoramas analysed' | translate}}: {{ run.imagesDone ?? 0 }} / {{ run.imagesTotal }}\n </span>\n </div>\n <div *ngSwitchCase=\"'done'\" class=\"text-success\">\n <!-- How many, when the task says so: the image before inventory_job.py does not. -->\n <ng-container *ngIf=\"run.objectsFound != null; else doneOnly\">\n {{'Done' | translate}}: {{ run.objectsFound }} {{'equipment added' | translate}}.\n </ng-container>\n <ng-template #doneOnly>{{'Done' | translate}}.</ng-template>\n <span class=\"inventory-run-detail\">{{'Reload the page to see them in the list.' | translate}}</span>\n </div>\n <div *ngSwitchCase=\"'failed'\" class=\"text-danger\">\n {{ inventoryService.failure(run) | translate }}\n <span class=\"inventory-run-detail\" *ngIf=\"run.errorMessage\">{{ run.errorMessage }}</span>\n </div>\n <div *ngSwitchCase=\"'stale'\" class=\"text-warning\">\n {{'No news since' | translate}} {{ run.updatedAt | date:'short' }}:\n {{'the analysis has probably stopped.' | translate}}\n </div>\n </ng-container>\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill mt-2\"\n *ngIf=\"inventoryService.canResume(run)\" [disabled]=\"busy === run.id\" (click)=\"onResume(run)\">\n {{'Resume from where it stopped' | translate}} ({{ run.imagesDone }} / {{ run.imagesTotal }})</button>\n </div>\n <div class=\"text-danger\" *ngIf=\"message\">{{ message | translate }}</div>\n</div>\n\n<!-- Something is being done, of which there is nothing to count. -->\n<ng-template #busyBar>\n <div class=\"progress mb-1\" role=\"progressbar\" aria-label=\"\u2026\">\n <div class=\"progress-bar progress-bar-striped progress-bar-animated\" style=\"width: 100%\"></div>\n </div>\n</ng-template>\n\n<ng-template #panoramas let-run>\n <div class=\"progress\" role=\"progressbar\" [attr.aria-valuenow]=\"inventoryService.percent(run)\"\n aria-valuemin=\"0\" aria-valuemax=\"100\">\n <div class=\"progress-bar\" [style.width.%]=\"inventoryService.percent(run)\"></div>\n </div>\n <div class=\"inventory-run-detail\">\n {{'Panoramas analysed' | translate}}: {{ run.imagesDone ?? 0 }} / {{ run.imagesTotal }}\n ({{ inventoryService.percent(run) }}%)\n </div>\n</ng-template>\n", styles: [".inventory-runs{margin-top:1em}.inventory-runs h5{color:var(--smarterplan-primary)}.inventory-runs .inventory-run{background-color:#fff;border-radius:.25rem;padding:.5rem;margin-bottom:.5rem}.inventory-runs .inventory-run .inventory-run-header{display:flex;justify-content:space-between;gap:.5rem;margin-bottom:.25rem}.inventory-runs .inventory-run .inventory-run-date,.inventory-runs .inventory-run .inventory-run-detail{font-size:.8rem;color:#6c757d}.inventory-runs .inventory-run .inventory-run-detail{display:block}.inventory-runs .inventory-run .inventory-run-reused{font-size:.85rem;margin-bottom:.25rem}.inventory-runs .inventory-run .progress-bar{background-color:var(--smarterplan-primary)}.inventory-runs .inventory-run .inventory-run-confirm{margin-top:.5rem;font-size:.85rem}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
19822
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: InventoryRunsComponent, selector: "lib-inventory-runs", inputs: { spaceID: "spaceID", nodeIDs: "nodeIDs", labels: "labels" }, outputs: { runningChange: "runningChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"inventory-runs\" *ngIf=\"runs.length\">\r\n <h5>{{'Last inventory' | translate}}</h5>\r\n <div class=\"inventory-run\" *ngFor=\"let run of runs\">\r\n <div class=\"inventory-run-header\">\r\n <span class=\"no-lowercase\">{{ labels?.[run.nodeID] ?? run.nodeID }}</span>\r\n <span class=\"inventory-run-date\">{{ run.createdAt | date:'short' }}</span>\r\n </div>\r\n <!-- One that places a finished inventory's detections again: no panorama is analysed. -->\r\n <div class=\"inventory-run-reused\" *ngIf=\"reusedFrom(run) as source\">\r\n {{ 'Detections of {{date}} placed again with another cutoff: no panorama is analysed.' | translate: { date: (source.createdAt | date:'short') } }}\r\n <span class=\"inventory-run-detail\">\r\n {{ 'Cutoff {{before}} \u2192 {{now}}' | translate: { before: source.cutoffScore, now: run.cutoffScore } }}<ng-container\r\n *ngIf=\"source.objectsFound != null\">. {{ 'Equipment before' | translate }}: {{ source.objectsFound }}</ng-container>\r\n </span>\r\n </div>\r\n <ng-container [ngSwitch]=\"inventoryService.state(run)\">\r\n <div *ngSwitchCase=\"'waiting'\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n {{ (reusedFrom(run) ? 'Starting the task on AWS\u2026' : 'Waiting for the analysis to start\u2026') | translate }}\r\n </div>\r\n <div *ngSwitchCase=\"'running'\">\r\n <ng-container [ngSwitch]=\"run.step\">\r\n <div *ngSwitchCase=\"'DOWNLOADING'\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n {{ (reusedFrom(run) ? 'Taking the saved detections and the panoramas\u2026' : 'Downloading the files of the visit\u2026') | translate }}\r\n </div>\r\n <div *ngSwitchCase=\"'PLACING'\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n {{'Placing the objects in 3D\u2026' | translate}}\r\n </div>\r\n <div *ngSwitchCase=\"'SAVING'\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n {{'Saving the equipment\u2026' | translate}}\r\n </div>\r\n <!-- Nothing to analyse: the objects above the new cutoff are counted at once. -->\r\n <div *ngSwitchDefault>\r\n <ng-container *ngIf=\"reusedFrom(run); else analysing\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n <span *ngIf=\"run.objectsFound != null\">\r\n {{ 'Objects above the cutoff of {{cutoff}}' | translate: { cutoff: run.cutoffScore } }}: {{ run.objectsFound }}\r\n </span>\r\n </ng-container>\r\n </div>\r\n <ng-template #analysing>\r\n <ng-container *ngTemplateOutlet=\"panoramas; context: { $implicit: run }\"></ng-container>\r\n <span class=\"inventory-run-detail\" *ngIf=\"minutesLeft(run) as minutes\">\r\n {{'About' | translate}} {{ minutes }} {{'min left' | translate}}\r\n </span>\r\n <!-- Counted by the image that detects down to a floor; null from older ones. -->\r\n <span class=\"inventory-run-detail\" *ngIf=\"run.objectsFound != null\">\r\n {{ 'Objects above the cutoff of {{cutoff}} so far' | translate: { cutoff: run.cutoffScore } }}: {{ run.objectsFound }}\r\n </span>\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngIf=\"inventoryService.canCancel(run)\">\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill mt-2\"\r\n *ngIf=\"confirmingCancel !== run.id\" (click)=\"confirmingCancel = run.id\">\r\n {{'Cancel the inventory' | translate}}</button>\r\n <div class=\"inventory-run-confirm\" *ngIf=\"confirmingCancel === run.id\">\r\n <span>{{'It stops after the panorama it is on. Those analysed are kept, to resume from there.' | translate}}</span>\r\n <div class=\"mt-1\">\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill me-2\"\r\n [disabled]=\"busy === run.id\" (click)=\"onConfirmCancel(run)\">\r\n {{'Yes, cancel' | translate}}</button>\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill\"\r\n [disabled]=\"busy === run.id\" (click)=\"confirmingCancel = null\">\r\n {{'No, go on' | translate}}</button>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div *ngSwitchCase=\"'cancelling'\" class=\"text-warning\">\r\n <ng-container *ngTemplateOutlet=\"panoramas; context: { $implicit: run }\"></ng-container>\r\n {{'Cancelling: it stops after the panorama it is on\u2026' | translate}}\r\n </div>\r\n <div *ngSwitchCase=\"'cancelled'\">\r\n <span class=\"text-warning\">{{'Cancelled' | translate}}.</span>\r\n <span class=\"inventory-run-detail\" *ngIf=\"run.imagesTotal\">\r\n {{'Panoramas analysed' | translate}}: {{ run.imagesDone ?? 0 }} / {{ run.imagesTotal }}\r\n </span>\r\n </div>\r\n <div *ngSwitchCase=\"'done'\" class=\"text-success\">\r\n <!-- How many, when the task says so: the image before inventory_job.py does not. -->\r\n <ng-container *ngIf=\"run.objectsFound != null; else doneOnly\">\r\n {{'Done' | translate}}: {{ run.objectsFound }} {{'equipment added' | translate}}.\r\n </ng-container>\r\n <ng-template #doneOnly>{{'Done' | translate}}.</ng-template>\r\n <span class=\"inventory-run-detail\">{{'Reload the page to see them in the list.' | translate}}</span>\r\n </div>\r\n <div *ngSwitchCase=\"'failed'\" class=\"text-danger\">\r\n {{ inventoryService.failure(run) | translate }}\r\n <span class=\"inventory-run-detail\" *ngIf=\"run.errorMessage\">{{ run.errorMessage }}</span>\r\n </div>\r\n <div *ngSwitchCase=\"'stale'\" class=\"text-warning\">\r\n {{'No news since' | translate}} {{ run.updatedAt | date:'short' }}:\r\n {{'the analysis has probably stopped.' | translate}}\r\n </div>\r\n </ng-container>\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill mt-2\"\r\n *ngIf=\"inventoryService.canResume(run)\" [disabled]=\"busy === run.id\" (click)=\"onResume(run)\">\r\n {{'Resume from where it stopped' | translate}} ({{ run.imagesDone }} / {{ run.imagesTotal }})</button>\r\n </div>\r\n <div class=\"text-danger\" *ngIf=\"message\">{{ message | translate }}</div>\r\n</div>\r\n\r\n<!-- Something is being done, of which there is nothing to count. -->\r\n<ng-template #busyBar>\r\n <div class=\"progress mb-1\" role=\"progressbar\" aria-label=\"\u2026\">\r\n <div class=\"progress-bar progress-bar-striped progress-bar-animated\" style=\"width: 100%\"></div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #panoramas let-run>\r\n <div class=\"progress\" role=\"progressbar\" [attr.aria-valuenow]=\"inventoryService.percent(run)\"\r\n aria-valuemin=\"0\" aria-valuemax=\"100\">\r\n <div class=\"progress-bar\" [style.width.%]=\"inventoryService.percent(run)\"></div>\r\n </div>\r\n <div class=\"inventory-run-detail\">\r\n {{'Panoramas analysed' | translate}}: {{ run.imagesDone ?? 0 }} / {{ run.imagesTotal }}\r\n ({{ inventoryService.percent(run) }}%)\r\n </div>\r\n</ng-template>\r\n", styles: [".inventory-runs{margin-top:1em}.inventory-runs h5{color:var(--smarterplan-primary)}.inventory-runs .inventory-run{background-color:#fff;border-radius:.25rem;padding:.5rem;margin-bottom:.5rem}.inventory-runs .inventory-run .inventory-run-header{display:flex;justify-content:space-between;gap:.5rem;margin-bottom:.25rem}.inventory-runs .inventory-run .inventory-run-date,.inventory-runs .inventory-run .inventory-run-detail{font-size:.8rem;color:#6c757d}.inventory-runs .inventory-run .inventory-run-detail{display:block}.inventory-runs .inventory-run .inventory-run-reused{font-size:.85rem;margin-bottom:.25rem}.inventory-runs .inventory-run .progress-bar{background-color:var(--smarterplan-primary)}.inventory-runs .inventory-run .inventory-run-confirm{margin-top:.5rem;font-size:.85rem}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
19609
19823
|
}
|
|
19610
19824
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryRunsComponent, decorators: [{
|
|
19611
19825
|
type: Component,
|
|
19612
|
-
args: [{ selector: "lib-inventory-runs", template: "<div class=\"inventory-runs\" *ngIf=\"runs.length\">\n <h5>{{'Last inventory' | translate}}</h5>\n <div class=\"inventory-run\" *ngFor=\"let run of runs\">\n <div class=\"inventory-run-header\">\n <span class=\"no-lowercase\">{{ labels?.[run.nodeID] ?? run.nodeID }}</span>\n <span class=\"inventory-run-date\">{{ run.createdAt | date:'short' }}</span>\n </div>\n <!-- One that places a finished inventory's detections again: no panorama is analysed. -->\n <div class=\"inventory-run-reused\" *ngIf=\"reusedFrom(run) as source\">\n {{ 'Detections of {{date}} placed again with another cutoff: no panorama is analysed.' | translate: { date: (source.createdAt | date:'short') } }}\n <span class=\"inventory-run-detail\">\n {{ 'Cutoff {{before}} \u2192 {{now}}' | translate: { before: source.cutoffScore, now: run.cutoffScore } }}<ng-container\n *ngIf=\"source.objectsFound != null\">. {{ 'Equipment before' | translate }}: {{ source.objectsFound }}</ng-container>\n </span>\n </div>\n <ng-container [ngSwitch]=\"inventoryService.state(run)\">\n <div *ngSwitchCase=\"'waiting'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{ (reusedFrom(run) ? 'Starting the task on AWS\u2026' : 'Waiting for the analysis to start\u2026') | translate }}\n </div>\n <div *ngSwitchCase=\"'running'\">\n <ng-container [ngSwitch]=\"run.step\">\n <div *ngSwitchCase=\"'DOWNLOADING'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{ (reusedFrom(run) ? 'Taking the saved detections and the panoramas\u2026' : 'Downloading the files of the visit\u2026') | translate }}\n </div>\n <div *ngSwitchCase=\"'PLACING'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{'Placing the objects in 3D\u2026' | translate}}\n </div>\n <div *ngSwitchCase=\"'SAVING'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{'Saving the equipment\u2026' | translate}}\n </div>\n <!-- Nothing to analyse: the objects above the new cutoff are counted at once. -->\n <div *ngSwitchDefault>\n <ng-container *ngIf=\"reusedFrom(run); else analysing\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n <span *ngIf=\"run.objectsFound != null\">\n {{ 'Objects above the cutoff of {{cutoff}}' | translate: { cutoff: run.cutoffScore } }}: {{ run.objectsFound }}\n </span>\n </ng-container>\n </div>\n <ng-template #analysing>\n <ng-container *ngTemplateOutlet=\"panoramas; context: { $implicit: run }\"></ng-container>\n <span class=\"inventory-run-detail\" *ngIf=\"minutesLeft(run) as minutes\">\n {{'About' | translate}} {{ minutes }} {{'min left' | translate}}\n </span>\n <!-- Counted by the image that detects down to a floor; null from older ones. -->\n <span class=\"inventory-run-detail\" *ngIf=\"run.objectsFound != null\">\n {{ 'Objects above the cutoff of {{cutoff}} so far' | translate: { cutoff: run.cutoffScore } }}: {{ run.objectsFound }}\n </span>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"inventoryService.canCancel(run)\">\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill mt-2\"\n *ngIf=\"confirmingCancel !== run.id\" (click)=\"confirmingCancel = run.id\">\n {{'Cancel the inventory' | translate}}</button>\n <div class=\"inventory-run-confirm\" *ngIf=\"confirmingCancel === run.id\">\n <span>{{'It stops after the panorama it is on. Those analysed are kept, to resume from there.' | translate}}</span>\n <div class=\"mt-1\">\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill me-2\"\n [disabled]=\"busy === run.id\" (click)=\"onConfirmCancel(run)\">\n {{'Yes, cancel' | translate}}</button>\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill\"\n [disabled]=\"busy === run.id\" (click)=\"confirmingCancel = null\">\n {{'No, go on' | translate}}</button>\n </div>\n </div>\n </ng-container>\n </div>\n <div *ngSwitchCase=\"'cancelling'\" class=\"text-warning\">\n <ng-container *ngTemplateOutlet=\"panoramas; context: { $implicit: run }\"></ng-container>\n {{'Cancelling: it stops after the panorama it is on\u2026' | translate}}\n </div>\n <div *ngSwitchCase=\"'cancelled'\">\n <span class=\"text-warning\">{{'Cancelled' | translate}}.</span>\n <span class=\"inventory-run-detail\" *ngIf=\"run.imagesTotal\">\n {{'Panoramas analysed' | translate}}: {{ run.imagesDone ?? 0 }} / {{ run.imagesTotal }}\n </span>\n </div>\n <div *ngSwitchCase=\"'done'\" class=\"text-success\">\n <!-- How many, when the task says so: the image before inventory_job.py does not. -->\n <ng-container *ngIf=\"run.objectsFound != null; else doneOnly\">\n {{'Done' | translate}}: {{ run.objectsFound }} {{'equipment added' | translate}}.\n </ng-container>\n <ng-template #doneOnly>{{'Done' | translate}}.</ng-template>\n <span class=\"inventory-run-detail\">{{'Reload the page to see them in the list.' | translate}}</span>\n </div>\n <div *ngSwitchCase=\"'failed'\" class=\"text-danger\">\n {{ inventoryService.failure(run) | translate }}\n <span class=\"inventory-run-detail\" *ngIf=\"run.errorMessage\">{{ run.errorMessage }}</span>\n </div>\n <div *ngSwitchCase=\"'stale'\" class=\"text-warning\">\n {{'No news since' | translate}} {{ run.updatedAt | date:'short' }}:\n {{'the analysis has probably stopped.' | translate}}\n </div>\n </ng-container>\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill mt-2\"\n *ngIf=\"inventoryService.canResume(run)\" [disabled]=\"busy === run.id\" (click)=\"onResume(run)\">\n {{'Resume from where it stopped' | translate}} ({{ run.imagesDone }} / {{ run.imagesTotal }})</button>\n </div>\n <div class=\"text-danger\" *ngIf=\"message\">{{ message | translate }}</div>\n</div>\n\n<!-- Something is being done, of which there is nothing to count. -->\n<ng-template #busyBar>\n <div class=\"progress mb-1\" role=\"progressbar\" aria-label=\"\u2026\">\n <div class=\"progress-bar progress-bar-striped progress-bar-animated\" style=\"width: 100%\"></div>\n </div>\n</ng-template>\n\n<ng-template #panoramas let-run>\n <div class=\"progress\" role=\"progressbar\" [attr.aria-valuenow]=\"inventoryService.percent(run)\"\n aria-valuemin=\"0\" aria-valuemax=\"100\">\n <div class=\"progress-bar\" [style.width.%]=\"inventoryService.percent(run)\"></div>\n </div>\n <div class=\"inventory-run-detail\">\n {{'Panoramas analysed' | translate}}: {{ run.imagesDone ?? 0 }} / {{ run.imagesTotal }}\n ({{ inventoryService.percent(run) }}%)\n </div>\n</ng-template>\n", styles: [".inventory-runs{margin-top:1em}.inventory-runs h5{color:var(--smarterplan-primary)}.inventory-runs .inventory-run{background-color:#fff;border-radius:.25rem;padding:.5rem;margin-bottom:.5rem}.inventory-runs .inventory-run .inventory-run-header{display:flex;justify-content:space-between;gap:.5rem;margin-bottom:.25rem}.inventory-runs .inventory-run .inventory-run-date,.inventory-runs .inventory-run .inventory-run-detail{font-size:.8rem;color:#6c757d}.inventory-runs .inventory-run .inventory-run-detail{display:block}.inventory-runs .inventory-run .inventory-run-reused{font-size:.85rem;margin-bottom:.25rem}.inventory-runs .inventory-run .progress-bar{background-color:var(--smarterplan-primary)}.inventory-runs .inventory-run .inventory-run-confirm{margin-top:.5rem;font-size:.85rem}\n"] }]
|
|
19826
|
+
args: [{ selector: "lib-inventory-runs", template: "<div class=\"inventory-runs\" *ngIf=\"runs.length\">\r\n <h5>{{'Last inventory' | translate}}</h5>\r\n <div class=\"inventory-run\" *ngFor=\"let run of runs\">\r\n <div class=\"inventory-run-header\">\r\n <span class=\"no-lowercase\">{{ labels?.[run.nodeID] ?? run.nodeID }}</span>\r\n <span class=\"inventory-run-date\">{{ run.createdAt | date:'short' }}</span>\r\n </div>\r\n <!-- One that places a finished inventory's detections again: no panorama is analysed. -->\r\n <div class=\"inventory-run-reused\" *ngIf=\"reusedFrom(run) as source\">\r\n {{ 'Detections of {{date}} placed again with another cutoff: no panorama is analysed.' | translate: { date: (source.createdAt | date:'short') } }}\r\n <span class=\"inventory-run-detail\">\r\n {{ 'Cutoff {{before}} \u2192 {{now}}' | translate: { before: source.cutoffScore, now: run.cutoffScore } }}<ng-container\r\n *ngIf=\"source.objectsFound != null\">. {{ 'Equipment before' | translate }}: {{ source.objectsFound }}</ng-container>\r\n </span>\r\n </div>\r\n <ng-container [ngSwitch]=\"inventoryService.state(run)\">\r\n <div *ngSwitchCase=\"'waiting'\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n {{ (reusedFrom(run) ? 'Starting the task on AWS\u2026' : 'Waiting for the analysis to start\u2026') | translate }}\r\n </div>\r\n <div *ngSwitchCase=\"'running'\">\r\n <ng-container [ngSwitch]=\"run.step\">\r\n <div *ngSwitchCase=\"'DOWNLOADING'\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n {{ (reusedFrom(run) ? 'Taking the saved detections and the panoramas\u2026' : 'Downloading the files of the visit\u2026') | translate }}\r\n </div>\r\n <div *ngSwitchCase=\"'PLACING'\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n {{'Placing the objects in 3D\u2026' | translate}}\r\n </div>\r\n <div *ngSwitchCase=\"'SAVING'\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n {{'Saving the equipment\u2026' | translate}}\r\n </div>\r\n <!-- Nothing to analyse: the objects above the new cutoff are counted at once. -->\r\n <div *ngSwitchDefault>\r\n <ng-container *ngIf=\"reusedFrom(run); else analysing\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n <span *ngIf=\"run.objectsFound != null\">\r\n {{ 'Objects above the cutoff of {{cutoff}}' | translate: { cutoff: run.cutoffScore } }}: {{ run.objectsFound }}\r\n </span>\r\n </ng-container>\r\n </div>\r\n <ng-template #analysing>\r\n <ng-container *ngTemplateOutlet=\"panoramas; context: { $implicit: run }\"></ng-container>\r\n <span class=\"inventory-run-detail\" *ngIf=\"minutesLeft(run) as minutes\">\r\n {{'About' | translate}} {{ minutes }} {{'min left' | translate}}\r\n </span>\r\n <!-- Counted by the image that detects down to a floor; null from older ones. -->\r\n <span class=\"inventory-run-detail\" *ngIf=\"run.objectsFound != null\">\r\n {{ 'Objects above the cutoff of {{cutoff}} so far' | translate: { cutoff: run.cutoffScore } }}: {{ run.objectsFound }}\r\n </span>\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngIf=\"inventoryService.canCancel(run)\">\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill mt-2\"\r\n *ngIf=\"confirmingCancel !== run.id\" (click)=\"confirmingCancel = run.id\">\r\n {{'Cancel the inventory' | translate}}</button>\r\n <div class=\"inventory-run-confirm\" *ngIf=\"confirmingCancel === run.id\">\r\n <span>{{'It stops after the panorama it is on. Those analysed are kept, to resume from there.' | translate}}</span>\r\n <div class=\"mt-1\">\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill me-2\"\r\n [disabled]=\"busy === run.id\" (click)=\"onConfirmCancel(run)\">\r\n {{'Yes, cancel' | translate}}</button>\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill\"\r\n [disabled]=\"busy === run.id\" (click)=\"confirmingCancel = null\">\r\n {{'No, go on' | translate}}</button>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div *ngSwitchCase=\"'cancelling'\" class=\"text-warning\">\r\n <ng-container *ngTemplateOutlet=\"panoramas; context: { $implicit: run }\"></ng-container>\r\n {{'Cancelling: it stops after the panorama it is on\u2026' | translate}}\r\n </div>\r\n <div *ngSwitchCase=\"'cancelled'\">\r\n <span class=\"text-warning\">{{'Cancelled' | translate}}.</span>\r\n <span class=\"inventory-run-detail\" *ngIf=\"run.imagesTotal\">\r\n {{'Panoramas analysed' | translate}}: {{ run.imagesDone ?? 0 }} / {{ run.imagesTotal }}\r\n </span>\r\n </div>\r\n <div *ngSwitchCase=\"'done'\" class=\"text-success\">\r\n <!-- How many, when the task says so: the image before inventory_job.py does not. -->\r\n <ng-container *ngIf=\"run.objectsFound != null; else doneOnly\">\r\n {{'Done' | translate}}: {{ run.objectsFound }} {{'equipment added' | translate}}.\r\n </ng-container>\r\n <ng-template #doneOnly>{{'Done' | translate}}.</ng-template>\r\n <span class=\"inventory-run-detail\">{{'Reload the page to see them in the list.' | translate}}</span>\r\n </div>\r\n <div *ngSwitchCase=\"'failed'\" class=\"text-danger\">\r\n {{ inventoryService.failure(run) | translate }}\r\n <span class=\"inventory-run-detail\" *ngIf=\"run.errorMessage\">{{ run.errorMessage }}</span>\r\n </div>\r\n <div *ngSwitchCase=\"'stale'\" class=\"text-warning\">\r\n {{'No news since' | translate}} {{ run.updatedAt | date:'short' }}:\r\n {{'the analysis has probably stopped.' | translate}}\r\n </div>\r\n </ng-container>\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill mt-2\"\r\n *ngIf=\"inventoryService.canResume(run)\" [disabled]=\"busy === run.id\" (click)=\"onResume(run)\">\r\n {{'Resume from where it stopped' | translate}} ({{ run.imagesDone }} / {{ run.imagesTotal }})</button>\r\n </div>\r\n <div class=\"text-danger\" *ngIf=\"message\">{{ message | translate }}</div>\r\n</div>\r\n\r\n<!-- Something is being done, of which there is nothing to count. -->\r\n<ng-template #busyBar>\r\n <div class=\"progress mb-1\" role=\"progressbar\" aria-label=\"\u2026\">\r\n <div class=\"progress-bar progress-bar-striped progress-bar-animated\" style=\"width: 100%\"></div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #panoramas let-run>\r\n <div class=\"progress\" role=\"progressbar\" [attr.aria-valuenow]=\"inventoryService.percent(run)\"\r\n aria-valuemin=\"0\" aria-valuemax=\"100\">\r\n <div class=\"progress-bar\" [style.width.%]=\"inventoryService.percent(run)\"></div>\r\n </div>\r\n <div class=\"inventory-run-detail\">\r\n {{'Panoramas analysed' | translate}}: {{ run.imagesDone ?? 0 }} / {{ run.imagesTotal }}\r\n ({{ inventoryService.percent(run) }}%)\r\n </div>\r\n</ng-template>\r\n", styles: [".inventory-runs{margin-top:1em}.inventory-runs h5{color:var(--smarterplan-primary)}.inventory-runs .inventory-run{background-color:#fff;border-radius:.25rem;padding:.5rem;margin-bottom:.5rem}.inventory-runs .inventory-run .inventory-run-header{display:flex;justify-content:space-between;gap:.5rem;margin-bottom:.25rem}.inventory-runs .inventory-run .inventory-run-date,.inventory-runs .inventory-run .inventory-run-detail{font-size:.8rem;color:#6c757d}.inventory-runs .inventory-run .inventory-run-detail{display:block}.inventory-runs .inventory-run .inventory-run-reused{font-size:.85rem;margin-bottom:.25rem}.inventory-runs .inventory-run .progress-bar{background-color:var(--smarterplan-primary)}.inventory-runs .inventory-run .inventory-run-confirm{margin-top:.5rem;font-size:.85rem}\n"] }]
|
|
19613
19827
|
}], ctorParameters: () => [{ type: InventoryService }], propDecorators: { spaceID: [{
|
|
19614
19828
|
type: Input
|
|
19615
19829
|
}], nodeIDs: [{
|
|
@@ -19723,98 +19937,98 @@ class InventoryFilesComponent {
|
|
|
19723
19937
|
}
|
|
19724
19938
|
}
|
|
19725
19939
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryFilesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
19726
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: InventoryFilesComponent, selector: "lib-inventory-files", inputs: { files: "files", model3D: "model3D", disabled: "disabled" }, outputs: { filesChange: "filesChange" }, ngImport: i0, template: `
|
|
19727
|
-
<ul class="inventory-files" *ngIf="files; else unknown">
|
|
19728
|
-
<li [class.missing]="!files.panoramas">
|
|
19729
|
-
{{ files.panoramas ? "✓" : "✗" }} {{ "Panoramas" | translate }}: {{ files.panoramas }}
|
|
19730
|
-
<span class="hint" *ngIf="!files.panoramas">{{ "Import the 360° images of the visit first." | translate }}</span>
|
|
19731
|
-
</li>
|
|
19732
|
-
<li [class.missing]="!files.dataJson">
|
|
19733
|
-
{{ files.dataJson ? "✓" : "✗" }} {{ "Panorama positions" | translate }} (data.json)
|
|
19734
|
-
<span class="hint" *ngIf="!files.dataJson">{{ "Import all the images of the visit again (Virtual Visits): the import writes it." | translate }}</span>
|
|
19735
|
-
<ng-container *ngTemplateOutlet="actions; context: { $implicit: positionsFile }"></ng-container>
|
|
19736
|
-
</li>
|
|
19737
|
-
<li [class.missing]="!files.modelObj">
|
|
19738
|
-
{{ files.modelObj ? "✓" : "✗" }} {{ "3D mesh" | translate }} (model.obj)
|
|
19739
|
-
<span class="hint" *ngIf="!files.modelObj">{{ "The .obj of the visit's MatterPak, from Matterport. Its textures are not needed." | translate }}</span>
|
|
19740
|
-
<ng-container *ngTemplateOutlet="actions; context: { $implicit: meshFile }"></ng-container>
|
|
19741
|
-
</li>
|
|
19742
|
-
</ul>
|
|
19743
|
-
<ng-template #actions let-file>
|
|
19744
|
-
<span class="file-actions" *ngIf="sending !== file && confirmingDelete !== file">
|
|
19745
|
-
<label class="btn btn-sm btn-outline-primary rounded-pill upload" [class.disabled]="locked">
|
|
19746
|
-
<input type="file" [accept]="file.accept" [disabled]="locked" (change)="onFileSelected(file, $event)">
|
|
19747
|
-
{{ (files[file.field] ? "Replace" : file.send) | translate }}
|
|
19748
|
-
</label>
|
|
19749
|
-
<button type="button" class="btn btn-sm btn-outline-danger rounded-pill delete" *ngIf="files[file.field]"
|
|
19750
|
-
[disabled]="locked" (click)="confirmingDelete = file">{{ "Delete" | translate }}</button>
|
|
19751
|
-
</span>
|
|
19752
|
-
<span class="file-actions" *ngIf="confirmingDelete === file">
|
|
19753
|
-
<span>{{ "Delete this file?" | translate }}</span>
|
|
19754
|
-
<button type="button" class="btn btn-sm btn-danger rounded-pill confirm" [disabled]="locked"
|
|
19755
|
-
(click)="onDeleteConfirmed(file)">{{ "Yes, delete" | translate }}</button>
|
|
19756
|
-
<button type="button" class="btn btn-sm btn-outline-secondary rounded-pill" [disabled]="deletingFile === file"
|
|
19757
|
-
(click)="confirmingDelete = null">{{ "No" | translate }}</button>
|
|
19758
|
-
</span>
|
|
19759
|
-
<span *ngIf="sending === file" class="sending">
|
|
19760
|
-
<span class="progress" role="progressbar" [attr.aria-valuenow]="uploadPercent" aria-valuemin="0" aria-valuemax="100">
|
|
19761
|
-
<span class="progress-bar" [style.width.%]="uploadPercent"></span>
|
|
19762
|
-
</span>
|
|
19763
|
-
{{ "Sending" | translate }} {{ uploadName }}: {{ uploadPercent }}%
|
|
19764
|
-
</span>
|
|
19765
|
-
<span class="error" *ngIf="errorFile === file">{{ error | translate }}</span>
|
|
19766
|
-
</ng-template>
|
|
19767
|
-
<ng-template #unknown>
|
|
19768
|
-
<p class="hint">{{ "The files of the visit could not be checked." | translate }}</p>
|
|
19769
|
-
</ng-template>
|
|
19940
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: InventoryFilesComponent, selector: "lib-inventory-files", inputs: { files: "files", model3D: "model3D", disabled: "disabled" }, outputs: { filesChange: "filesChange" }, ngImport: i0, template: `
|
|
19941
|
+
<ul class="inventory-files" *ngIf="files; else unknown">
|
|
19942
|
+
<li [class.missing]="!files.panoramas">
|
|
19943
|
+
{{ files.panoramas ? "✓" : "✗" }} {{ "Panoramas" | translate }}: {{ files.panoramas }}
|
|
19944
|
+
<span class="hint" *ngIf="!files.panoramas">{{ "Import the 360° images of the visit first." | translate }}</span>
|
|
19945
|
+
</li>
|
|
19946
|
+
<li [class.missing]="!files.dataJson">
|
|
19947
|
+
{{ files.dataJson ? "✓" : "✗" }} {{ "Panorama positions" | translate }} (data.json)
|
|
19948
|
+
<span class="hint" *ngIf="!files.dataJson">{{ "Import all the images of the visit again (Virtual Visits): the import writes it." | translate }}</span>
|
|
19949
|
+
<ng-container *ngTemplateOutlet="actions; context: { $implicit: positionsFile }"></ng-container>
|
|
19950
|
+
</li>
|
|
19951
|
+
<li [class.missing]="!files.modelObj">
|
|
19952
|
+
{{ files.modelObj ? "✓" : "✗" }} {{ "3D mesh" | translate }} (model.obj)
|
|
19953
|
+
<span class="hint" *ngIf="!files.modelObj">{{ "The .obj of the visit's MatterPak, from Matterport. Its textures are not needed." | translate }}</span>
|
|
19954
|
+
<ng-container *ngTemplateOutlet="actions; context: { $implicit: meshFile }"></ng-container>
|
|
19955
|
+
</li>
|
|
19956
|
+
</ul>
|
|
19957
|
+
<ng-template #actions let-file>
|
|
19958
|
+
<span class="file-actions" *ngIf="sending !== file && confirmingDelete !== file">
|
|
19959
|
+
<label class="btn btn-sm btn-outline-primary rounded-pill upload" [class.disabled]="locked">
|
|
19960
|
+
<input type="file" [accept]="file.accept" [disabled]="locked" (change)="onFileSelected(file, $event)">
|
|
19961
|
+
{{ (files[file.field] ? "Replace" : file.send) | translate }}
|
|
19962
|
+
</label>
|
|
19963
|
+
<button type="button" class="btn btn-sm btn-outline-danger rounded-pill delete" *ngIf="files[file.field]"
|
|
19964
|
+
[disabled]="locked" (click)="confirmingDelete = file">{{ "Delete" | translate }}</button>
|
|
19965
|
+
</span>
|
|
19966
|
+
<span class="file-actions" *ngIf="confirmingDelete === file">
|
|
19967
|
+
<span>{{ "Delete this file?" | translate }}</span>
|
|
19968
|
+
<button type="button" class="btn btn-sm btn-danger rounded-pill confirm" [disabled]="locked"
|
|
19969
|
+
(click)="onDeleteConfirmed(file)">{{ "Yes, delete" | translate }}</button>
|
|
19970
|
+
<button type="button" class="btn btn-sm btn-outline-secondary rounded-pill" [disabled]="deletingFile === file"
|
|
19971
|
+
(click)="confirmingDelete = null">{{ "No" | translate }}</button>
|
|
19972
|
+
</span>
|
|
19973
|
+
<span *ngIf="sending === file" class="sending">
|
|
19974
|
+
<span class="progress" role="progressbar" [attr.aria-valuenow]="uploadPercent" aria-valuemin="0" aria-valuemax="100">
|
|
19975
|
+
<span class="progress-bar" [style.width.%]="uploadPercent"></span>
|
|
19976
|
+
</span>
|
|
19977
|
+
{{ "Sending" | translate }} {{ uploadName }}: {{ uploadPercent }}%
|
|
19978
|
+
</span>
|
|
19979
|
+
<span class="error" *ngIf="errorFile === file">{{ error | translate }}</span>
|
|
19980
|
+
</ng-template>
|
|
19981
|
+
<ng-template #unknown>
|
|
19982
|
+
<p class="hint">{{ "The files of the visit could not be checked." | translate }}</p>
|
|
19983
|
+
</ng-template>
|
|
19770
19984
|
`, isInline: true, styles: [".inventory-files{list-style:none;padding-left:0;margin-bottom:.5rem}.missing{color:var(--bs-danger, #dc3545)}.hint{display:block;font-size:.8rem;color:#6c757d;margin-left:1.2rem}.file-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem;margin:.25rem 0 0 1.2rem;font-size:.8rem}.upload{margin-bottom:0}.upload input{display:none}.sending{display:block;margin:.25rem 0 0 1.2rem;font-size:.8rem;color:#6c757d}.progress{display:flex;height:6px;margin-bottom:.25rem}.progress-bar{transition:none;background-color:var(--smarterplan-primary)}.error{display:block;margin-left:1.2rem;font-size:.8rem;color:var(--bs-danger, #dc3545)}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
19771
19985
|
}
|
|
19772
19986
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryFilesComponent, decorators: [{
|
|
19773
19987
|
type: Component,
|
|
19774
|
-
args: [{ selector: "lib-inventory-files", template: `
|
|
19775
|
-
<ul class="inventory-files" *ngIf="files; else unknown">
|
|
19776
|
-
<li [class.missing]="!files.panoramas">
|
|
19777
|
-
{{ files.panoramas ? "✓" : "✗" }} {{ "Panoramas" | translate }}: {{ files.panoramas }}
|
|
19778
|
-
<span class="hint" *ngIf="!files.panoramas">{{ "Import the 360° images of the visit first." | translate }}</span>
|
|
19779
|
-
</li>
|
|
19780
|
-
<li [class.missing]="!files.dataJson">
|
|
19781
|
-
{{ files.dataJson ? "✓" : "✗" }} {{ "Panorama positions" | translate }} (data.json)
|
|
19782
|
-
<span class="hint" *ngIf="!files.dataJson">{{ "Import all the images of the visit again (Virtual Visits): the import writes it." | translate }}</span>
|
|
19783
|
-
<ng-container *ngTemplateOutlet="actions; context: { $implicit: positionsFile }"></ng-container>
|
|
19784
|
-
</li>
|
|
19785
|
-
<li [class.missing]="!files.modelObj">
|
|
19786
|
-
{{ files.modelObj ? "✓" : "✗" }} {{ "3D mesh" | translate }} (model.obj)
|
|
19787
|
-
<span class="hint" *ngIf="!files.modelObj">{{ "The .obj of the visit's MatterPak, from Matterport. Its textures are not needed." | translate }}</span>
|
|
19788
|
-
<ng-container *ngTemplateOutlet="actions; context: { $implicit: meshFile }"></ng-container>
|
|
19789
|
-
</li>
|
|
19790
|
-
</ul>
|
|
19791
|
-
<ng-template #actions let-file>
|
|
19792
|
-
<span class="file-actions" *ngIf="sending !== file && confirmingDelete !== file">
|
|
19793
|
-
<label class="btn btn-sm btn-outline-primary rounded-pill upload" [class.disabled]="locked">
|
|
19794
|
-
<input type="file" [accept]="file.accept" [disabled]="locked" (change)="onFileSelected(file, $event)">
|
|
19795
|
-
{{ (files[file.field] ? "Replace" : file.send) | translate }}
|
|
19796
|
-
</label>
|
|
19797
|
-
<button type="button" class="btn btn-sm btn-outline-danger rounded-pill delete" *ngIf="files[file.field]"
|
|
19798
|
-
[disabled]="locked" (click)="confirmingDelete = file">{{ "Delete" | translate }}</button>
|
|
19799
|
-
</span>
|
|
19800
|
-
<span class="file-actions" *ngIf="confirmingDelete === file">
|
|
19801
|
-
<span>{{ "Delete this file?" | translate }}</span>
|
|
19802
|
-
<button type="button" class="btn btn-sm btn-danger rounded-pill confirm" [disabled]="locked"
|
|
19803
|
-
(click)="onDeleteConfirmed(file)">{{ "Yes, delete" | translate }}</button>
|
|
19804
|
-
<button type="button" class="btn btn-sm btn-outline-secondary rounded-pill" [disabled]="deletingFile === file"
|
|
19805
|
-
(click)="confirmingDelete = null">{{ "No" | translate }}</button>
|
|
19806
|
-
</span>
|
|
19807
|
-
<span *ngIf="sending === file" class="sending">
|
|
19808
|
-
<span class="progress" role="progressbar" [attr.aria-valuenow]="uploadPercent" aria-valuemin="0" aria-valuemax="100">
|
|
19809
|
-
<span class="progress-bar" [style.width.%]="uploadPercent"></span>
|
|
19810
|
-
</span>
|
|
19811
|
-
{{ "Sending" | translate }} {{ uploadName }}: {{ uploadPercent }}%
|
|
19812
|
-
</span>
|
|
19813
|
-
<span class="error" *ngIf="errorFile === file">{{ error | translate }}</span>
|
|
19814
|
-
</ng-template>
|
|
19815
|
-
<ng-template #unknown>
|
|
19816
|
-
<p class="hint">{{ "The files of the visit could not be checked." | translate }}</p>
|
|
19817
|
-
</ng-template>
|
|
19988
|
+
args: [{ selector: "lib-inventory-files", template: `
|
|
19989
|
+
<ul class="inventory-files" *ngIf="files; else unknown">
|
|
19990
|
+
<li [class.missing]="!files.panoramas">
|
|
19991
|
+
{{ files.panoramas ? "✓" : "✗" }} {{ "Panoramas" | translate }}: {{ files.panoramas }}
|
|
19992
|
+
<span class="hint" *ngIf="!files.panoramas">{{ "Import the 360° images of the visit first." | translate }}</span>
|
|
19993
|
+
</li>
|
|
19994
|
+
<li [class.missing]="!files.dataJson">
|
|
19995
|
+
{{ files.dataJson ? "✓" : "✗" }} {{ "Panorama positions" | translate }} (data.json)
|
|
19996
|
+
<span class="hint" *ngIf="!files.dataJson">{{ "Import all the images of the visit again (Virtual Visits): the import writes it." | translate }}</span>
|
|
19997
|
+
<ng-container *ngTemplateOutlet="actions; context: { $implicit: positionsFile }"></ng-container>
|
|
19998
|
+
</li>
|
|
19999
|
+
<li [class.missing]="!files.modelObj">
|
|
20000
|
+
{{ files.modelObj ? "✓" : "✗" }} {{ "3D mesh" | translate }} (model.obj)
|
|
20001
|
+
<span class="hint" *ngIf="!files.modelObj">{{ "The .obj of the visit's MatterPak, from Matterport. Its textures are not needed." | translate }}</span>
|
|
20002
|
+
<ng-container *ngTemplateOutlet="actions; context: { $implicit: meshFile }"></ng-container>
|
|
20003
|
+
</li>
|
|
20004
|
+
</ul>
|
|
20005
|
+
<ng-template #actions let-file>
|
|
20006
|
+
<span class="file-actions" *ngIf="sending !== file && confirmingDelete !== file">
|
|
20007
|
+
<label class="btn btn-sm btn-outline-primary rounded-pill upload" [class.disabled]="locked">
|
|
20008
|
+
<input type="file" [accept]="file.accept" [disabled]="locked" (change)="onFileSelected(file, $event)">
|
|
20009
|
+
{{ (files[file.field] ? "Replace" : file.send) | translate }}
|
|
20010
|
+
</label>
|
|
20011
|
+
<button type="button" class="btn btn-sm btn-outline-danger rounded-pill delete" *ngIf="files[file.field]"
|
|
20012
|
+
[disabled]="locked" (click)="confirmingDelete = file">{{ "Delete" | translate }}</button>
|
|
20013
|
+
</span>
|
|
20014
|
+
<span class="file-actions" *ngIf="confirmingDelete === file">
|
|
20015
|
+
<span>{{ "Delete this file?" | translate }}</span>
|
|
20016
|
+
<button type="button" class="btn btn-sm btn-danger rounded-pill confirm" [disabled]="locked"
|
|
20017
|
+
(click)="onDeleteConfirmed(file)">{{ "Yes, delete" | translate }}</button>
|
|
20018
|
+
<button type="button" class="btn btn-sm btn-outline-secondary rounded-pill" [disabled]="deletingFile === file"
|
|
20019
|
+
(click)="confirmingDelete = null">{{ "No" | translate }}</button>
|
|
20020
|
+
</span>
|
|
20021
|
+
<span *ngIf="sending === file" class="sending">
|
|
20022
|
+
<span class="progress" role="progressbar" [attr.aria-valuenow]="uploadPercent" aria-valuemin="0" aria-valuemax="100">
|
|
20023
|
+
<span class="progress-bar" [style.width.%]="uploadPercent"></span>
|
|
20024
|
+
</span>
|
|
20025
|
+
{{ "Sending" | translate }} {{ uploadName }}: {{ uploadPercent }}%
|
|
20026
|
+
</span>
|
|
20027
|
+
<span class="error" *ngIf="errorFile === file">{{ error | translate }}</span>
|
|
20028
|
+
</ng-template>
|
|
20029
|
+
<ng-template #unknown>
|
|
20030
|
+
<p class="hint">{{ "The files of the visit could not be checked." | translate }}</p>
|
|
20031
|
+
</ng-template>
|
|
19818
20032
|
`, styles: [".inventory-files{list-style:none;padding-left:0;margin-bottom:.5rem}.missing{color:var(--bs-danger, #dc3545)}.hint{display:block;font-size:.8rem;color:#6c757d;margin-left:1.2rem}.file-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem;margin:.25rem 0 0 1.2rem;font-size:.8rem}.upload{margin-bottom:0}.upload input{display:none}.sending{display:block;margin:.25rem 0 0 1.2rem;font-size:.8rem;color:#6c757d}.progress{display:flex;height:6px;margin-bottom:.25rem}.progress-bar{transition:none;background-color:var(--smarterplan-primary)}.error{display:block;margin-left:1.2rem;font-size:.8rem;color:var(--bs-danger, #dc3545)}\n"] }]
|
|
19819
20033
|
}], propDecorators: { files: [{
|
|
19820
20034
|
type: Input
|
|
@@ -19841,11 +20055,11 @@ class CheckboxSliderComponent {
|
|
|
19841
20055
|
this.checkedChange.emit(this.checked);
|
|
19842
20056
|
}
|
|
19843
20057
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CheckboxSliderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
19844
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CheckboxSliderComponent, selector: "lib-checkbox-slider", inputs: { label: "label", checked: "checked", disabled: "disabled" }, outputs: { checkedChange: "checkedChange" }, ngImport: i0, template: "<label class=\"checkbox-slider\" [class.disabled]=\"disabled\">\n <span class=\"switch\">\n <input type=\"checkbox\" [checked]=\"checked\" [disabled]=\"disabled\" (change)=\"onChange($event)\">\n <span class=\"slider\"></span>\n </span>\n <span class=\"label\">{{ label | translate }}</span>\n</label>\n", styles: [":host{display:block}.checkbox-slider{display:flex;align-items:center;gap:1rem;margin:0;cursor:pointer}.checkbox-slider.disabled{cursor:default;opacity:.5}.switch{position:relative;display:inline-block;flex:none;width:60px;height:34px;border-radius:34px}.switch input{position:absolute;opacity:0;width:0;height:0}.switch input:checked+.slider{background-color:var(--smarterplan-primary);box-shadow:2px 2px 10px 0 var(--smarterplan-primary)}.switch input:checked+.slider:before{background:#fff;transform:translate(26px)}.switch input:focus-visible+.slider{outline:2px solid var(--smarterplan-primary);outline-offset:2px}.switch .slider{position:absolute;inset:0;border:1px solid var(--smarterplan-primary);border-radius:34px;transition:.3s}.switch .slider:before{position:absolute;content:\"\";height:26px;width:26px;left:4px;bottom:3px;background-color:var(--smarterplan-primary);box-shadow:2px 2px 10px 0 var(--smarterplan-primary);border-radius:50%;transition:.3s}\n"], dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
20058
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CheckboxSliderComponent, selector: "lib-checkbox-slider", inputs: { label: "label", checked: "checked", disabled: "disabled" }, outputs: { checkedChange: "checkedChange" }, ngImport: i0, template: "<label class=\"checkbox-slider\" [class.disabled]=\"disabled\">\r\n <span class=\"switch\">\r\n <input type=\"checkbox\" [checked]=\"checked\" [disabled]=\"disabled\" (change)=\"onChange($event)\">\r\n <span class=\"slider\"></span>\r\n </span>\r\n <span class=\"label\">{{ label | translate }}</span>\r\n</label>\r\n", styles: [":host{display:block}.checkbox-slider{display:flex;align-items:center;gap:1rem;margin:0;cursor:pointer}.checkbox-slider.disabled{cursor:default;opacity:.5}.switch{position:relative;display:inline-block;flex:none;width:60px;height:34px;border-radius:34px}.switch input{position:absolute;opacity:0;width:0;height:0}.switch input:checked+.slider{background-color:var(--smarterplan-primary);box-shadow:2px 2px 10px 0 var(--smarterplan-primary)}.switch input:checked+.slider:before{background:#fff;transform:translate(26px)}.switch input:focus-visible+.slider{outline:2px solid var(--smarterplan-primary);outline-offset:2px}.switch .slider{position:absolute;inset:0;border:1px solid var(--smarterplan-primary);border-radius:34px;transition:.3s}.switch .slider:before{position:absolute;content:\"\";height:26px;width:26px;left:4px;bottom:3px;background-color:var(--smarterplan-primary);box-shadow:2px 2px 10px 0 var(--smarterplan-primary);border-radius:50%;transition:.3s}\n"], dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
19845
20059
|
}
|
|
19846
20060
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CheckboxSliderComponent, decorators: [{
|
|
19847
20061
|
type: Component,
|
|
19848
|
-
args: [{ selector: "lib-checkbox-slider", template: "<label class=\"checkbox-slider\" [class.disabled]=\"disabled\">\n <span class=\"switch\">\n <input type=\"checkbox\" [checked]=\"checked\" [disabled]=\"disabled\" (change)=\"onChange($event)\">\n <span class=\"slider\"></span>\n </span>\n <span class=\"label\">{{ label | translate }}</span>\n</label>\n", styles: [":host{display:block}.checkbox-slider{display:flex;align-items:center;gap:1rem;margin:0;cursor:pointer}.checkbox-slider.disabled{cursor:default;opacity:.5}.switch{position:relative;display:inline-block;flex:none;width:60px;height:34px;border-radius:34px}.switch input{position:absolute;opacity:0;width:0;height:0}.switch input:checked+.slider{background-color:var(--smarterplan-primary);box-shadow:2px 2px 10px 0 var(--smarterplan-primary)}.switch input:checked+.slider:before{background:#fff;transform:translate(26px)}.switch input:focus-visible+.slider{outline:2px solid var(--smarterplan-primary);outline-offset:2px}.switch .slider{position:absolute;inset:0;border:1px solid var(--smarterplan-primary);border-radius:34px;transition:.3s}.switch .slider:before{position:absolute;content:\"\";height:26px;width:26px;left:4px;bottom:3px;background-color:var(--smarterplan-primary);box-shadow:2px 2px 10px 0 var(--smarterplan-primary);border-radius:50%;transition:.3s}\n"] }]
|
|
20062
|
+
args: [{ selector: "lib-checkbox-slider", template: "<label class=\"checkbox-slider\" [class.disabled]=\"disabled\">\r\n <span class=\"switch\">\r\n <input type=\"checkbox\" [checked]=\"checked\" [disabled]=\"disabled\" (change)=\"onChange($event)\">\r\n <span class=\"slider\"></span>\r\n </span>\r\n <span class=\"label\">{{ label | translate }}</span>\r\n</label>\r\n", styles: [":host{display:block}.checkbox-slider{display:flex;align-items:center;gap:1rem;margin:0;cursor:pointer}.checkbox-slider.disabled{cursor:default;opacity:.5}.switch{position:relative;display:inline-block;flex:none;width:60px;height:34px;border-radius:34px}.switch input{position:absolute;opacity:0;width:0;height:0}.switch input:checked+.slider{background-color:var(--smarterplan-primary);box-shadow:2px 2px 10px 0 var(--smarterplan-primary)}.switch input:checked+.slider:before{background:#fff;transform:translate(26px)}.switch input:focus-visible+.slider{outline:2px solid var(--smarterplan-primary);outline-offset:2px}.switch .slider{position:absolute;inset:0;border:1px solid var(--smarterplan-primary);border-radius:34px;transition:.3s}.switch .slider:before{position:absolute;content:\"\";height:26px;width:26px;left:4px;bottom:3px;background-color:var(--smarterplan-primary);box-shadow:2px 2px 10px 0 var(--smarterplan-primary);border-radius:50%;transition:.3s}\n"] }]
|
|
19849
20063
|
}], propDecorators: { label: [{
|
|
19850
20064
|
type: Input
|
|
19851
20065
|
}], checked: [{
|
|
@@ -20242,11 +20456,11 @@ class InventoryLaunchComponent {
|
|
|
20242
20456
|
}
|
|
20243
20457
|
}
|
|
20244
20458
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryLaunchComponent, deps: [{ token: InventoryService }, { token: EquipmentService }, { token: NavigationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
20245
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: InventoryLaunchComponent, selector: "lib-inventory-launch", inputs: { spaceID: "spaceID", visits: "visits", panorama: "panorama", running: "running" }, outputs: { cancelled: "cancelled", launched: "launched" }, usesOnChanges: true, ngImport: i0, template: "<!-- What the inventory will do, before it is done: it adds equipment to the location. -->\n<p *ngIf=\"panorama\">{{ 'The AI will look for equipment in this panorama and add what it finds to the location.' | translate }}</p>\n<p *ngIf=\"!panorama\">{{ 'The AI will look for equipment in the visits of this location and add what it finds to it.' | translate }}</p>\n\n<ul class=\"inventory-launch-summary\" *ngIf=\"panorama\">\n <li>{{ 'Visit' | translate }}: <strong class=\"no-lowercase\">{{ visits?.[0]?.label }}</strong></li>\n <li>{{ 'Panorama' | translate }}: <strong class=\"no-lowercase\">{{ panorama }}</strong></li>\n</ul>\n<ul class=\"inventory-launch-summary\" *ngIf=\"!panorama && visits?.length > 0\">\n <li>{{ 'Visits to analyse' | translate }}:\n <strong>{{ checkingFiles ? '\u2026' : launchableVisits.length + ' / ' + visits.length }}</strong></li>\n</ul>\n<p class=\"text-danger\" *ngIf=\"visits?.length === 0\">\n {{ 'This location has no Matterport visit for the AI to analyse.' | translate }}</p>\n\n<lib-loader *ngIf=\"checkingFiles\"></lib-loader>\n<ng-container *ngIf=\"!checkingFiles\">\n <div *ngFor=\"let visit of visits\">\n <strong class=\"no-lowercase\" *ngIf=\"!panorama\">{{ visit.label }}</strong>\n <lib-inventory-files [files]=\"visitFiles[visit.nodeID]\" (filesChange)=\"onFilesChange(visit, $event)\"\n [model3D]=\"visit.model3D\" [disabled]=\"running || launching || discarding\"></lib-inventory-files>\n </div>\n</ng-container>\n\n<div class=\"inventory-launch-delete\">\n <lib-checkbox-slider label=\"Delete previous inventory ?\" [checked]=\"deletePrevious\"\n [disabled]=\"launching || reuseDetections\" (checkedChange)=\"onDeletePreviousChange($event)\"></lib-checkbox-slider>\n <span class=\"inventory-launch-hint\" *ngIf=\"deletePrevious\">\n {{ 'Equipment the AI added to these visits, deleted first' | translate }}: <strong>{{ aiEquipmentCount ?? '\u2026' }}</strong>\n </span>\n <span class=\"inventory-launch-hint\" *ngIf=\"reuseDetections\">\n {{ 'Needed to reuse the detections, or every object would be there twice.' | translate }}\n </span>\n <span class=\"inventory-launch-hint\" *ngIf=\"deleting\">\n {{ 'Deleting the previous inventory' | translate }}: {{ deleting.done }} / {{ deleting.total }}\n </span>\n</div>\n\n<!-- The last inventories' detections placed again with another cutoff: no panorama analysed again. -->\n<div class=\"inventory-launch-delete\" *ngIf=\"canReuse\">\n <lib-checkbox-slider label=\"Reuse the detections of the last inventory\" [checked]=\"reuseDetections\"\n [disabled]=\"launching\" (checkedChange)=\"onReuseChange($event)\"></lib-checkbox-slider>\n <span class=\"inventory-launch-hint\" *ngIf=\"reuseDetections\">\n {{ 'Only the placing is done again, with the cutoff chosen: a few minutes.' | translate }}\n </span>\n</div>\n\n<!-- Once the cutoff is chosen, the detections kept to change it can go. -->\n<div class=\"inventory-launch-delete\" *ngIf=\"discardable.length > 0 || discarded\">\n <ng-container *ngIf=\"discardable.length > 0 && !confirmingDiscard\">\n <button type=\"button\" class=\"btn btn-sm btn-outline-danger rounded-pill inventory-launch-discard\"\n [disabled]=\"running || launching\" (click)=\"confirmingDiscard = true\">\n {{ 'Discard the saved detections' | translate }}</button>\n <span class=\"inventory-launch-hint\">\n {{ 'Once the cutoff is chosen, this frees the space they take. The equipment stays.' | translate }}\n </span>\n </ng-container>\n <ng-container *ngIf=\"discardable.length > 0 && confirmingDiscard\">\n <span class=\"inventory-launch-hint\">\n {{ 'The equipment stays. To change the cutoff later, the panoramas will have to be analysed again.' | translate }}\n </span>\n <div class=\"inventory-launch-confirm\">\n <button type=\"button\" class=\"btn btn-sm btn-danger rounded-pill\" [disabled]=\"running || launching || discarding\"\n (click)=\"onConfirmDiscard()\">{{ (discarding ? 'Discarding\u2026' : 'Yes, discard') | translate }}</button>\n <button type=\"button\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" [disabled]=\"discarding\"\n (click)=\"confirmingDiscard = false\">{{ 'No, keep them' | translate }}</button>\n </div>\n </ng-container>\n <span class=\"inventory-launch-hint\" *ngIf=\"discarded\">{{ 'The saved detections were discarded.' | translate }}</span>\n</div>\n\n<div class=\"inventory-launch-settings\">\n <select class=\"no-lowercase form-select\" [(ngModel)]=\"model\" *ngIf=\"!reuseDetections\">\n <option [ngValue]=\"undefined\">{{ 'Select model' | translate }}</option>\n <option *ngFor=\"let option of models\" [ngValue]=\"option\">{{ option.name | translate }}</option>\n </select>\n <!-- Reusing, the detections keep the model that made them. -->\n <select class=\"no-lowercase form-select inventory-launch-reused-model\" *ngIf=\"reuseDetections\" disabled\n [title]=\"'The detections keep the model that made them.' | translate\">\n <option>{{ reusedModelName | translate }}</option>\n </select>\n <select class=\"form-select\" [(ngModel)]=\"cutoffScore\" [title]=\"'Cutoff score' | translate\">\n <option *ngFor=\"let score of cutoffScores\" [ngValue]=\"score\">{{ 'Cutoff score' | translate }} {{ score }}</option>\n </select>\n</div>\n\n<div class=\"inventory-launch-buttons\">\n <!-- Closes the panel only: \"Cancel the inventory\", below, is what stops one. -->\n <button type=\"button\" class=\"btn btn-outline-secondary rounded-pill inventory-launch-close\" [disabled]=\"launching\"\n (click)=\"cancelled.emit()\">{{ 'Close' | translate }}</button>\n <button type=\"button\" class=\"btn btn-outline-primary rounded-pill inventory-launch-go\" [disabled]=\"!canLaunch\"\n [title]=\"running ? ('An inventory is already running for this location.' | translate) : ''\"\n (click)=\"onLaunchClick()\">{{ (reuseDetections && canReuse ? 'Update' : 'Launch inventory') | translate }}</button>\n</div>\n\n<div class=\"text-danger mt-2\" *ngIf=\"message\">{{ message | translate: { count: notDeleted } }}</div>\n", styles: [":host{display:block}.inventory-launch-summary{padding-left:1.2rem;margin-bottom:.5rem}.inventory-launch-delete{margin:.75rem 0}.inventory-launch-hint{display:block;margin-top:.25rem;font-size:.8rem;color:#6c757d}.inventory-launch-confirm{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.25rem}.inventory-launch-settings{display:flex;flex-wrap:wrap;gap:.5rem}.inventory-launch-settings select{flex:1 1 10rem}.inventory-launch-buttons{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.75rem}\n"], dependencies: [{ kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: LoaderComponent, selector: "lib-loader", inputs: ["useLogo", "color"] }, { kind: "component", type: InventoryFilesComponent, selector: "lib-inventory-files", inputs: ["files", "model3D", "disabled"], outputs: ["filesChange"] }, { kind: "component", type: CheckboxSliderComponent, selector: "lib-checkbox-slider", inputs: ["label", "checked", "disabled"], outputs: ["checkedChange"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
20459
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: InventoryLaunchComponent, selector: "lib-inventory-launch", inputs: { spaceID: "spaceID", visits: "visits", panorama: "panorama", running: "running" }, outputs: { cancelled: "cancelled", launched: "launched" }, usesOnChanges: true, ngImport: i0, template: "<!-- What the inventory will do, before it is done: it adds equipment to the location. -->\r\n<p *ngIf=\"panorama\">{{ 'The AI will look for equipment in this panorama and add what it finds to the location.' | translate }}</p>\r\n<p *ngIf=\"!panorama\">{{ 'The AI will look for equipment in the visits of this location and add what it finds to it.' | translate }}</p>\r\n\r\n<ul class=\"inventory-launch-summary\" *ngIf=\"panorama\">\r\n <li>{{ 'Visit' | translate }}: <strong class=\"no-lowercase\">{{ visits?.[0]?.label }}</strong></li>\r\n <li>{{ 'Panorama' | translate }}: <strong class=\"no-lowercase\">{{ panorama }}</strong></li>\r\n</ul>\r\n<ul class=\"inventory-launch-summary\" *ngIf=\"!panorama && visits?.length > 0\">\r\n <li>{{ 'Visits to analyse' | translate }}:\r\n <strong>{{ checkingFiles ? '\u2026' : launchableVisits.length + ' / ' + visits.length }}</strong></li>\r\n</ul>\r\n<p class=\"text-danger\" *ngIf=\"visits?.length === 0\">\r\n {{ 'This location has no Matterport visit for the AI to analyse.' | translate }}</p>\r\n\r\n<lib-loader *ngIf=\"checkingFiles\"></lib-loader>\r\n<ng-container *ngIf=\"!checkingFiles\">\r\n <div *ngFor=\"let visit of visits\">\r\n <strong class=\"no-lowercase\" *ngIf=\"!panorama\">{{ visit.label }}</strong>\r\n <lib-inventory-files [files]=\"visitFiles[visit.nodeID]\" (filesChange)=\"onFilesChange(visit, $event)\"\r\n [model3D]=\"visit.model3D\" [disabled]=\"running || launching || discarding\"></lib-inventory-files>\r\n </div>\r\n</ng-container>\r\n\r\n<div class=\"inventory-launch-delete\">\r\n <lib-checkbox-slider label=\"Delete previous inventory ?\" [checked]=\"deletePrevious\"\r\n [disabled]=\"launching || reuseDetections\" (checkedChange)=\"onDeletePreviousChange($event)\"></lib-checkbox-slider>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"deletePrevious\">\r\n {{ 'Equipment the AI added to these visits, deleted first' | translate }}: <strong>{{ aiEquipmentCount ?? '\u2026' }}</strong>\r\n </span>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"reuseDetections\">\r\n {{ 'Needed to reuse the detections, or every object would be there twice.' | translate }}\r\n </span>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"deleting\">\r\n {{ 'Deleting the previous inventory' | translate }}: {{ deleting.done }} / {{ deleting.total }}\r\n </span>\r\n</div>\r\n\r\n<!-- The last inventories' detections placed again with another cutoff: no panorama analysed again. -->\r\n<div class=\"inventory-launch-delete\" *ngIf=\"canReuse\">\r\n <lib-checkbox-slider label=\"Reuse the detections of the last inventory\" [checked]=\"reuseDetections\"\r\n [disabled]=\"launching\" (checkedChange)=\"onReuseChange($event)\"></lib-checkbox-slider>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"reuseDetections\">\r\n {{ 'Only the placing is done again, with the cutoff chosen: a few minutes.' | translate }}\r\n </span>\r\n</div>\r\n\r\n<!-- Once the cutoff is chosen, the detections kept to change it can go. -->\r\n<div class=\"inventory-launch-delete\" *ngIf=\"discardable.length > 0 || discarded\">\r\n <ng-container *ngIf=\"discardable.length > 0 && !confirmingDiscard\">\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-danger rounded-pill inventory-launch-discard\"\r\n [disabled]=\"running || launching\" (click)=\"confirmingDiscard = true\">\r\n {{ 'Discard the saved detections' | translate }}</button>\r\n <span class=\"inventory-launch-hint\">\r\n {{ 'Once the cutoff is chosen, this frees the space they take. The equipment stays.' | translate }}\r\n </span>\r\n </ng-container>\r\n <ng-container *ngIf=\"discardable.length > 0 && confirmingDiscard\">\r\n <span class=\"inventory-launch-hint\">\r\n {{ 'The equipment stays. To change the cutoff later, the panoramas will have to be analysed again.' | translate }}\r\n </span>\r\n <div class=\"inventory-launch-confirm\">\r\n <button type=\"button\" class=\"btn btn-sm btn-danger rounded-pill\" [disabled]=\"running || launching || discarding\"\r\n (click)=\"onConfirmDiscard()\">{{ (discarding ? 'Discarding\u2026' : 'Yes, discard') | translate }}</button>\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" [disabled]=\"discarding\"\r\n (click)=\"confirmingDiscard = false\">{{ 'No, keep them' | translate }}</button>\r\n </div>\r\n </ng-container>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"discarded\">{{ 'The saved detections were discarded.' | translate }}</span>\r\n</div>\r\n\r\n<div class=\"inventory-launch-settings\">\r\n <select class=\"no-lowercase form-select\" [(ngModel)]=\"model\" *ngIf=\"!reuseDetections\">\r\n <option [ngValue]=\"undefined\">{{ 'Select model' | translate }}</option>\r\n <option *ngFor=\"let option of models\" [ngValue]=\"option\">{{ option.name | translate }}</option>\r\n </select>\r\n <!-- Reusing, the detections keep the model that made them. -->\r\n <select class=\"no-lowercase form-select inventory-launch-reused-model\" *ngIf=\"reuseDetections\" disabled\r\n [title]=\"'The detections keep the model that made them.' | translate\">\r\n <option>{{ reusedModelName | translate }}</option>\r\n </select>\r\n <select class=\"form-select\" [(ngModel)]=\"cutoffScore\" [title]=\"'Cutoff score' | translate\">\r\n <option *ngFor=\"let score of cutoffScores\" [ngValue]=\"score\">{{ 'Cutoff score' | translate }} {{ score }}</option>\r\n </select>\r\n</div>\r\n\r\n<div class=\"inventory-launch-buttons\">\r\n <!-- Closes the panel only: \"Cancel the inventory\", below, is what stops one. -->\r\n <button type=\"button\" class=\"btn btn-outline-secondary rounded-pill inventory-launch-close\" [disabled]=\"launching\"\r\n (click)=\"cancelled.emit()\">{{ 'Close' | translate }}</button>\r\n <button type=\"button\" class=\"btn btn-outline-primary rounded-pill inventory-launch-go\" [disabled]=\"!canLaunch\"\r\n [title]=\"running ? ('An inventory is already running for this location.' | translate) : ''\"\r\n (click)=\"onLaunchClick()\">{{ (reuseDetections && canReuse ? 'Update' : 'Launch inventory') | translate }}</button>\r\n</div>\r\n\r\n<div class=\"text-danger mt-2\" *ngIf=\"message\">{{ message | translate: { count: notDeleted } }}</div>\r\n", styles: [":host{display:block}.inventory-launch-summary{padding-left:1.2rem;margin-bottom:.5rem}.inventory-launch-delete{margin:.75rem 0}.inventory-launch-hint{display:block;margin-top:.25rem;font-size:.8rem;color:#6c757d}.inventory-launch-confirm{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.25rem}.inventory-launch-settings{display:flex;flex-wrap:wrap;gap:.5rem}.inventory-launch-settings select{flex:1 1 10rem}.inventory-launch-buttons{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.75rem}\n"], dependencies: [{ kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: LoaderComponent, selector: "lib-loader", inputs: ["useLogo", "color"] }, { kind: "component", type: InventoryFilesComponent, selector: "lib-inventory-files", inputs: ["files", "model3D", "disabled"], outputs: ["filesChange"] }, { kind: "component", type: CheckboxSliderComponent, selector: "lib-checkbox-slider", inputs: ["label", "checked", "disabled"], outputs: ["checkedChange"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
20246
20460
|
}
|
|
20247
20461
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryLaunchComponent, decorators: [{
|
|
20248
20462
|
type: Component,
|
|
20249
|
-
args: [{ selector: "lib-inventory-launch", template: "<!-- What the inventory will do, before it is done: it adds equipment to the location. -->\n<p *ngIf=\"panorama\">{{ 'The AI will look for equipment in this panorama and add what it finds to the location.' | translate }}</p>\n<p *ngIf=\"!panorama\">{{ 'The AI will look for equipment in the visits of this location and add what it finds to it.' | translate }}</p>\n\n<ul class=\"inventory-launch-summary\" *ngIf=\"panorama\">\n <li>{{ 'Visit' | translate }}: <strong class=\"no-lowercase\">{{ visits?.[0]?.label }}</strong></li>\n <li>{{ 'Panorama' | translate }}: <strong class=\"no-lowercase\">{{ panorama }}</strong></li>\n</ul>\n<ul class=\"inventory-launch-summary\" *ngIf=\"!panorama && visits?.length > 0\">\n <li>{{ 'Visits to analyse' | translate }}:\n <strong>{{ checkingFiles ? '\u2026' : launchableVisits.length + ' / ' + visits.length }}</strong></li>\n</ul>\n<p class=\"text-danger\" *ngIf=\"visits?.length === 0\">\n {{ 'This location has no Matterport visit for the AI to analyse.' | translate }}</p>\n\n<lib-loader *ngIf=\"checkingFiles\"></lib-loader>\n<ng-container *ngIf=\"!checkingFiles\">\n <div *ngFor=\"let visit of visits\">\n <strong class=\"no-lowercase\" *ngIf=\"!panorama\">{{ visit.label }}</strong>\n <lib-inventory-files [files]=\"visitFiles[visit.nodeID]\" (filesChange)=\"onFilesChange(visit, $event)\"\n [model3D]=\"visit.model3D\" [disabled]=\"running || launching || discarding\"></lib-inventory-files>\n </div>\n</ng-container>\n\n<div class=\"inventory-launch-delete\">\n <lib-checkbox-slider label=\"Delete previous inventory ?\" [checked]=\"deletePrevious\"\n [disabled]=\"launching || reuseDetections\" (checkedChange)=\"onDeletePreviousChange($event)\"></lib-checkbox-slider>\n <span class=\"inventory-launch-hint\" *ngIf=\"deletePrevious\">\n {{ 'Equipment the AI added to these visits, deleted first' | translate }}: <strong>{{ aiEquipmentCount ?? '\u2026' }}</strong>\n </span>\n <span class=\"inventory-launch-hint\" *ngIf=\"reuseDetections\">\n {{ 'Needed to reuse the detections, or every object would be there twice.' | translate }}\n </span>\n <span class=\"inventory-launch-hint\" *ngIf=\"deleting\">\n {{ 'Deleting the previous inventory' | translate }}: {{ deleting.done }} / {{ deleting.total }}\n </span>\n</div>\n\n<!-- The last inventories' detections placed again with another cutoff: no panorama analysed again. -->\n<div class=\"inventory-launch-delete\" *ngIf=\"canReuse\">\n <lib-checkbox-slider label=\"Reuse the detections of the last inventory\" [checked]=\"reuseDetections\"\n [disabled]=\"launching\" (checkedChange)=\"onReuseChange($event)\"></lib-checkbox-slider>\n <span class=\"inventory-launch-hint\" *ngIf=\"reuseDetections\">\n {{ 'Only the placing is done again, with the cutoff chosen: a few minutes.' | translate }}\n </span>\n</div>\n\n<!-- Once the cutoff is chosen, the detections kept to change it can go. -->\n<div class=\"inventory-launch-delete\" *ngIf=\"discardable.length > 0 || discarded\">\n <ng-container *ngIf=\"discardable.length > 0 && !confirmingDiscard\">\n <button type=\"button\" class=\"btn btn-sm btn-outline-danger rounded-pill inventory-launch-discard\"\n [disabled]=\"running || launching\" (click)=\"confirmingDiscard = true\">\n {{ 'Discard the saved detections' | translate }}</button>\n <span class=\"inventory-launch-hint\">\n {{ 'Once the cutoff is chosen, this frees the space they take. The equipment stays.' | translate }}\n </span>\n </ng-container>\n <ng-container *ngIf=\"discardable.length > 0 && confirmingDiscard\">\n <span class=\"inventory-launch-hint\">\n {{ 'The equipment stays. To change the cutoff later, the panoramas will have to be analysed again.' | translate }}\n </span>\n <div class=\"inventory-launch-confirm\">\n <button type=\"button\" class=\"btn btn-sm btn-danger rounded-pill\" [disabled]=\"running || launching || discarding\"\n (click)=\"onConfirmDiscard()\">{{ (discarding ? 'Discarding\u2026' : 'Yes, discard') | translate }}</button>\n <button type=\"button\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" [disabled]=\"discarding\"\n (click)=\"confirmingDiscard = false\">{{ 'No, keep them' | translate }}</button>\n </div>\n </ng-container>\n <span class=\"inventory-launch-hint\" *ngIf=\"discarded\">{{ 'The saved detections were discarded.' | translate }}</span>\n</div>\n\n<div class=\"inventory-launch-settings\">\n <select class=\"no-lowercase form-select\" [(ngModel)]=\"model\" *ngIf=\"!reuseDetections\">\n <option [ngValue]=\"undefined\">{{ 'Select model' | translate }}</option>\n <option *ngFor=\"let option of models\" [ngValue]=\"option\">{{ option.name | translate }}</option>\n </select>\n <!-- Reusing, the detections keep the model that made them. -->\n <select class=\"no-lowercase form-select inventory-launch-reused-model\" *ngIf=\"reuseDetections\" disabled\n [title]=\"'The detections keep the model that made them.' | translate\">\n <option>{{ reusedModelName | translate }}</option>\n </select>\n <select class=\"form-select\" [(ngModel)]=\"cutoffScore\" [title]=\"'Cutoff score' | translate\">\n <option *ngFor=\"let score of cutoffScores\" [ngValue]=\"score\">{{ 'Cutoff score' | translate }} {{ score }}</option>\n </select>\n</div>\n\n<div class=\"inventory-launch-buttons\">\n <!-- Closes the panel only: \"Cancel the inventory\", below, is what stops one. -->\n <button type=\"button\" class=\"btn btn-outline-secondary rounded-pill inventory-launch-close\" [disabled]=\"launching\"\n (click)=\"cancelled.emit()\">{{ 'Close' | translate }}</button>\n <button type=\"button\" class=\"btn btn-outline-primary rounded-pill inventory-launch-go\" [disabled]=\"!canLaunch\"\n [title]=\"running ? ('An inventory is already running for this location.' | translate) : ''\"\n (click)=\"onLaunchClick()\">{{ (reuseDetections && canReuse ? 'Update' : 'Launch inventory') | translate }}</button>\n</div>\n\n<div class=\"text-danger mt-2\" *ngIf=\"message\">{{ message | translate: { count: notDeleted } }}</div>\n", styles: [":host{display:block}.inventory-launch-summary{padding-left:1.2rem;margin-bottom:.5rem}.inventory-launch-delete{margin:.75rem 0}.inventory-launch-hint{display:block;margin-top:.25rem;font-size:.8rem;color:#6c757d}.inventory-launch-confirm{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.25rem}.inventory-launch-settings{display:flex;flex-wrap:wrap;gap:.5rem}.inventory-launch-settings select{flex:1 1 10rem}.inventory-launch-buttons{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.75rem}\n"] }]
|
|
20463
|
+
args: [{ selector: "lib-inventory-launch", template: "<!-- What the inventory will do, before it is done: it adds equipment to the location. -->\r\n<p *ngIf=\"panorama\">{{ 'The AI will look for equipment in this panorama and add what it finds to the location.' | translate }}</p>\r\n<p *ngIf=\"!panorama\">{{ 'The AI will look for equipment in the visits of this location and add what it finds to it.' | translate }}</p>\r\n\r\n<ul class=\"inventory-launch-summary\" *ngIf=\"panorama\">\r\n <li>{{ 'Visit' | translate }}: <strong class=\"no-lowercase\">{{ visits?.[0]?.label }}</strong></li>\r\n <li>{{ 'Panorama' | translate }}: <strong class=\"no-lowercase\">{{ panorama }}</strong></li>\r\n</ul>\r\n<ul class=\"inventory-launch-summary\" *ngIf=\"!panorama && visits?.length > 0\">\r\n <li>{{ 'Visits to analyse' | translate }}:\r\n <strong>{{ checkingFiles ? '\u2026' : launchableVisits.length + ' / ' + visits.length }}</strong></li>\r\n</ul>\r\n<p class=\"text-danger\" *ngIf=\"visits?.length === 0\">\r\n {{ 'This location has no Matterport visit for the AI to analyse.' | translate }}</p>\r\n\r\n<lib-loader *ngIf=\"checkingFiles\"></lib-loader>\r\n<ng-container *ngIf=\"!checkingFiles\">\r\n <div *ngFor=\"let visit of visits\">\r\n <strong class=\"no-lowercase\" *ngIf=\"!panorama\">{{ visit.label }}</strong>\r\n <lib-inventory-files [files]=\"visitFiles[visit.nodeID]\" (filesChange)=\"onFilesChange(visit, $event)\"\r\n [model3D]=\"visit.model3D\" [disabled]=\"running || launching || discarding\"></lib-inventory-files>\r\n </div>\r\n</ng-container>\r\n\r\n<div class=\"inventory-launch-delete\">\r\n <lib-checkbox-slider label=\"Delete previous inventory ?\" [checked]=\"deletePrevious\"\r\n [disabled]=\"launching || reuseDetections\" (checkedChange)=\"onDeletePreviousChange($event)\"></lib-checkbox-slider>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"deletePrevious\">\r\n {{ 'Equipment the AI added to these visits, deleted first' | translate }}: <strong>{{ aiEquipmentCount ?? '\u2026' }}</strong>\r\n </span>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"reuseDetections\">\r\n {{ 'Needed to reuse the detections, or every object would be there twice.' | translate }}\r\n </span>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"deleting\">\r\n {{ 'Deleting the previous inventory' | translate }}: {{ deleting.done }} / {{ deleting.total }}\r\n </span>\r\n</div>\r\n\r\n<!-- The last inventories' detections placed again with another cutoff: no panorama analysed again. -->\r\n<div class=\"inventory-launch-delete\" *ngIf=\"canReuse\">\r\n <lib-checkbox-slider label=\"Reuse the detections of the last inventory\" [checked]=\"reuseDetections\"\r\n [disabled]=\"launching\" (checkedChange)=\"onReuseChange($event)\"></lib-checkbox-slider>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"reuseDetections\">\r\n {{ 'Only the placing is done again, with the cutoff chosen: a few minutes.' | translate }}\r\n </span>\r\n</div>\r\n\r\n<!-- Once the cutoff is chosen, the detections kept to change it can go. -->\r\n<div class=\"inventory-launch-delete\" *ngIf=\"discardable.length > 0 || discarded\">\r\n <ng-container *ngIf=\"discardable.length > 0 && !confirmingDiscard\">\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-danger rounded-pill inventory-launch-discard\"\r\n [disabled]=\"running || launching\" (click)=\"confirmingDiscard = true\">\r\n {{ 'Discard the saved detections' | translate }}</button>\r\n <span class=\"inventory-launch-hint\">\r\n {{ 'Once the cutoff is chosen, this frees the space they take. The equipment stays.' | translate }}\r\n </span>\r\n </ng-container>\r\n <ng-container *ngIf=\"discardable.length > 0 && confirmingDiscard\">\r\n <span class=\"inventory-launch-hint\">\r\n {{ 'The equipment stays. To change the cutoff later, the panoramas will have to be analysed again.' | translate }}\r\n </span>\r\n <div class=\"inventory-launch-confirm\">\r\n <button type=\"button\" class=\"btn btn-sm btn-danger rounded-pill\" [disabled]=\"running || launching || discarding\"\r\n (click)=\"onConfirmDiscard()\">{{ (discarding ? 'Discarding\u2026' : 'Yes, discard') | translate }}</button>\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" [disabled]=\"discarding\"\r\n (click)=\"confirmingDiscard = false\">{{ 'No, keep them' | translate }}</button>\r\n </div>\r\n </ng-container>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"discarded\">{{ 'The saved detections were discarded.' | translate }}</span>\r\n</div>\r\n\r\n<div class=\"inventory-launch-settings\">\r\n <select class=\"no-lowercase form-select\" [(ngModel)]=\"model\" *ngIf=\"!reuseDetections\">\r\n <option [ngValue]=\"undefined\">{{ 'Select model' | translate }}</option>\r\n <option *ngFor=\"let option of models\" [ngValue]=\"option\">{{ option.name | translate }}</option>\r\n </select>\r\n <!-- Reusing, the detections keep the model that made them. -->\r\n <select class=\"no-lowercase form-select inventory-launch-reused-model\" *ngIf=\"reuseDetections\" disabled\r\n [title]=\"'The detections keep the model that made them.' | translate\">\r\n <option>{{ reusedModelName | translate }}</option>\r\n </select>\r\n <select class=\"form-select\" [(ngModel)]=\"cutoffScore\" [title]=\"'Cutoff score' | translate\">\r\n <option *ngFor=\"let score of cutoffScores\" [ngValue]=\"score\">{{ 'Cutoff score' | translate }} {{ score }}</option>\r\n </select>\r\n</div>\r\n\r\n<div class=\"inventory-launch-buttons\">\r\n <!-- Closes the panel only: \"Cancel the inventory\", below, is what stops one. -->\r\n <button type=\"button\" class=\"btn btn-outline-secondary rounded-pill inventory-launch-close\" [disabled]=\"launching\"\r\n (click)=\"cancelled.emit()\">{{ 'Close' | translate }}</button>\r\n <button type=\"button\" class=\"btn btn-outline-primary rounded-pill inventory-launch-go\" [disabled]=\"!canLaunch\"\r\n [title]=\"running ? ('An inventory is already running for this location.' | translate) : ''\"\r\n (click)=\"onLaunchClick()\">{{ (reuseDetections && canReuse ? 'Update' : 'Launch inventory') | translate }}</button>\r\n</div>\r\n\r\n<div class=\"text-danger mt-2\" *ngIf=\"message\">{{ message | translate: { count: notDeleted } }}</div>\r\n", styles: [":host{display:block}.inventory-launch-summary{padding-left:1.2rem;margin-bottom:.5rem}.inventory-launch-delete{margin:.75rem 0}.inventory-launch-hint{display:block;margin-top:.25rem;font-size:.8rem;color:#6c757d}.inventory-launch-confirm{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.25rem}.inventory-launch-settings{display:flex;flex-wrap:wrap;gap:.5rem}.inventory-launch-settings select{flex:1 1 10rem}.inventory-launch-buttons{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.75rem}\n"] }]
|
|
20250
20464
|
}], ctorParameters: () => [{ type: InventoryService }, { type: EquipmentService }, { type: NavigationService }], propDecorators: { spaceID: [{
|
|
20251
20465
|
type: Input
|
|
20252
20466
|
}], visits: [{
|
|
@@ -20434,27 +20648,27 @@ class BaseTagService {
|
|
|
20434
20648
|
throw new Error('updatePoiMetadata is not implemented in the base class.');
|
|
20435
20649
|
}*/
|
|
20436
20650
|
async prepareEquipmentHtml(equip) {
|
|
20437
|
-
throw new Error(`prepareEquipmentHtml is not implemented in the base class.
|
|
20651
|
+
throw new Error(`prepareEquipmentHtml is not implemented in the base class.
|
|
20438
20652
|
Please override this method in your extended class.`);
|
|
20439
20653
|
}
|
|
20440
20654
|
async prepareTicketHtml(ticket) {
|
|
20441
|
-
throw new Error(`prepareTicketHtml is not implemented in the base class.
|
|
20655
|
+
throw new Error(`prepareTicketHtml is not implemented in the base class.
|
|
20442
20656
|
Please override this method in your extended class.`);
|
|
20443
20657
|
}
|
|
20444
20658
|
async prepareFeatureHtml(feature) {
|
|
20445
|
-
throw new Error(`prepareFeatureHtml is not implemented in the base class.
|
|
20659
|
+
throw new Error(`prepareFeatureHtml is not implemented in the base class.
|
|
20446
20660
|
Please override this method in your extended class.`);
|
|
20447
20661
|
}
|
|
20448
20662
|
async prepareMeasurementHtml(measure) {
|
|
20449
|
-
throw new Error(`prepareMeasurementHtml is not implemented in the base class.
|
|
20663
|
+
throw new Error(`prepareMeasurementHtml is not implemented in the base class.
|
|
20450
20664
|
Please override this method in your extended class.`);
|
|
20451
20665
|
}
|
|
20452
20666
|
async prepareDeskHtml(feature) {
|
|
20453
|
-
throw new Error(`prepareDeskHtml is not implemented in the base class.
|
|
20667
|
+
throw new Error(`prepareDeskHtml is not implemented in the base class.
|
|
20454
20668
|
Please override this method in your extended class.`);
|
|
20455
20669
|
}
|
|
20456
20670
|
async prepareIndicatorHtml(feature) {
|
|
20457
|
-
throw new Error(`prepareDeskHtml is not implemented in the base class.
|
|
20671
|
+
throw new Error(`prepareDeskHtml is not implemented in the base class.
|
|
20458
20672
|
Please override this method in your extended class.`);
|
|
20459
20673
|
}
|
|
20460
20674
|
async getSignedTagIconSource(tagIconSrc) {
|
|
@@ -20463,15 +20677,15 @@ class BaseTagService {
|
|
|
20463
20677
|
getIconTagImageForFeature(feature, poi) {
|
|
20464
20678
|
// const tagIcon = JSON.parse(poi.tagIcon);
|
|
20465
20679
|
// return tagIcon.src;
|
|
20466
|
-
throw new Error(`getIconTagImageForFeature is not implemented in the base class.
|
|
20680
|
+
throw new Error(`getIconTagImageForFeature is not implemented in the base class.
|
|
20467
20681
|
Please override this method in your extended class.`);
|
|
20468
20682
|
}
|
|
20469
20683
|
getScriptForTag(object, tagType) {
|
|
20470
|
-
throw new Error(`getScriptForTag is not implemented in the base class.
|
|
20684
|
+
throw new Error(`getScriptForTag is not implemented in the base class.
|
|
20471
20685
|
Please override this method in your extended class.`);
|
|
20472
20686
|
}
|
|
20473
20687
|
getAnnexeForCommentTypeInFeature(feature, commentType) {
|
|
20474
|
-
throw new Error(`getAnnexeForCommentTypeInFeature is not implemented in the base class.
|
|
20688
|
+
throw new Error(`getAnnexeForCommentTypeInFeature is not implemented in the base class.
|
|
20475
20689
|
Please override this method in your extended class.`);
|
|
20476
20690
|
}
|
|
20477
20691
|
getBillboardMediaToEmbed(object) {
|
|
@@ -20480,27 +20694,27 @@ class BaseTagService {
|
|
|
20480
20694
|
return { comment: null, tagDescription: '' };
|
|
20481
20695
|
}
|
|
20482
20696
|
onActionDetailClick(url) {
|
|
20483
|
-
throw new Error(`onActionDetailClick is not implemented in the base class.
|
|
20697
|
+
throw new Error(`onActionDetailClick is not implemented in the base class.
|
|
20484
20698
|
Please override this method in your extended class.`);
|
|
20485
20699
|
}
|
|
20486
20700
|
onActionAudioClick(audioCommentID) {
|
|
20487
|
-
throw new Error(`onActionDetailClick is not implemented in the base class.
|
|
20701
|
+
throw new Error(`onActionDetailClick is not implemented in the base class.
|
|
20488
20702
|
Please override this method in your extended class.`);
|
|
20489
20703
|
}
|
|
20490
20704
|
onActionVideoClick(url) {
|
|
20491
|
-
throw new Error(`onActionVideoClick is not implemented in the base class.
|
|
20705
|
+
throw new Error(`onActionVideoClick is not implemented in the base class.
|
|
20492
20706
|
Please override this method in your extended class.`);
|
|
20493
20707
|
}
|
|
20494
20708
|
onActionImageClick(imageCommentID) {
|
|
20495
|
-
throw new Error(`onActionImageClick is not implemented in the base class.
|
|
20709
|
+
throw new Error(`onActionImageClick is not implemented in the base class.
|
|
20496
20710
|
Please override this method in your extended class.`);
|
|
20497
20711
|
}
|
|
20498
20712
|
onActionDocClick(url) {
|
|
20499
|
-
throw new Error(`onActionDocClick is not implemented in the base class.
|
|
20713
|
+
throw new Error(`onActionDocClick is not implemented in the base class.
|
|
20500
20714
|
Please override this method in your extended class.`);
|
|
20501
20715
|
}
|
|
20502
20716
|
onActionYoutubeClick(url) {
|
|
20503
|
-
throw new Error(`onActionYoutubeClick is not implemented in the base class.
|
|
20717
|
+
throw new Error(`onActionYoutubeClick is not implemented in the base class.
|
|
20504
20718
|
Please override this method in your extended class.`);
|
|
20505
20719
|
}
|
|
20506
20720
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BaseTagService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -21887,6 +22101,285 @@ function applyRigidTransformToDirection(v, t) {
|
|
|
21887
22101
|
z: v.x * sin + v.z * cos
|
|
21888
22102
|
};
|
|
21889
22103
|
}
|
|
22104
|
+
/**
|
|
22105
|
+
* Applies the rotation part of the transform to an object's orientation: the Euler angles
|
|
22106
|
+
* (radians, three.js "XYZ" order, the one Object3D.rotation is stored and loaded in).
|
|
22107
|
+
*
|
|
22108
|
+
* A 3D object placed in the scene keeps its full orientation, so adding the angle to the Y
|
|
22109
|
+
* component only — as applyRigidTransformToYRotationDeg() does for a tag's heading — would be
|
|
22110
|
+
* wrong as soon as the object is tilted on X or Z. The rotation is composed instead: the
|
|
22111
|
+
* object's own rotation first, then the turn around the vertical axis of the whole model.
|
|
22112
|
+
*
|
|
22113
|
+
* The turn is the one applyRigidTransformToPoint() applies to positions, written for (x, z) as
|
|
22114
|
+
* x' = x cos(a) - z sin(a), z' = x sin(a) + z cos(a): in three.js terms a rotation of -a
|
|
22115
|
+
* around +Y. So an object keeps pointing at the same thing in both models.
|
|
22116
|
+
*/
|
|
22117
|
+
function applyRigidTransformToEulerXYZ(rotation, t) {
|
|
22118
|
+
if (!t.rotationYRad) {
|
|
22119
|
+
// no turn: the stored angles are kept exactly (a round trip through a quaternion
|
|
22120
|
+
// could give an equivalent but differently written set of angles)
|
|
22121
|
+
return { x: rotation.x, y: rotation.y, z: rotation.z };
|
|
22122
|
+
}
|
|
22123
|
+
const objectRotation = new Quaternion().setFromEuler(new Euler(rotation.x, rotation.y, rotation.z, 'XYZ'));
|
|
22124
|
+
const modelTurn = new Quaternion().setFromAxisAngle(new Vector3(0, 1, 0), -t.rotationYRad);
|
|
22125
|
+
const turned = new Euler().setFromQuaternion(objectRotation.premultiply(modelTurn), 'XYZ');
|
|
22126
|
+
return { x: turned.x, y: turned.y, z: turned.z };
|
|
22127
|
+
}
|
|
22128
|
+
|
|
22129
|
+
// tag-archive.util.ts
|
|
22130
|
+
//
|
|
22131
|
+
// File format of the tag export / import (see MatterportTagCopyService.exportTagsToArchive()
|
|
22132
|
+
// and importTagsFromArchive()). An archive moves every tag of a location — and everything a
|
|
22133
|
+
// tag points at — from one environment (dev, demo, staging, production) to another, where
|
|
22134
|
+
// database ids and the S3 bucket are different.
|
|
22135
|
+
//
|
|
22136
|
+
// It is a ZIP file:
|
|
22137
|
+
// manifest.json format, version, origin of the export, the data and the file index
|
|
22138
|
+
// files/<n>_<name> one entry per S3 file referenced by the data (photos, attachments,
|
|
22139
|
+
// 3D models, tag icons...), stored as is (no recompression of media)
|
|
22140
|
+
//
|
|
22141
|
+
// The data keeps the records exactly as the source environment returned them: ids included,
|
|
22142
|
+
// since they are what links the records together (POI.elementID, Comment.featureID,
|
|
22143
|
+
// POI.tagImageID...). They are never written as is in the target: the import creates new
|
|
22144
|
+
// records and remaps every reference, like the copy between two locations does.
|
|
22145
|
+
const TAG_ARCHIVE_FORMAT = 'smarterplan-tags';
|
|
22146
|
+
/** Bumped on any change of the manifest that an older import could misread. */
|
|
22147
|
+
const TAG_ARCHIVE_VERSION = 1;
|
|
22148
|
+
const TAG_ARCHIVE_MANIFEST = 'manifest.json';
|
|
22149
|
+
const TAG_ARCHIVE_FILES_FOLDER = 'files/';
|
|
22150
|
+
/** Why an archive cannot be read. `code` is the end of a `matterportCopy.*` translation key. */
|
|
22151
|
+
class TagArchiveError extends Error {
|
|
22152
|
+
code;
|
|
22153
|
+
params;
|
|
22154
|
+
constructor(code, params = {}) {
|
|
22155
|
+
super(`Invalid tag archive: ${code}`);
|
|
22156
|
+
this.code = code;
|
|
22157
|
+
this.params = params;
|
|
22158
|
+
this.name = 'TagArchiveError';
|
|
22159
|
+
}
|
|
22160
|
+
}
|
|
22161
|
+
/** Archive path of the n-th exported file. The original name is kept for readability only. */
|
|
22162
|
+
function tagArchiveFilePath(index, s3Key) {
|
|
22163
|
+
const name = (s3Key.substring(s3Key.lastIndexOf('/') + 1) || 'file').replace(/[^a-zA-Z0-9.\-_]/g, '_');
|
|
22164
|
+
return `${TAG_ARCHIVE_FILES_FOLDER}${index}_${name}`;
|
|
22165
|
+
}
|
|
22166
|
+
/**
|
|
22167
|
+
* Packs a manifest and its files into a ZIP. Media files are stored without compression:
|
|
22168
|
+
* images, videos and models are already compressed, recompressing them only costs time.
|
|
22169
|
+
*/
|
|
22170
|
+
function buildTagArchive(manifest, files) {
|
|
22171
|
+
const entries = {
|
|
22172
|
+
[TAG_ARCHIVE_MANIFEST]: [strToU8(JSON.stringify(manifest)), { level: 6 }]
|
|
22173
|
+
};
|
|
22174
|
+
for (const [path, bytes] of Object.entries(files)) {
|
|
22175
|
+
entries[path] = [bytes, { level: 0 }];
|
|
22176
|
+
}
|
|
22177
|
+
return zipSync(entries);
|
|
22178
|
+
}
|
|
22179
|
+
/**
|
|
22180
|
+
* Reads a ZIP produced by buildTagArchive(). Checks the format and the version, not the
|
|
22181
|
+
* module: see MatterportTagCopyService.readTagArchive().
|
|
22182
|
+
*/
|
|
22183
|
+
function readTagArchive(bytes) {
|
|
22184
|
+
let entries;
|
|
22185
|
+
try {
|
|
22186
|
+
entries = unzipSync(bytes);
|
|
22187
|
+
}
|
|
22188
|
+
catch {
|
|
22189
|
+
throw new TagArchiveError('errorArchiveNotZip');
|
|
22190
|
+
}
|
|
22191
|
+
const manifestBytes = entries[TAG_ARCHIVE_MANIFEST];
|
|
22192
|
+
if (!manifestBytes) {
|
|
22193
|
+
throw new TagArchiveError('errorArchiveNoManifest');
|
|
22194
|
+
}
|
|
22195
|
+
let manifest;
|
|
22196
|
+
try {
|
|
22197
|
+
manifest = JSON.parse(strFromU8(manifestBytes));
|
|
22198
|
+
}
|
|
22199
|
+
catch {
|
|
22200
|
+
throw new TagArchiveError('errorArchiveNoManifest');
|
|
22201
|
+
}
|
|
22202
|
+
if (manifest?.format !== TAG_ARCHIVE_FORMAT || !manifest.data || !manifest.origin) {
|
|
22203
|
+
throw new TagArchiveError('errorArchiveNoManifest');
|
|
22204
|
+
}
|
|
22205
|
+
if (manifest.version > TAG_ARCHIVE_VERSION) {
|
|
22206
|
+
throw new TagArchiveError('errorArchiveVersion', { version: manifest.version });
|
|
22207
|
+
}
|
|
22208
|
+
const files = {};
|
|
22209
|
+
for (const [path, content] of Object.entries(entries)) {
|
|
22210
|
+
if (path.startsWith(TAG_ARCHIVE_FILES_FOLDER)) {
|
|
22211
|
+
files[path] = content;
|
|
22212
|
+
}
|
|
22213
|
+
}
|
|
22214
|
+
return { manifest, files };
|
|
22215
|
+
}
|
|
22216
|
+
|
|
22217
|
+
// object3d-model.util.ts
|
|
22218
|
+
//
|
|
22219
|
+
// Where the model file of an Object3D lives, and the checks a model file uploaded by a user
|
|
22220
|
+
// must pass before it is stored.
|
|
22221
|
+
//
|
|
22222
|
+
// Object3D.path means one of three things:
|
|
22223
|
+
// - s3Bucket === true -> key of a file uploaded to our S3 bucket (public level);
|
|
22224
|
+
// - an absolute http(s) url -> a model hosted elsewhere;
|
|
22225
|
+
// - otherwise "3DObjects/objects/<file>" -> a model of the library shipped with the application
|
|
22226
|
+
// (assets/3Dobjects/objects/<file>).
|
|
22227
|
+
//
|
|
22228
|
+
// Uploaded models are restricted to binary glTF (.glb): the viewer reads an S3 file through a
|
|
22229
|
+
// signed url, next to which no companion file (textures, .bin, .mtl) could be resolved. A .glb
|
|
22230
|
+
// carries everything in a single file.
|
|
22231
|
+
/** Folder of the library models, as stored in Object3D.path. */
|
|
22232
|
+
const OBJECT3D_LIBRARY_FOLDER = '3DObjects/objects/';
|
|
22233
|
+
/** Folder the application serves the library models from (see MatterportObject3DService). */
|
|
22234
|
+
const OBJECT3D_LIBRARY_ASSET_FOLDER = 'assets/3Dobjects/objects/';
|
|
22235
|
+
/** Largest model file a user may upload. */
|
|
22236
|
+
const OBJECT3D_UPLOAD_MAX_BYTES = 50 * 1024 * 1024;
|
|
22237
|
+
/** S3 folder of the uploaded models; one sub-folder per space. */
|
|
22238
|
+
const OBJECT3D_S3_FOLDER = 'objects3D/';
|
|
22239
|
+
/** Model formats the 3D loaders handle (an S3 model copied between locations keeps its own). */
|
|
22240
|
+
const OBJECT3D_MODEL_EXTENSIONS = ['glb', 'gltf', 'obj', 'fbx', 'dae'];
|
|
22241
|
+
/** Content type the uploaded models are stored with. */
|
|
22242
|
+
const GLB_CONTENT_TYPE = 'model/gltf-binary';
|
|
22243
|
+
const GLB_MAGIC = 0x46546c67; // "glTF", little endian
|
|
22244
|
+
const GLB_CHUNK_JSON = 0x4e4f534a; // "JSON"
|
|
22245
|
+
const GLB_HEADER_BYTES = 12;
|
|
22246
|
+
const GLB_CHUNK_HEADER_BYTES = 8;
|
|
22247
|
+
/**
|
|
22248
|
+
* Checks that a file is a self-contained binary glTF 2.0 model, small enough to be uploaded:
|
|
22249
|
+
* - name ending in .glb, size between 1 byte and OBJECT3D_UPLOAD_MAX_BYTES;
|
|
22250
|
+
* - glb header: magic "glTF", version 2, declared length equal to the file size;
|
|
22251
|
+
* - first chunk of type JSON, holding a parseable glTF document of version 2.x;
|
|
22252
|
+
* - no buffer nor image pointing at another file or url (only embedded data): such a
|
|
22253
|
+
* reference cannot be resolved next to a signed S3 url, and would make the viewer fetch
|
|
22254
|
+
* an arbitrary address.
|
|
22255
|
+
* The content is only read, never executed. Returns the error, or null when the file is valid.
|
|
22256
|
+
*/
|
|
22257
|
+
async function validateGlbFile(file) {
|
|
22258
|
+
const name = (file.name || '').toLowerCase();
|
|
22259
|
+
if (!name.endsWith('.glb')) {
|
|
22260
|
+
return 'Only .glb files can be uploaded.';
|
|
22261
|
+
}
|
|
22262
|
+
if (!file.size) {
|
|
22263
|
+
return 'The file is empty.';
|
|
22264
|
+
}
|
|
22265
|
+
if (file.size > OBJECT3D_UPLOAD_MAX_BYTES) {
|
|
22266
|
+
return 'The file is too large (50 MB maximum).';
|
|
22267
|
+
}
|
|
22268
|
+
if (file.size < GLB_HEADER_BYTES + GLB_CHUNK_HEADER_BYTES) {
|
|
22269
|
+
return 'This file is not a valid .glb model.';
|
|
22270
|
+
}
|
|
22271
|
+
const header = new DataView(await file.slice(0, GLB_HEADER_BYTES + GLB_CHUNK_HEADER_BYTES).arrayBuffer());
|
|
22272
|
+
const magic = header.getUint32(0, true);
|
|
22273
|
+
const version = header.getUint32(4, true);
|
|
22274
|
+
const declaredLength = header.getUint32(8, true);
|
|
22275
|
+
const jsonLength = header.getUint32(12, true);
|
|
22276
|
+
const jsonType = header.getUint32(16, true);
|
|
22277
|
+
const jsonStart = GLB_HEADER_BYTES + GLB_CHUNK_HEADER_BYTES;
|
|
22278
|
+
if (magic !== GLB_MAGIC || version !== 2 || declaredLength !== file.size
|
|
22279
|
+
|| jsonType !== GLB_CHUNK_JSON || jsonLength === 0 || jsonStart + jsonLength > file.size) {
|
|
22280
|
+
return 'This file is not a valid .glb model.';
|
|
22281
|
+
}
|
|
22282
|
+
let gltf;
|
|
22283
|
+
try {
|
|
22284
|
+
const jsonText = new TextDecoder('utf-8', { fatal: true })
|
|
22285
|
+
.decode(await file.slice(jsonStart, jsonStart + jsonLength).arrayBuffer());
|
|
22286
|
+
gltf = JSON.parse(jsonText);
|
|
22287
|
+
}
|
|
22288
|
+
catch {
|
|
22289
|
+
return 'This file is not a valid .glb model.';
|
|
22290
|
+
}
|
|
22291
|
+
if (!gltf || typeof gltf !== 'object' || !/^2\./.test(String(gltf.asset?.version ?? ''))) {
|
|
22292
|
+
return 'This file is not a valid .glb model.';
|
|
22293
|
+
}
|
|
22294
|
+
const references = [...asArray(gltf.buffers), ...asArray(gltf.images)]
|
|
22295
|
+
.map((item) => item?.uri)
|
|
22296
|
+
.filter((uri) => uri !== undefined && uri !== null);
|
|
22297
|
+
if (references.some((uri) => typeof uri !== 'string' || !uri.startsWith('data:'))) {
|
|
22298
|
+
return 'This model refers to external files: export it as a single .glb file with embedded textures.';
|
|
22299
|
+
}
|
|
22300
|
+
return null;
|
|
22301
|
+
}
|
|
22302
|
+
function asArray(value) {
|
|
22303
|
+
return Array.isArray(value) ? value : [];
|
|
22304
|
+
}
|
|
22305
|
+
/**
|
|
22306
|
+
* S3 key of an uploaded model: under the space's folder, with a file name reduced to safe
|
|
22307
|
+
* characters, followed by the upload time (UTC, to the millisecond) and a short random suffix.
|
|
22308
|
+
* S3 overwrites an existing key without warning, and a model may be used by several objects
|
|
22309
|
+
* (duplicates, copies, imports): two uploads of the same file name must never share a key.
|
|
22310
|
+
* The user's file name never decides the folder.
|
|
22311
|
+
*/
|
|
22312
|
+
function buildObject3DModelKey(spaceId, fileName, now = new Date()) {
|
|
22313
|
+
const base = (fileName || 'model.glb').split(/[\\/]/).pop() || 'model.glb';
|
|
22314
|
+
const withoutExtension = base.replace(/\.[^.]*$/, '');
|
|
22315
|
+
// a copied model keeps its format (the loader is chosen by the extension); anything else is a .glb
|
|
22316
|
+
const extension = OBJECT3D_MODEL_EXTENSIONS.find(ext => base.toLowerCase().endsWith(`.${ext}`)) ?? 'glb';
|
|
22317
|
+
const safeName = withoutExtension
|
|
22318
|
+
.normalize('NFD').replace(/[̀-ͯ]/g, '')
|
|
22319
|
+
.replace(/[^a-zA-Z0-9\-_]+/g, '_')
|
|
22320
|
+
.replace(/^_+|_+$/g, '')
|
|
22321
|
+
.substring(0, 80) || 'model';
|
|
22322
|
+
const safeSpace = (spaceId || 'space').replace(/[^a-zA-Z0-9\-_]/g, '');
|
|
22323
|
+
// 20261126T104512345Z: sortable, and free of the characters S3 keys handle badly (":" ".")
|
|
22324
|
+
const timestamp = now.toISOString().replace(/[-:.]/g, '');
|
|
22325
|
+
const random = Math.random().toString(36).slice(2, 6).padEnd(4, '0');
|
|
22326
|
+
return `${OBJECT3D_S3_FOLDER}${safeSpace}/${safeName}_${timestamp}_${random}.${extension}`;
|
|
22327
|
+
}
|
|
22328
|
+
/** File name and extension of a path or url ("a/b/chair.GLB?v=2" gives chair / glb). */
|
|
22329
|
+
function splitModelFile(path) {
|
|
22330
|
+
const file = path.split(/[?#]/)[0].split('/').pop() || '';
|
|
22331
|
+
const dotIndex = file.lastIndexOf('.');
|
|
22332
|
+
if (dotIndex <= 0 || dotIndex === file.length - 1) {
|
|
22333
|
+
return null;
|
|
22334
|
+
}
|
|
22335
|
+
return { object: file.slice(0, dotIndex), format: file.slice(dotIndex + 1).toLowerCase() };
|
|
22336
|
+
}
|
|
22337
|
+
/** File name of a library model ("3DObjects/objects/chair.glb" gives "chair.glb"), null otherwise. */
|
|
22338
|
+
function getObject3DLibraryFile(path) {
|
|
22339
|
+
if (!path || /^https?:\/\//i.test(path)) {
|
|
22340
|
+
return null;
|
|
22341
|
+
}
|
|
22342
|
+
const markerIndex = path.indexOf(OBJECT3D_LIBRARY_FOLDER);
|
|
22343
|
+
if (markerIndex === -1) {
|
|
22344
|
+
return null;
|
|
22345
|
+
}
|
|
22346
|
+
return path.slice(markerIndex + OBJECT3D_LIBRARY_FOLDER.length) || null;
|
|
22347
|
+
}
|
|
22348
|
+
/**
|
|
22349
|
+
* Where to load the model of an Object3D from (see the header of this file). A model uploaded
|
|
22350
|
+
* to S3 gets a signed url, valid for a limited time: resolve it when loading, never store it.
|
|
22351
|
+
* Null when the path is unusable.
|
|
22352
|
+
*/
|
|
22353
|
+
async function resolveObject3DModelSource(object3D) {
|
|
22354
|
+
const path = object3D?.path;
|
|
22355
|
+
if (!path) {
|
|
22356
|
+
return null;
|
|
22357
|
+
}
|
|
22358
|
+
if (object3D.s3Bucket) {
|
|
22359
|
+
const parsed = splitModelFile(path);
|
|
22360
|
+
const url = parsed ? await getSignedFile(path) : null;
|
|
22361
|
+
return parsed && url ? { ...parsed, url } : null;
|
|
22362
|
+
}
|
|
22363
|
+
if (/^https?:\/\/\S+$/i.test(path)) {
|
|
22364
|
+
const parsed = splitModelFile(path);
|
|
22365
|
+
return parsed ? { ...parsed, url: path } : null;
|
|
22366
|
+
}
|
|
22367
|
+
const libraryFile = getObject3DLibraryFile(path);
|
|
22368
|
+
return libraryFile ? splitModelFile(libraryFile) : null;
|
|
22369
|
+
}
|
|
22370
|
+
|
|
22371
|
+
/**
|
|
22372
|
+
* Whether this application may write 3D model files to S3: a model uploaded by the operator,
|
|
22373
|
+
* a library model restored from a tag archive, a model copied with a 3D object.
|
|
22374
|
+
*
|
|
22375
|
+
* True by default. An application not ready for it yet provides false (see the app.module.ts
|
|
22376
|
+
* of smarterplan-museum): tag copies and imports then never create a model file — a 3D object
|
|
22377
|
+
* whose model would need one is reported in the log instead.
|
|
22378
|
+
*/
|
|
22379
|
+
const OBJECT3D_MODEL_UPLOAD_ENABLED = new InjectionToken('OBJECT3D_MODEL_UPLOAD_ENABLED', {
|
|
22380
|
+
providedIn: 'root',
|
|
22381
|
+
factory: () => true
|
|
22382
|
+
});
|
|
21890
22383
|
|
|
21891
22384
|
/* eslint-disable class-methods-use-this */
|
|
21892
22385
|
class Object3DService {
|
|
@@ -21894,6 +22387,7 @@ class Object3DService {
|
|
|
21894
22387
|
navigatorService;
|
|
21895
22388
|
zoneChangeService;
|
|
21896
22389
|
filterService;
|
|
22390
|
+
poiService;
|
|
21897
22391
|
API; //AWS APIService
|
|
21898
22392
|
objects3DUpdated = new Subject();
|
|
21899
22393
|
currentObjects3D = {
|
|
@@ -21922,12 +22416,15 @@ class Object3DService {
|
|
|
21922
22416
|
isMuseumUser = false;
|
|
21923
22417
|
isUpdating = false;
|
|
21924
22418
|
destroy$ = new Subject();
|
|
22419
|
+
/** Counts the calls to initObjects3D, so that only the latest one publishes its lists. */
|
|
22420
|
+
initObjects3DRun = 0;
|
|
21925
22421
|
selectedObject3D; // selected from sprite carrousel viewer (lib of objects3D)
|
|
21926
|
-
constructor(apiInjected, userService, navigatorService, zoneChangeService, filterService) {
|
|
22422
|
+
constructor(apiInjected, userService, navigatorService, zoneChangeService, filterService, poiService) {
|
|
21927
22423
|
this.userService = userService;
|
|
21928
22424
|
this.navigatorService = navigatorService;
|
|
21929
22425
|
this.zoneChangeService = zoneChangeService;
|
|
21930
22426
|
this.filterService = filterService;
|
|
22427
|
+
this.poiService = poiService;
|
|
21931
22428
|
this.API = apiInjected;
|
|
21932
22429
|
// this.isMuseumUser = this.userService.hasOnlyMuseumRole(); // Not used yet!
|
|
21933
22430
|
this.objects3DUpdated.subscribe((list) => {
|
|
@@ -21970,18 +22467,30 @@ class Object3DService {
|
|
|
21970
22467
|
if (!this.currentSpaceID) {
|
|
21971
22468
|
return;
|
|
21972
22469
|
}
|
|
22470
|
+
const run = ++this.initObjects3DRun;
|
|
22471
|
+
// Moving an object reloads the list twice - once for the object, once its POI has followed it -
|
|
22472
|
+
// and the first call, which read the POI before it moved, may answer last: it is ignored then.
|
|
22473
|
+
const hasNewerCall = () => run !== this.initObjects3DRun;
|
|
21973
22474
|
this.updating.next(true);
|
|
21974
22475
|
this.isUpdating = true;
|
|
21975
22476
|
const object3DList = await this.getObjects3DBySpace(this.currentSpaceID);
|
|
22477
|
+
if (hasNewerCall()) {
|
|
22478
|
+
return;
|
|
22479
|
+
}
|
|
22480
|
+
// The list may be read before it shows the POI just moved with its object.
|
|
22481
|
+
this.poiService.withLatestPois(object3DList);
|
|
21976
22482
|
if (object3DList.length > 0) {
|
|
21977
22483
|
let filteredObjects3D = [...object3DList];
|
|
21978
|
-
this.currentObjects3D.zone = filteredObjects3D; // not sorted!
|
|
21979
22484
|
filteredObjects3D =
|
|
21980
22485
|
await this.filterService.filterObjectsForCurrentUserInSpace(filteredObjects3D, this.currentSpaceID);
|
|
21981
|
-
|
|
22486
|
+
const objects3DSpace = filteredObjects3D;
|
|
21982
22487
|
if (this.zoneIDFilter) {
|
|
21983
22488
|
filteredObjects3D = await this.filterService.filterObjectsForZone(filteredObjects3D, this.zoneIDFilter);
|
|
21984
22489
|
}
|
|
22490
|
+
if (hasNewerCall()) {
|
|
22491
|
+
return;
|
|
22492
|
+
}
|
|
22493
|
+
this.currentObjects3D.space = objects3DSpace;
|
|
21985
22494
|
this.currentObjects3D.zone = filteredObjects3D;
|
|
21986
22495
|
this.objects3DUpdated.next(this.currentObjects3D);
|
|
21987
22496
|
}
|
|
@@ -22241,7 +22750,7 @@ class Object3DService {
|
|
|
22241
22750
|
}
|
|
22242
22751
|
return receivedObject3D;
|
|
22243
22752
|
}
|
|
22244
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: Object3DService, deps: [{ token: 'currentAPIService' }, { token: BaseUserService }, { token: NavigatorService }, { token: ZoneChangeService }, { token: FilterService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
22753
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: Object3DService, deps: [{ token: 'currentAPIService' }, { token: BaseUserService }, { token: NavigatorService }, { token: ZoneChangeService }, { token: FilterService }, { token: PoiService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
22245
22754
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: Object3DService, providedIn: "root" });
|
|
22246
22755
|
}
|
|
22247
22756
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: Object3DService, decorators: [{
|
|
@@ -22252,7 +22761,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
22252
22761
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
22253
22762
|
type: Inject,
|
|
22254
22763
|
args: ['currentAPIService']
|
|
22255
|
-
}] }, { type: BaseUserService }, { type: NavigatorService }, { type: ZoneChangeService }, { type: FilterService }] });
|
|
22764
|
+
}] }, { type: BaseUserService }, { type: NavigatorService }, { type: ZoneChangeService }, { type: FilterService }, { type: PoiService }] });
|
|
22256
22765
|
|
|
22257
22766
|
class DomainService {
|
|
22258
22767
|
API; //AWS
|
|
@@ -22348,6 +22857,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
22348
22857
|
args: ['currentAPIService']
|
|
22349
22858
|
}] }] });
|
|
22350
22859
|
|
|
22860
|
+
/** Rotation 0, no translation: leaves every position and orientation unchanged. */
|
|
22861
|
+
const IDENTITY_TRANSFORM = {
|
|
22862
|
+
rotationYRad: 0,
|
|
22863
|
+
refSource: { x: 0, y: 0, z: 0 },
|
|
22864
|
+
refTarget: { x: 0, y: 0, z: 0 }
|
|
22865
|
+
};
|
|
22351
22866
|
/** Safely extracts a readable message from an unknown catch value, including Amplify's
|
|
22352
22867
|
* GraphQL error shape ({ data, errors: [{ errorType, message }] }). */
|
|
22353
22868
|
function toErrorMessage(err) {
|
|
@@ -22389,6 +22904,16 @@ class MissingS3FileError extends Error {
|
|
|
22389
22904
|
this.name = 'MissingS3FileError';
|
|
22390
22905
|
}
|
|
22391
22906
|
}
|
|
22907
|
+
/** Thrown when a 3D object would need a model file written to S3 while this application does
|
|
22908
|
+
* not allow it (see OBJECT3D_MODEL_UPLOAD_ENABLED): the object is skipped and reported. */
|
|
22909
|
+
class Object3DModelUploadDisabledError extends Error {
|
|
22910
|
+
objectName;
|
|
22911
|
+
constructor(objectName) {
|
|
22912
|
+
super(`3D model upload disabled in this application, object "${objectName}" skipped`);
|
|
22913
|
+
this.objectName = objectName;
|
|
22914
|
+
this.name = 'Object3DModelUploadDisabledError';
|
|
22915
|
+
}
|
|
22916
|
+
}
|
|
22392
22917
|
class MatterportTagCopyService {
|
|
22393
22918
|
navigationService;
|
|
22394
22919
|
userService;
|
|
@@ -22405,6 +22930,7 @@ class MatterportTagCopyService {
|
|
|
22405
22930
|
domainService;
|
|
22406
22931
|
translate;
|
|
22407
22932
|
zoneService;
|
|
22933
|
+
modelUploadEnabled;
|
|
22408
22934
|
// Emits progress updates during copyTagsFromVisit(); null when idle
|
|
22409
22935
|
copyProgress$ = new BehaviorSubject(null);
|
|
22410
22936
|
// Emits the accumulated log lines during copyTagsFromVisit(); [] when idle
|
|
@@ -22464,7 +22990,26 @@ class MatterportTagCopyService {
|
|
|
22464
22990
|
targetDomainIdsByTypeAndName = new Map();
|
|
22465
22991
|
/** Target space id of the run in progress — used to re-home copied tag icons. */
|
|
22466
22992
|
targetSpaceId = null;
|
|
22467
|
-
|
|
22993
|
+
// Import of an archive (importTagsFromArchive()). The archive comes from ANOTHER
|
|
22994
|
+
// environment, whose ids designate nothing here: its users, missions and categories are
|
|
22995
|
+
// re-pointed to simple local values instead of being matched like a copy does.
|
|
22996
|
+
/** archive being imported; null for a copy between two locations */
|
|
22997
|
+
archive = null;
|
|
22998
|
+
/** an imported comment is credited to the operator running the import (their mission
|
|
22999
|
+
* on the target space): the original author's mission belongs to another environment */
|
|
23000
|
+
importOwnerMissionId = null;
|
|
23001
|
+
/** organisation in which the categories missing from the target are created on import */
|
|
23002
|
+
importDomainOrganisationId = null;
|
|
23003
|
+
/** same Matterport model on both sides: a source sweep id is kept when the target has it */
|
|
23004
|
+
keepSweepIds = false;
|
|
23005
|
+
/** library model file -> whether this application ships it (import only) */
|
|
23006
|
+
libraryModelAvailability = new Map();
|
|
23007
|
+
/** model reference (see object3DModelKeyOf()) -> .glb chosen by the operator to replace it */
|
|
23008
|
+
replacementModels = new Map();
|
|
23009
|
+
/** model reference -> S3 key its replacement was uploaded to: a model shared by several
|
|
23010
|
+
* objects is uploaded once */
|
|
23011
|
+
uploadedReplacementKeys = new Map();
|
|
23012
|
+
constructor(navigationService, userService, poiService, ticketService, equipmentService, object3DService, featureService, measurementService, commentService, hashtagService, missionService, operationService, domainService, translate, zoneService, modelUploadEnabled) {
|
|
22468
23013
|
this.navigationService = navigationService;
|
|
22469
23014
|
this.userService = userService;
|
|
22470
23015
|
this.poiService = poiService;
|
|
@@ -22480,20 +23025,68 @@ class MatterportTagCopyService {
|
|
|
22480
23025
|
this.domainService = domainService;
|
|
22481
23026
|
this.translate = translate;
|
|
22482
23027
|
this.zoneService = zoneService;
|
|
23028
|
+
this.modelUploadEnabled = modelUploadEnabled;
|
|
22483
23029
|
this.spModule = userService.getSpModule();
|
|
22484
23030
|
}
|
|
23031
|
+
/** Whether this application may write 3D model files (see OBJECT3D_MODEL_UPLOAD_ENABLED). */
|
|
23032
|
+
get object3DModelUploadEnabled() {
|
|
23033
|
+
return this.modelUploadEnabled !== false;
|
|
23034
|
+
}
|
|
22485
23035
|
//
|
|
22486
23036
|
// ---------- Public API ----------
|
|
22487
23037
|
//
|
|
22488
23038
|
async copyTagsFromVisit(sourceSpaceId, targetSpaceId, landmarkSourceA, landmarkTargetA, landmarkSourceB, landmarkTargetB) {
|
|
23039
|
+
console.log(`Copying Tags from source ${sourceSpaceId} to target ${targetSpaceId}`);
|
|
23040
|
+
const transform = computeRigidTransform(landmarkSourceA, landmarkTargetA, landmarkSourceB, landmarkTargetB);
|
|
23041
|
+
console.log('Rigid transform computed:', {
|
|
23042
|
+
rotationYDeg: transform.rotationYRad * (180 / Math.PI),
|
|
23043
|
+
refSource: transform.refSource,
|
|
23044
|
+
refTarget: transform.refTarget
|
|
23045
|
+
});
|
|
23046
|
+
return this.runCopy(targetSpaceId, transform, () => this.collectLiveSnapshot(sourceSpaceId));
|
|
23047
|
+
}
|
|
23048
|
+
/**
|
|
23049
|
+
* Imports into a location the tags of an archive produced by exportTagsToArchive(),
|
|
23050
|
+
* possibly on another environment (dev, demo, staging, production).
|
|
23051
|
+
*
|
|
23052
|
+
* Runs the very same phases as copyTagsFromVisit(), the source being the archive instead
|
|
23053
|
+
* of a location: same deduplication (re-importing the same archive creates nothing twice),
|
|
23054
|
+
* same healing, same keyword handling. What differs is how references are re-pointed,
|
|
23055
|
+
* since the archive's ids designate nothing on this environment:
|
|
23056
|
+
* - files are re-uploaded from the archive instead of being copied inside the bucket;
|
|
23057
|
+
* - comments are credited to the operator running the import (see importOwnerMissionId);
|
|
23058
|
+
* - categories are matched by name, and created in the operator's organisation when the
|
|
23059
|
+
* target has none of that name (see resolveImportedDomainID()).
|
|
23060
|
+
*/
|
|
23061
|
+
async importTagsFromArchive(archive, targetSpaceId, calibration, replacementModels = {}) {
|
|
23062
|
+
const origin = archive.manifest.origin;
|
|
23063
|
+
console.log(`Importing Tags exported from ${origin.environment} (space ${origin.spaceId}) to target ${targetSpaceId}`);
|
|
23064
|
+
const transform = calibration.mode === 'LANDMARKS'
|
|
23065
|
+
? computeRigidTransform(calibration.landmarkSourceA, calibration.landmarkTargetA, calibration.landmarkSourceB, calibration.landmarkTargetB)
|
|
23066
|
+
: IDENTITY_TRANSFORM;
|
|
23067
|
+
return this.runCopy(targetSpaceId, transform, async () => {
|
|
23068
|
+
// First log line of an import: where its content comes from, so the downloaded log
|
|
23069
|
+
// keeps the trace of it.
|
|
23070
|
+
this.appendInfoLog(this.translate.instant('matterportCopy.importOrigin', this.describeOrigin(origin)));
|
|
23071
|
+
// set here, after runCopy() reset the run state
|
|
23072
|
+
this.replacementModels = new Map(Object.entries(replacementModels || {}));
|
|
23073
|
+
return this.snapshotFromArchive(archive);
|
|
23074
|
+
}, archive, calibration.mode === 'SAME_MODEL');
|
|
23075
|
+
}
|
|
23076
|
+
/**
|
|
23077
|
+
* Body shared by a copy and an import: reads the source through `collect`, then creates
|
|
23078
|
+
* the records in the target space.
|
|
23079
|
+
*/
|
|
23080
|
+
async runCopy(targetSpaceId, transform, collect, archive = null, keepSweepIds = false) {
|
|
22489
23081
|
let errorCount = 0;
|
|
22490
23082
|
let healedCount = 0;
|
|
22491
23083
|
// items skipped because an equivalent already exists in the target (earlier run)
|
|
22492
23084
|
let alreadyPresentCount = 0;
|
|
22493
23085
|
this.resetLog();
|
|
22494
23086
|
this.resetRunState(targetSpaceId);
|
|
23087
|
+
this.archive = archive;
|
|
23088
|
+
this.keepSweepIds = keepSweepIds;
|
|
22495
23089
|
try {
|
|
22496
|
-
console.log(`Copying Tags from source ${sourceSpaceId} to target ${targetSpaceId}`);
|
|
22497
23090
|
this.setStepProgress('collecting', 'collecting', 0);
|
|
22498
23091
|
this.copyProgress$.next({
|
|
22499
23092
|
phase: 'collecting',
|
|
@@ -22503,67 +23096,36 @@ class MatterportTagCopyService {
|
|
|
22503
23096
|
});
|
|
22504
23097
|
const targetMission = this.userService.currentMission(targetSpaceId);
|
|
22505
23098
|
const targetMissionId = targetMission ? targetMission.id : null;
|
|
22506
|
-
const
|
|
22507
|
-
console.log('Rigid transform computed:', {
|
|
22508
|
-
rotationYDeg: transform.rotationYRad * (180 / Math.PI),
|
|
22509
|
-
refSource: transform.refSource,
|
|
22510
|
-
refTarget: transform.refTarget
|
|
22511
|
-
});
|
|
22512
|
-
const sourceSweepIds = await this.navigationService.getAllowedSweepsIDsForUserInSpace(sourceSpaceId);
|
|
23099
|
+
const snapshot = await collect();
|
|
22513
23100
|
const targetSweepIds = await this.navigationService.getAllowedSweepsIDsForUserInSpace(targetSpaceId);
|
|
22514
|
-
|
|
22515
|
-
const
|
|
22516
|
-
|
|
22517
|
-
this.buildNavigationPositionMap(targetSpaceId, targetSweepIds)
|
|
22518
|
-
]);
|
|
23101
|
+
const sourceNavPositions = snapshot.sweepPositions;
|
|
23102
|
+
const targetNavPositions = await this.buildNavigationPositionMap(targetSpaceId, targetSweepIds);
|
|
23103
|
+
this.setStepProgress('collecting', 'collecting', 70);
|
|
22519
23104
|
const elementIds = this.elementIds;
|
|
22520
|
-
|
|
22521
|
-
|
|
23105
|
+
const sourceTickets = snapshot.tickets;
|
|
23106
|
+
const sourceEquipments = snapshot.equipments;
|
|
23107
|
+
const sourceObjects3D = snapshot.objects3D;
|
|
23108
|
+
const sourceFeatures = snapshot.features;
|
|
23109
|
+
const sourceMeasurements = snapshot.measurements;
|
|
22522
23110
|
let targetTickets = [];
|
|
22523
23111
|
let targetEquipments = [];
|
|
22524
|
-
let sourceMeasurements = [];
|
|
22525
23112
|
let targetMeasurements = [];
|
|
22526
23113
|
if (this.spModule == SpModule.IMMO) {
|
|
22527
|
-
sourceTickets = await this.ticketService.getTicketsBySpace(sourceSpaceId);
|
|
22528
|
-
sourceEquipments = await this.equipmentService.getEquipmentsForSpace(sourceSpaceId);
|
|
22529
23114
|
targetTickets = await this.ticketService.getTicketsBySpace(targetSpaceId);
|
|
22530
23115
|
targetEquipments = await this.equipmentService.getEquipmentsForSpace(targetSpaceId);
|
|
23116
|
+
targetMeasurements = (await this.measurementService.getMeasurementsForSpaceForUser(targetSpaceId));
|
|
22531
23117
|
}
|
|
22532
|
-
this.setStepProgress('collecting', 'collecting', 55);
|
|
22533
|
-
const sourceObjects3D = await this.object3DService.getObjects3DBySpace(sourceSpaceId);
|
|
22534
23118
|
const targetObjects3D = await this.object3DService.getObjects3DBySpace(targetSpaceId);
|
|
22535
|
-
//
|
|
22536
|
-
//
|
|
22537
|
-
//
|
|
22538
|
-
// The source list keeps the historical "skip what the operator archived" rule, so
|
|
22539
|
-
// the set of copied features does not change — but the check is now null-safe:
|
|
22540
|
-
// FeatureService.isArchived() dereferences currentMission(spaceID).id and threw a
|
|
22541
|
-
// TypeError when the operator had no mission on the source space (the common case
|
|
22542
|
-
// for an archived v1 space), aborting the whole copy.
|
|
22543
|
-
// The target list is NOT filtered: it only feeds duplicate detection, and an
|
|
22544
|
-
// archived feature is still a feature that exists there.
|
|
22545
|
-
const sourceFeatures = (await this.featureService.getAllFeaturesBySpaceRaw(sourceSpaceId))
|
|
22546
|
-
.filter(feature => !this.isArchivedForOperator(feature, sourceSpaceId));
|
|
23119
|
+
// The target list is NOT filtered (unlike the source, see collectLiveSnapshot()): it
|
|
23120
|
+
// only feeds duplicate detection, and an archived feature is still a feature that
|
|
23121
|
+
// exists there.
|
|
22547
23122
|
const targetFeatures = await this.featureService.getAllFeaturesBySpaceRaw(targetSpaceId);
|
|
22548
|
-
this.setStepProgress('collecting', 'collecting',
|
|
22549
|
-
// Keywords
|
|
22550
|
-
//
|
|
22551
|
-
await this.
|
|
22552
|
-
// Missions: index both spaces now (read-only), so copied comments can credit
|
|
22553
|
-
// their real author instead of whoever is running the copy.
|
|
22554
|
-
await this.loadMissionIndex(sourceSpaceId, targetSpaceId);
|
|
22555
|
-
// Domains: index every domain either operator's mission can see (read-only), so
|
|
22556
|
-
// a category survives a copy across two DIFFERENT organisations whenever it
|
|
22557
|
-
// genuinely would be selectable in the target space's own dropdown — see
|
|
22558
|
-
// loadDomainIndex() for why this is keyed to Mission, not to the Space itself.
|
|
22559
|
-
await this.loadDomainIndex(sourceSpaceId, targetSpaceId);
|
|
22560
|
-
if (this.spModule == SpModule.IMMO) {
|
|
22561
|
-
sourceMeasurements = (await this.measurementService.getMeasurementsForSpaceForUser(sourceSpaceId))
|
|
22562
|
-
.filter(m => (m.numberPoints ?? 0) > 0);
|
|
22563
|
-
targetMeasurements = (await this.measurementService.getMeasurementsForSpaceForUser(targetSpaceId));
|
|
22564
|
-
}
|
|
23123
|
+
this.setStepProgress('collecting', 'collecting', 80);
|
|
23124
|
+
// Keywords, comment authors and categories: index what the source references and
|
|
23125
|
+
// what the target already has (read-only — nothing is created at this stage).
|
|
23126
|
+
await this.loadReferenceIndexes(snapshot, targetSpaceId, targetMissionId);
|
|
22565
23127
|
this.setStepProgress('collecting', 'collecting', 90);
|
|
22566
|
-
const sourcePoisAll =
|
|
23128
|
+
const sourcePoisAll = snapshot.pois;
|
|
22567
23129
|
const targetPoisAll = await this.poiService.getPoisByMatterportSweeps(targetSweepIds);
|
|
22568
23130
|
// A POI is "owned" by an element (ticket, equipment, 3D object, feature, measurement)
|
|
22569
23131
|
// when its elementID points at one. Those POIs are created by their element's phase,
|
|
@@ -22639,7 +23201,8 @@ class MatterportTagCopyService {
|
|
|
22639
23201
|
level: rawSource.level,
|
|
22640
23202
|
metadata: rawSource.metadata || null,
|
|
22641
23203
|
read: rawSource.read || null,
|
|
22642
|
-
|
|
23204
|
+
// A project of another environment designates nothing here.
|
|
23205
|
+
projectID: this.archive ? null : (rawSource.projectID || null),
|
|
22643
23206
|
problemCode: rawSource.problemCode || null,
|
|
22644
23207
|
// Missions are per-space: a source mission id designates nobody in
|
|
22645
23208
|
// the target space. Carrying the list over would look like real data
|
|
@@ -22650,7 +23213,7 @@ class MatterportTagCopyService {
|
|
|
22650
23213
|
parentID: null,
|
|
22651
23214
|
// Reused unchanged in the same organisation, matched by name
|
|
22652
23215
|
// across two — see resolveDomainID().
|
|
22653
|
-
domainID: this.resolveDomainID(rawSource.domainID),
|
|
23216
|
+
domainID: await this.resolveDomainID(rawSource.domainID),
|
|
22654
23217
|
ownerMissionID: targetMissionId
|
|
22655
23218
|
};
|
|
22656
23219
|
const createdObj = await this.ticketService.createTicket(ticketInput);
|
|
@@ -22661,14 +23224,7 @@ class MatterportTagCopyService {
|
|
|
22661
23224
|
// They were never copied at all: a duplicated ticket arrived stripped
|
|
22662
23225
|
// of every piece of evidence attached to it.
|
|
22663
23226
|
if (createdObj) {
|
|
22664
|
-
|
|
22665
|
-
try {
|
|
22666
|
-
sourceComments = await this.commentService.getAllCommentsForTicket(sourceObj.id);
|
|
22667
|
-
}
|
|
22668
|
-
catch (commentsFetchError) {
|
|
22669
|
-
console.warn(`Falling back to the embedded comment list for ticket "${rawSource.title}":`, commentsFetchError);
|
|
22670
|
-
sourceComments = (sourceObj.comments?.items || []).filter(c => !!c);
|
|
22671
|
-
}
|
|
23227
|
+
const sourceComments = await snapshot.getTicketComments(sourceObj);
|
|
22672
23228
|
for (const sourceComment of this.orderCommentsForCopy(sourceComments)) {
|
|
22673
23229
|
try {
|
|
22674
23230
|
const created = await this.copyCommentForTicket(sourceComment, createdObj.id, targetSpaceId);
|
|
@@ -22781,7 +23337,7 @@ class MatterportTagCopyService {
|
|
|
22781
23337
|
spaceID: targetSpaceId,
|
|
22782
23338
|
// Reused unchanged in the same organisation, matched by name
|
|
22783
23339
|
// across two — see resolveDomainID().
|
|
22784
|
-
domainID: this.resolveDomainID(rawSource.domainID),
|
|
23340
|
+
domainID: await this.resolveDomainID(rawSource.domainID),
|
|
22785
23341
|
photo: copiedPhotoKey,
|
|
22786
23342
|
// `subequipmentsIDs` is deliberately absent: it is remapped to the
|
|
22787
23343
|
// copied equipments in the second pass, once they all exist.
|
|
@@ -22895,7 +23451,7 @@ class MatterportTagCopyService {
|
|
|
22895
23451
|
continue;
|
|
22896
23452
|
}
|
|
22897
23453
|
try {
|
|
22898
|
-
const sourceOps = await
|
|
23454
|
+
const sourceOps = await snapshot.getTicketOperations(sourceTicket.id);
|
|
22899
23455
|
if (sourceOps.length === 0) {
|
|
22900
23456
|
continue;
|
|
22901
23457
|
}
|
|
@@ -22942,8 +23498,31 @@ class MatterportTagCopyService {
|
|
|
22942
23498
|
// Copying unconditionally meant every library object failed with NoSuchKey and
|
|
22943
23499
|
// the whole 3D object was skipped, model AND POI.
|
|
22944
23500
|
let copiedPath = rawSource.path;
|
|
22945
|
-
|
|
22946
|
-
|
|
23501
|
+
let s3Bucket = !!rawSource.s3Bucket;
|
|
23502
|
+
const replacementModel = this.replacementModelOf(rawSource);
|
|
23503
|
+
if (!this.object3DModelUploadEnabled) {
|
|
23504
|
+
// This application writes no model file: the model is referenced as is.
|
|
23505
|
+
copiedPath = await this.modelPathWithoutUpload(rawSource);
|
|
23506
|
+
}
|
|
23507
|
+
else if (replacementModel) {
|
|
23508
|
+
// Import: a model missing from both the archive and this application,
|
|
23509
|
+
// replaced by a .glb the operator chose (see getMissingObject3DModels()).
|
|
23510
|
+
copiedPath = await this.uploadReplacementModel(replacementModel, targetSpaceId);
|
|
23511
|
+
s3Bucket = true;
|
|
23512
|
+
}
|
|
23513
|
+
else if (rawSource.path && rawSource.s3Bucket) {
|
|
23514
|
+
// Stored like an uploaded model: target space folder, timestamped name,
|
|
23515
|
+
// so the copy never overwrites a model another object may use.
|
|
23516
|
+
copiedPath = await this.copyS3KeyIfPresent(rawSource.path, `3D object "${rawSource.name}"`, null, sourceKey => buildObject3DModelKey(targetSpaceId, sourceKey));
|
|
23517
|
+
}
|
|
23518
|
+
else if (this.archive) {
|
|
23519
|
+
// Import: a library model the target application does not ship is
|
|
23520
|
+
// uploaded to S3 from the archive, so the object keeps its model.
|
|
23521
|
+
const uploadedKey = await this.restoreMissingLibraryModel(rawSource, targetSpaceId);
|
|
23522
|
+
if (uploadedKey) {
|
|
23523
|
+
copiedPath = uploadedKey;
|
|
23524
|
+
s3Bucket = true;
|
|
23525
|
+
}
|
|
22947
23526
|
}
|
|
22948
23527
|
/**
|
|
22949
23528
|
* Strict parser to ensure [float, float, float] format for GraphQL.
|
|
@@ -22986,12 +23565,15 @@ class MatterportTagCopyService {
|
|
|
22986
23565
|
// Tells the viewer how to interpret `path`. Dropping it turned an
|
|
22987
23566
|
// S3-hosted model into a library reference on the copy, which the
|
|
22988
23567
|
// viewer then tried to resolve against assets/ and failed to load.
|
|
22989
|
-
s3Bucket
|
|
23568
|
+
s3Bucket,
|
|
22990
23569
|
name: rawSource.name,
|
|
22991
23570
|
description: rawSource.description || "",
|
|
22992
23571
|
spaceID: targetSpaceId,
|
|
22993
|
-
|
|
22994
|
-
|
|
23572
|
+
// Where the object stands in the scene lives on the object itself (its
|
|
23573
|
+
// POI has no coordinate): it is moved with the landmarks like any tag.
|
|
23574
|
+
// Copying it unchanged left the object at the SOURCE model's coordinates,
|
|
23575
|
+
// out of place — often out of sight — in the target visit.
|
|
23576
|
+
...this.getAdjustedObject3DPlacement(toFloatArray(rawSource.position, [0, 0, 0]), toFloatArray(rawSource.rotation, [0, 0, 0]), transform)
|
|
22995
23577
|
};
|
|
22996
23578
|
if ('viewFrustum' in rawSource) {
|
|
22997
23579
|
object3DInput.viewFrustum = !!rawSource.viewFrustum;
|
|
@@ -23031,9 +23613,14 @@ class MatterportTagCopyService {
|
|
|
23031
23613
|
this.setStepProgress('objects3d', 'objects3d', 100);
|
|
23032
23614
|
break;
|
|
23033
23615
|
}
|
|
23034
|
-
console.error(`Error copying object3D "${sourceObj?.name}":`, itemError);
|
|
23035
23616
|
errorCount++;
|
|
23036
|
-
|
|
23617
|
+
if (itemError instanceof Object3DModelUploadDisabledError) {
|
|
23618
|
+
this.logItemError('errorObject3dUploadDisabled', { name: itemError.objectName });
|
|
23619
|
+
}
|
|
23620
|
+
else {
|
|
23621
|
+
console.error(`Error copying object3D "${sourceObj?.name}":`, itemError);
|
|
23622
|
+
this.logCopyItemError(itemError, 'errorObject3d', sourceObj?.name || sourceObj?.id);
|
|
23623
|
+
}
|
|
23037
23624
|
}
|
|
23038
23625
|
processedOverall++;
|
|
23039
23626
|
emitProgress('objects3d', i + 1, sourceObjects3D.length);
|
|
@@ -23079,7 +23666,7 @@ class MatterportTagCopyService {
|
|
|
23079
23666
|
description: rawSource.description || null,
|
|
23080
23667
|
// Reused unchanged in the same organisation, matched by name
|
|
23081
23668
|
// across two — see resolveDomainID().
|
|
23082
|
-
domainID: this.resolveDomainID(rawSource.domainID),
|
|
23669
|
+
domainID: await this.resolveDomainID(rawSource.domainID),
|
|
23083
23670
|
spaceID: targetSpaceId,
|
|
23084
23671
|
ownerMissionID: targetMissionId
|
|
23085
23672
|
};
|
|
@@ -23091,17 +23678,8 @@ class MatterportTagCopyService {
|
|
|
23091
23678
|
this.markHashtagsUsed(resolvedHashtags);
|
|
23092
23679
|
}
|
|
23093
23680
|
if (createdObj) {
|
|
23094
|
-
// Read
|
|
23095
|
-
|
|
23096
|
-
// nextToken was never followed, so rich POIs lost attachments silently.
|
|
23097
|
-
let sourceComments = [];
|
|
23098
|
-
try {
|
|
23099
|
-
sourceComments = await this.commentService.getAllCommentsForFeature(sourceObj.id);
|
|
23100
|
-
}
|
|
23101
|
-
catch (commentsFetchError) {
|
|
23102
|
-
console.warn(`Falling back to the embedded comment list for feature "${rawSource.title}":`, commentsFetchError);
|
|
23103
|
-
sourceComments = (sourceObj.comments?.items || []).filter(c => !!c);
|
|
23104
|
-
}
|
|
23681
|
+
// Read through its own paginated query, see collectLiveSnapshot().
|
|
23682
|
+
const sourceComments = await snapshot.getFeatureComments(sourceObj);
|
|
23105
23683
|
for (const sourceComment of this.orderCommentsForCopy(sourceComments)) {
|
|
23106
23684
|
try {
|
|
23107
23685
|
const created = await this.copyCommentForFeature(sourceComment, createdObj.id, targetSpaceId);
|
|
@@ -23227,8 +23805,10 @@ class MatterportTagCopyService {
|
|
|
23227
23805
|
alreadyPresentCount++;
|
|
23228
23806
|
}
|
|
23229
23807
|
if (!existsInTarget) {
|
|
23808
|
+
// An element that was not copied is kept as is by a copy (same
|
|
23809
|
+
// environment), but means nothing once imported on another one.
|
|
23230
23810
|
const elementID = sourcePoi.elementID
|
|
23231
|
-
? (elementIds[sourcePoi.elementID] || sourcePoi.elementID)
|
|
23811
|
+
? (elementIds[sourcePoi.elementID] || (this.archive ? null : sourcePoi.elementID))
|
|
23232
23812
|
: sourcePoi.elementID;
|
|
23233
23813
|
await this.createCopiedPoi(sourcePoi, elementID, sourceNavPositions, targetNavPositions, transform);
|
|
23234
23814
|
}
|
|
@@ -23290,6 +23870,663 @@ class MatterportTagCopyService {
|
|
|
23290
23870
|
const defaultName = `matterport-copy-log-${new Date().toISOString().replace(/[:.]/g, '-')}.txt`;
|
|
23291
23871
|
downloadBlob(new Blob([text], { type: 'text/plain;charset=utf-8' }), filename || defaultName);
|
|
23292
23872
|
}
|
|
23873
|
+
/**
|
|
23874
|
+
* Exports every tag of a location — and everything the tags point at: tickets, equipments
|
|
23875
|
+
* with their notes and links, 3D objects, POIs with their media, measurements, keywords,
|
|
23876
|
+
* categories — into a ZIP archive downloaded by the browser, together with the S3 files
|
|
23877
|
+
* they reference. The archive can then be imported in any location of any environment
|
|
23878
|
+
* (see importTagsFromArchive()): it records where it comes from (see TagArchiveOrigin).
|
|
23879
|
+
*
|
|
23880
|
+
* The location is read exactly as a copy reads its source (collectLiveSnapshot()), so an
|
|
23881
|
+
* export carries what a copy would. A file that cannot be downloaded is reported in the
|
|
23882
|
+
* log and left out; the import then treats it like a copy treats a missing file.
|
|
23883
|
+
*
|
|
23884
|
+
* Progress and log go through copyProgress$ / copyLog$ (phases 'collecting', 'files').
|
|
23885
|
+
*/
|
|
23886
|
+
async exportTagsToArchive(spaceId, spaceName, visits = []) {
|
|
23887
|
+
let errorCount = 0;
|
|
23888
|
+
this.resetLog();
|
|
23889
|
+
this.resetRunState(null);
|
|
23890
|
+
const emitProgress = (phase, processed, total) => {
|
|
23891
|
+
this.copyProgress$.next({
|
|
23892
|
+
phase,
|
|
23893
|
+
processedInPhase: processed, totalInPhase: total,
|
|
23894
|
+
processedOverall: processed, totalOverall: total,
|
|
23895
|
+
percent: total > 0 ? Math.round((processed / total) * 100) : 100,
|
|
23896
|
+
errorCount, healedCount: 0
|
|
23897
|
+
});
|
|
23898
|
+
};
|
|
23899
|
+
try {
|
|
23900
|
+
console.log(`Exporting Tags of space ${spaceId}`);
|
|
23901
|
+
emitProgress('collecting', 0, 0);
|
|
23902
|
+
this.setStepProgress('collecting', 'collecting', 0);
|
|
23903
|
+
const snapshot = await this.collectLiveSnapshot(spaceId);
|
|
23904
|
+
// What a copy reads item by item is read up front here: it all goes in the archive.
|
|
23905
|
+
const ticketComments = {};
|
|
23906
|
+
const featureComments = {};
|
|
23907
|
+
const operations = [];
|
|
23908
|
+
await this.forEachInBatches(snapshot.tickets, async (ticket) => {
|
|
23909
|
+
ticketComments[ticket.id] = await snapshot.getTicketComments(ticket);
|
|
23910
|
+
try {
|
|
23911
|
+
const ticketOps = await snapshot.getTicketOperations(ticket.id);
|
|
23912
|
+
ticketOps
|
|
23913
|
+
.filter(op => !!op?.equipmentID)
|
|
23914
|
+
.forEach(op => operations.push({ ticketID: ticket.id, equipmentID: op.equipmentID }));
|
|
23915
|
+
}
|
|
23916
|
+
catch (opError) {
|
|
23917
|
+
console.error(`Error reading the ticket-equipment links of "${ticket?.title}":`, opError);
|
|
23918
|
+
errorCount++;
|
|
23919
|
+
this.logCopyItemError(opError, 'errorOperation', ticket?.title || ticket?.id);
|
|
23920
|
+
}
|
|
23921
|
+
});
|
|
23922
|
+
await this.forEachInBatches(snapshot.features, async (feature) => {
|
|
23923
|
+
featureComments[feature.id] = await snapshot.getFeatureComments(feature);
|
|
23924
|
+
});
|
|
23925
|
+
this.setStepProgress('collecting', 'collecting', 85);
|
|
23926
|
+
const allComments = [...Object.values(ticketComments), ...Object.values(featureComments)].flat();
|
|
23927
|
+
const domains = await this.collectExportDomains(spaceId, [
|
|
23928
|
+
...snapshot.tickets, ...snapshot.equipments, ...snapshot.features, ...this.allSnapshotPois(snapshot)
|
|
23929
|
+
]);
|
|
23930
|
+
this.setStepProgress('collecting', 'collecting', 100);
|
|
23931
|
+
// FILES — downloaded from S3, so that they can be re-uploaded on another environment.
|
|
23932
|
+
const fileKeys = this.collectArchiveFileKeys(snapshot, allComments);
|
|
23933
|
+
// Library models (.glb) used by the 3D objects: the application of the other
|
|
23934
|
+
// environment may not ship them (a model added by hand to the assets of this one).
|
|
23935
|
+
const libraryFiles = this.collectLibraryModelFiles(snapshot);
|
|
23936
|
+
const files = {};
|
|
23937
|
+
const fileIndex = {};
|
|
23938
|
+
let processedFiles = 0;
|
|
23939
|
+
emitProgress('files', 0, fileKeys.length);
|
|
23940
|
+
await this.forEachInBatches(fileKeys, async (key, index) => {
|
|
23941
|
+
try {
|
|
23942
|
+
const downloaded = await downloadS3Object(key);
|
|
23943
|
+
const bytes = new Uint8Array(await downloaded.body.arrayBuffer());
|
|
23944
|
+
const path = tagArchiveFilePath(index + 1, key);
|
|
23945
|
+
files[path] = bytes;
|
|
23946
|
+
fileIndex[key] = { path, contentType: downloaded.contentType, size: bytes.length };
|
|
23947
|
+
}
|
|
23948
|
+
catch (fileError) {
|
|
23949
|
+
console.warn(`[MatterportTagCopyService] Could not export the file "${key}":`, fileError);
|
|
23950
|
+
errorCount++;
|
|
23951
|
+
fileIndex[key] = { path: null, missing: true };
|
|
23952
|
+
this.logItemError(this.isMissingS3File(fileError) ? 'exportFileMissing' : 'exportFileError', { file: key, error: toErrorMessage(fileError) });
|
|
23953
|
+
}
|
|
23954
|
+
finally {
|
|
23955
|
+
processedFiles++;
|
|
23956
|
+
emitProgress('files', processedFiles, fileKeys.length);
|
|
23957
|
+
this.setStepProgress('files', 'files', fileKeys.length > 0 ? Math.round((processedFiles / fileKeys.length) * 100) : 100);
|
|
23958
|
+
}
|
|
23959
|
+
});
|
|
23960
|
+
for (const [index, libraryFile] of libraryFiles.entries()) {
|
|
23961
|
+
const archiveKey = OBJECT3D_LIBRARY_ASSET_FOLDER + libraryFile;
|
|
23962
|
+
try {
|
|
23963
|
+
const bytes = await this.fetchLibraryModel(libraryFile);
|
|
23964
|
+
if (!bytes) {
|
|
23965
|
+
throw new Error('not served by the application');
|
|
23966
|
+
}
|
|
23967
|
+
const path = tagArchiveFilePath(fileKeys.length + index + 1, libraryFile);
|
|
23968
|
+
files[path] = bytes;
|
|
23969
|
+
fileIndex[archiveKey] = { path, contentType: GLB_CONTENT_TYPE, size: bytes.length };
|
|
23970
|
+
}
|
|
23971
|
+
catch (fileError) {
|
|
23972
|
+
console.warn(`[MatterportTagCopyService] Could not export the library model "${libraryFile}":`, fileError);
|
|
23973
|
+
errorCount++;
|
|
23974
|
+
fileIndex[archiveKey] = { path: null, missing: true };
|
|
23975
|
+
this.logItemError('exportFileError', { file: archiveKey, error: toErrorMessage(fileError) });
|
|
23976
|
+
}
|
|
23977
|
+
}
|
|
23978
|
+
const origin = this.buildExportOrigin(spaceId, spaceName);
|
|
23979
|
+
const manifest = {
|
|
23980
|
+
format: TAG_ARCHIVE_FORMAT,
|
|
23981
|
+
version: TAG_ARCHIVE_VERSION,
|
|
23982
|
+
origin,
|
|
23983
|
+
visits: (visits || []).filter(visit => !!visit?.model3d),
|
|
23984
|
+
counts: {
|
|
23985
|
+
tickets: snapshot.tickets.length,
|
|
23986
|
+
equipments: snapshot.equipments.length,
|
|
23987
|
+
objects3D: snapshot.objects3D.length,
|
|
23988
|
+
features: snapshot.features.length,
|
|
23989
|
+
measurements: snapshot.measurements.length,
|
|
23990
|
+
pois: snapshot.pois.length,
|
|
23991
|
+
files: Object.keys(files).length
|
|
23992
|
+
},
|
|
23993
|
+
data: {
|
|
23994
|
+
tickets: snapshot.tickets,
|
|
23995
|
+
ticketComments,
|
|
23996
|
+
operations,
|
|
23997
|
+
equipments: snapshot.equipments,
|
|
23998
|
+
objects3D: snapshot.objects3D,
|
|
23999
|
+
features: snapshot.features,
|
|
24000
|
+
featureComments,
|
|
24001
|
+
measurements: snapshot.measurements,
|
|
24002
|
+
pois: snapshot.pois,
|
|
24003
|
+
sweepPositions: Object.fromEntries(snapshot.sweepPositions),
|
|
24004
|
+
hashtags: Object.fromEntries(snapshot.hashtagNames),
|
|
24005
|
+
domains
|
|
24006
|
+
},
|
|
24007
|
+
files: fileIndex
|
|
24008
|
+
};
|
|
24009
|
+
const zip = buildTagArchive(manifest, files);
|
|
24010
|
+
const date = origin.exportedAt.substring(0, 10);
|
|
24011
|
+
downloadBlob(new Blob([zip], { type: 'application/zip' }), `tags_${this.toFileName(spaceName || spaceId)}_${date}.zip`);
|
|
24012
|
+
emitProgress('done', 1, 1);
|
|
24013
|
+
this.appendInfoLog(this.translate.instant('matterportCopy.exportOrigin', this.describeOrigin(origin)));
|
|
24014
|
+
this.setStepLog('done', errorCount > 0
|
|
24015
|
+
? this.translate.instant('matterportCopy.exportDoneWithErrors', { count: errorCount })
|
|
24016
|
+
: this.translate.instant('matterportCopy.exportDone'));
|
|
24017
|
+
return true;
|
|
24018
|
+
}
|
|
24019
|
+
catch (error) {
|
|
24020
|
+
console.error('Error exporting the tags:', error);
|
|
24021
|
+
this.appendErrorLog(this.translate.instant('matterportCopy.errorGeneral', { error: toErrorMessage(error) }));
|
|
24022
|
+
this.copyProgress$.next(null);
|
|
24023
|
+
return false;
|
|
24024
|
+
}
|
|
24025
|
+
}
|
|
24026
|
+
/**
|
|
24027
|
+
* Reads an archive chosen by the user (see exportTagsToArchive()). Throws a TagArchiveError
|
|
24028
|
+
* when it is not a tag archive, was made by a newer version, or by the application of
|
|
24029
|
+
* another module (MUSEUM vs IMMO): their models differ (Object3D, tickets...), the records
|
|
24030
|
+
* could not be created here.
|
|
24031
|
+
*/
|
|
24032
|
+
async readTagArchive(file) {
|
|
24033
|
+
const archive = readTagArchive(new Uint8Array(await file.arrayBuffer()));
|
|
24034
|
+
if (archive.manifest.origin.module !== this.spModule) {
|
|
24035
|
+
throw new TagArchiveError('errorArchiveModule', { module: archive.manifest.origin.module });
|
|
24036
|
+
}
|
|
24037
|
+
return archive;
|
|
24038
|
+
}
|
|
24039
|
+
/** Placeholders of the matterportCopy.importOrigin / exportOrigin translations. */
|
|
24040
|
+
describeOrigin(origin) {
|
|
24041
|
+
return {
|
|
24042
|
+
environment: origin.environment || '?',
|
|
24043
|
+
space: origin.spaceName || origin.spaceId,
|
|
24044
|
+
date: origin.exportedAt ? new Date(origin.exportedAt).toLocaleString() : '?',
|
|
24045
|
+
user: origin.exportedBy?.name || origin.exportedBy?.userID || '?'
|
|
24046
|
+
};
|
|
24047
|
+
}
|
|
24048
|
+
//
|
|
24049
|
+
// ---------- Source of the tags: live location or archive ----------
|
|
24050
|
+
//
|
|
24051
|
+
/**
|
|
24052
|
+
* Reads a location of the current environment as the source of a copy or an export.
|
|
24053
|
+
*
|
|
24054
|
+
* Features archived by the operator are skipped (historical rule) — null-safe:
|
|
24055
|
+
* FeatureService.isArchived() dereferences currentMission(spaceID).id and threw a
|
|
24056
|
+
* TypeError when the operator had no mission on the source space (the common case for an
|
|
24057
|
+
* archived v1 space), aborting the whole copy. Features are paginated: a space routinely
|
|
24058
|
+
* holds more than the 100 features a single AppSync page returns, and the tail was
|
|
24059
|
+
* silently dropped.
|
|
24060
|
+
*
|
|
24061
|
+
* The attachments of tickets and features are read on demand, through their own
|
|
24062
|
+
* paginated query: the `comments` connection embedded in TicketsBySpace / FeaturesBySpace
|
|
24063
|
+
* is capped at 100 items and its nextToken was never followed, so rich POIs lost
|
|
24064
|
+
* attachments silently. The embedded list is only the fallback when that query fails.
|
|
24065
|
+
*/
|
|
24066
|
+
async collectLiveSnapshot(spaceId) {
|
|
24067
|
+
const sweepIds = await this.navigationService.getAllowedSweepsIDsForUserInSpace(spaceId);
|
|
24068
|
+
const sweepPositions = await this.buildNavigationPositionMap(spaceId, sweepIds);
|
|
24069
|
+
this.setStepProgress('collecting', 'collecting', 20);
|
|
24070
|
+
let tickets = [];
|
|
24071
|
+
let equipments = [];
|
|
24072
|
+
let measurements = [];
|
|
24073
|
+
if (this.spModule == SpModule.IMMO) {
|
|
24074
|
+
tickets = await this.ticketService.getTicketsBySpace(spaceId);
|
|
24075
|
+
equipments = await this.equipmentService.getEquipmentsForSpace(spaceId);
|
|
24076
|
+
}
|
|
24077
|
+
this.setStepProgress('collecting', 'collecting', 35);
|
|
24078
|
+
const objects3D = await this.object3DService.getObjects3DBySpace(spaceId);
|
|
24079
|
+
const features = (await this.featureService.getAllFeaturesBySpaceRaw(spaceId))
|
|
24080
|
+
.filter(feature => !this.isArchivedForOperator(feature, spaceId));
|
|
24081
|
+
if (this.spModule == SpModule.IMMO) {
|
|
24082
|
+
measurements = (await this.measurementService.getMeasurementsForSpaceForUser(spaceId))
|
|
24083
|
+
.filter(m => (m.numberPoints ?? 0) > 0);
|
|
24084
|
+
}
|
|
24085
|
+
this.setStepProgress('collecting', 'collecting', 50);
|
|
24086
|
+
const pois = await this.poiService.getPoisByMatterportSweeps(sweepIds);
|
|
24087
|
+
const hashtagNames = await this.loadHashtagNames(spaceId);
|
|
24088
|
+
const missionUserIds = await this.loadMissionUserIds(spaceId);
|
|
24089
|
+
this.setStepProgress('collecting', 'collecting', 60);
|
|
24090
|
+
return {
|
|
24091
|
+
kind: 'live',
|
|
24092
|
+
spaceId,
|
|
24093
|
+
sweepPositions,
|
|
24094
|
+
tickets: (tickets || []).filter(t => !!t),
|
|
24095
|
+
equipments: (equipments || []).filter(e => !!e),
|
|
24096
|
+
objects3D: (objects3D || []).filter(o => !!o),
|
|
24097
|
+
features: (features || []).filter(f => !!f),
|
|
24098
|
+
measurements: (measurements || []).filter(m => !!m),
|
|
24099
|
+
pois: (pois || []).filter(p => !!p),
|
|
24100
|
+
hashtagNames,
|
|
24101
|
+
missionUserIds,
|
|
24102
|
+
domains: [],
|
|
24103
|
+
getTicketComments: async (ticket) => {
|
|
24104
|
+
try {
|
|
24105
|
+
return await this.commentService.getAllCommentsForTicket(ticket.id);
|
|
24106
|
+
}
|
|
24107
|
+
catch (commentsFetchError) {
|
|
24108
|
+
console.warn(`Falling back to the embedded comment list for ticket "${ticket?.title}":`, commentsFetchError);
|
|
24109
|
+
return (ticket.comments?.items || []).filter(c => !!c);
|
|
24110
|
+
}
|
|
24111
|
+
},
|
|
24112
|
+
getFeatureComments: async (feature) => {
|
|
24113
|
+
try {
|
|
24114
|
+
return await this.commentService.getAllCommentsForFeature(feature.id);
|
|
24115
|
+
}
|
|
24116
|
+
catch (commentsFetchError) {
|
|
24117
|
+
console.warn(`Falling back to the embedded comment list for feature "${feature?.title}":`, commentsFetchError);
|
|
24118
|
+
return (feature.comments?.items || []).filter(c => !!c);
|
|
24119
|
+
}
|
|
24120
|
+
},
|
|
24121
|
+
getTicketOperations: (ticketId) => this.operationService.getOperationsByTicketID(ticketId)
|
|
24122
|
+
};
|
|
24123
|
+
}
|
|
24124
|
+
/** Source of an import: the records of the archive, as the exporting environment read them. */
|
|
24125
|
+
snapshotFromArchive(archive) {
|
|
24126
|
+
const data = archive.manifest.data;
|
|
24127
|
+
const list = (items) => (items || []).filter(item => !!item);
|
|
24128
|
+
return {
|
|
24129
|
+
kind: 'archive',
|
|
24130
|
+
spaceId: archive.manifest.origin.spaceId,
|
|
24131
|
+
sweepPositions: new Map(Object.entries(data.sweepPositions || {})),
|
|
24132
|
+
tickets: list(data.tickets),
|
|
24133
|
+
equipments: list(data.equipments),
|
|
24134
|
+
objects3D: list(data.objects3D),
|
|
24135
|
+
features: list(data.features),
|
|
24136
|
+
measurements: list(data.measurements),
|
|
24137
|
+
pois: list(data.pois),
|
|
24138
|
+
hashtagNames: new Map(Object.entries(data.hashtags || {})),
|
|
24139
|
+
missionUserIds: new Map(),
|
|
24140
|
+
domains: list(data.domains),
|
|
24141
|
+
getTicketComments: async (ticket) => list(data.ticketComments?.[ticket.id]),
|
|
24142
|
+
getFeatureComments: async (feature) => list(data.featureComments?.[feature.id]),
|
|
24143
|
+
getTicketOperations: async (ticketId) => list(data.operations).filter(op => op.ticketID === ticketId)
|
|
24144
|
+
};
|
|
24145
|
+
}
|
|
24146
|
+
/**
|
|
24147
|
+
* READ-ONLY indexing of what the source references and the target already has: keywords,
|
|
24148
|
+
* comment authors and categories.
|
|
24149
|
+
* - copy: authors are matched by user (resolveCommentOwnerID()), categories by the
|
|
24150
|
+
* operator's missions on both spaces (loadDomainIndex());
|
|
24151
|
+
* - import: the archive's users belong to another environment, comments are credited to
|
|
24152
|
+
* the operator; categories are matched by name (loadImportedDomainIndex()).
|
|
24153
|
+
*/
|
|
24154
|
+
async loadReferenceIndexes(snapshot, targetSpaceId, targetMissionId) {
|
|
24155
|
+
this.sourceHashtagNames = snapshot.hashtagNames;
|
|
24156
|
+
await this.loadTargetHashtagIndex(targetSpaceId);
|
|
24157
|
+
if (snapshot.kind === 'archive') {
|
|
24158
|
+
this.importOwnerMissionId = targetMissionId;
|
|
24159
|
+
await this.loadImportedDomainIndex(snapshot.domains, targetSpaceId);
|
|
24160
|
+
return;
|
|
24161
|
+
}
|
|
24162
|
+
this.sourceMissionUserIds = snapshot.missionUserIds;
|
|
24163
|
+
await this.loadTargetMissionIndex(targetSpaceId);
|
|
24164
|
+
await this.loadDomainIndex(snapshot.spaceId, targetSpaceId);
|
|
24165
|
+
}
|
|
24166
|
+
/**
|
|
24167
|
+
* READ-ONLY indexing for an import: the archived categories by their (foreign) id, and the
|
|
24168
|
+
* categories the operator's mission on the target space can see, by (type, name).
|
|
24169
|
+
* Missing categories are created in the mission's organisation, on demand — see
|
|
24170
|
+
* resolveImportedDomainID(). When the target categories cannot be read, none is created:
|
|
24171
|
+
* doing it blindly could duplicate existing ones.
|
|
24172
|
+
*/
|
|
24173
|
+
async loadImportedDomainIndex(domains, targetSpaceId) {
|
|
24174
|
+
for (const domain of domains || []) {
|
|
24175
|
+
if (domain?.id) {
|
|
24176
|
+
this.domainsById.set(domain.id, domain);
|
|
24177
|
+
}
|
|
24178
|
+
}
|
|
24179
|
+
const targetMission = this.userService.currentMission(targetSpaceId);
|
|
24180
|
+
const orgIds = Array.from(new Set([targetMission?.organisationID, targetMission?.orderedOrganisationID]
|
|
24181
|
+
.filter((id) => !!id)));
|
|
24182
|
+
this.importDomainOrganisationId = targetMission?.organisationID ?? null;
|
|
24183
|
+
try {
|
|
24184
|
+
const domainLists = await Promise.all(orgIds.map(orgId => this.domainService.getAllGenericDomainsAndForOrganisation(orgId)));
|
|
24185
|
+
for (const domain of domainLists.flat()) {
|
|
24186
|
+
const key = domain?.name ? this.domainKey(domain.type, domain.name) : null;
|
|
24187
|
+
if (key && domain.id && !this.targetDomainIdsByTypeAndName.has(key)) {
|
|
24188
|
+
this.targetDomainIdsByTypeAndName.set(key, domain.id);
|
|
24189
|
+
}
|
|
24190
|
+
}
|
|
24191
|
+
}
|
|
24192
|
+
catch (error) {
|
|
24193
|
+
console.warn('[MatterportTagCopyService] Could not read the domains, imported categories will be dropped:', error);
|
|
24194
|
+
this.domainsById = new Map();
|
|
24195
|
+
this.importDomainOrganisationId = null;
|
|
24196
|
+
}
|
|
24197
|
+
}
|
|
24198
|
+
/**
|
|
24199
|
+
* Resolves an archived category for the target space: the category of the same type and
|
|
24200
|
+
* name the operator can see there, else a new one created in the organisation of their
|
|
24201
|
+
* mission on the target space (parents first, so the tree is kept). Dropped when it cannot
|
|
24202
|
+
* be created (no mission there, creation refused...).
|
|
24203
|
+
*/
|
|
24204
|
+
async resolveImportedDomainID(sourceDomainId, visiting = new Set()) {
|
|
24205
|
+
const domain = this.domainsById.get(sourceDomainId);
|
|
24206
|
+
if (!domain?.name) {
|
|
24207
|
+
return null;
|
|
24208
|
+
}
|
|
24209
|
+
const key = this.domainKey(domain.type, domain.name);
|
|
24210
|
+
const existingId = this.targetDomainIdsByTypeAndName.get(key);
|
|
24211
|
+
if (existingId) {
|
|
24212
|
+
return existingId;
|
|
24213
|
+
}
|
|
24214
|
+
if (!this.importDomainOrganisationId) {
|
|
24215
|
+
return null;
|
|
24216
|
+
}
|
|
24217
|
+
visiting.add(sourceDomainId);
|
|
24218
|
+
const parentID = domain.parentID && !visiting.has(domain.parentID)
|
|
24219
|
+
? await this.resolveImportedDomainID(domain.parentID, visiting)
|
|
24220
|
+
: null;
|
|
24221
|
+
try {
|
|
24222
|
+
const created = await this.domainService.createDomain({
|
|
24223
|
+
name: domain.name,
|
|
24224
|
+
slug: domain.slug ?? null,
|
|
24225
|
+
abbreviation: domain.abbreviation ?? null,
|
|
24226
|
+
description: domain.description ?? null,
|
|
24227
|
+
type: domain.type ?? null,
|
|
24228
|
+
parentID,
|
|
24229
|
+
organisationID: this.importDomainOrganisationId
|
|
24230
|
+
});
|
|
24231
|
+
if (!created?.id) {
|
|
24232
|
+
return null;
|
|
24233
|
+
}
|
|
24234
|
+
this.targetDomainIdsByTypeAndName.set(key, created.id);
|
|
24235
|
+
this.appendInfoLog(this.translate.instant('matterportCopy.domainCreated', { name: domain.name }));
|
|
24236
|
+
return created.id;
|
|
24237
|
+
}
|
|
24238
|
+
catch (error) {
|
|
24239
|
+
console.warn(`[MatterportTagCopyService] Could not create the category "${domain.name}":`, error);
|
|
24240
|
+
this.logItemError('errorDomainCreate', { name: domain.name, error: toErrorMessage(error) });
|
|
24241
|
+
// Remembered as "no equivalent", so the next item does not try again.
|
|
24242
|
+
this.domainsById.delete(sourceDomainId);
|
|
24243
|
+
return null;
|
|
24244
|
+
}
|
|
24245
|
+
}
|
|
24246
|
+
/**
|
|
24247
|
+
* Import counterpart of an S3 copy: uploads the archived bytes of `sourceKey` under
|
|
24248
|
+
* `destKey`. A file the export could not include is a MissingS3FileError, handled exactly
|
|
24249
|
+
* like an orphaned reference during a copy.
|
|
24250
|
+
*/
|
|
24251
|
+
async restoreArchivedFile(sourceKey, destKey, contextLabel) {
|
|
24252
|
+
const entry = this.archive?.manifest.files?.[sourceKey];
|
|
24253
|
+
const bytes = entry?.path ? this.archive?.files[entry.path] : undefined;
|
|
24254
|
+
if (!bytes) {
|
|
24255
|
+
throw new MissingS3FileError(sourceKey, contextLabel);
|
|
24256
|
+
}
|
|
24257
|
+
const contentType = entry?.contentType || null;
|
|
24258
|
+
return uploadS3Object(destKey, new Blob([bytes], contentType ? { type: contentType } : undefined), contentType);
|
|
24259
|
+
}
|
|
24260
|
+
/** Runs `task` over `items`, a few at a time (keeps the API and S3 from throttling). */
|
|
24261
|
+
async forEachInBatches(items, task, batchSize = 5) {
|
|
24262
|
+
for (let i = 0; i < items.length; i += batchSize) {
|
|
24263
|
+
await Promise.all(items.slice(i, i + batchSize).map((item, j) => task(item, i + j)));
|
|
24264
|
+
}
|
|
24265
|
+
}
|
|
24266
|
+
/** Every POI of a snapshot: those on the sweeps and those embedded in the elements. */
|
|
24267
|
+
allSnapshotPois(snapshot) {
|
|
24268
|
+
const embedded = [...snapshot.tickets, ...snapshot.equipments, ...snapshot.objects3D, ...snapshot.features]
|
|
24269
|
+
.flatMap((element) => element?.pois?.items || []);
|
|
24270
|
+
const measurementPois = snapshot.measurements.map(measurement => measurement?.poi);
|
|
24271
|
+
return [...snapshot.pois, ...embedded, ...measurementPois].filter(poi => !!poi);
|
|
24272
|
+
}
|
|
24273
|
+
/**
|
|
24274
|
+
* Raw S3 keys of every file the copy duplicates (see the copy phases): equipment photos and
|
|
24275
|
+
* notes, attachments and media, measurement screenshots, uploaded 3D models, tag icons.
|
|
24276
|
+
*/
|
|
24277
|
+
collectArchiveFileKeys(snapshot, comments) {
|
|
24278
|
+
const values = [];
|
|
24279
|
+
for (const equipment of snapshot.equipments) {
|
|
24280
|
+
values.push(equipment.photo);
|
|
24281
|
+
(equipment.notes?.items || []).forEach((note) => values.push(note?.attachment));
|
|
24282
|
+
}
|
|
24283
|
+
comments.forEach((comment) => values.push(comment?.annexe));
|
|
24284
|
+
snapshot.measurements.forEach((measurement) => values.push(measurement?.comment?.annexe));
|
|
24285
|
+
snapshot.objects3D
|
|
24286
|
+
.filter(object3D => object3D.s3Bucket)
|
|
24287
|
+
.forEach(object3D => values.push(object3D.path));
|
|
24288
|
+
for (const poi of this.allSnapshotPois(snapshot)) {
|
|
24289
|
+
try {
|
|
24290
|
+
values.push(poi.tagIcon ? JSON.parse(poi.tagIcon)?.src : null);
|
|
24291
|
+
}
|
|
24292
|
+
catch {
|
|
24293
|
+
// not JSON: duplicateTagIcon() leaves it untouched, there is no file to export
|
|
24294
|
+
}
|
|
24295
|
+
}
|
|
24296
|
+
const keys = new Set();
|
|
24297
|
+
values
|
|
24298
|
+
.filter((value) => typeof value === 'string' && !!value)
|
|
24299
|
+
.forEach(value => keys.add(this.extractS3KeyFromValue(value)));
|
|
24300
|
+
keys.delete('');
|
|
24301
|
+
return [...keys];
|
|
24302
|
+
}
|
|
24303
|
+
/**
|
|
24304
|
+
* Categories referenced by the exported records, with their ancestors: an import matches
|
|
24305
|
+
* them by name, and recreates the missing ones at the same place of the tree.
|
|
24306
|
+
*/
|
|
24307
|
+
async collectExportDomains(spaceId, records) {
|
|
24308
|
+
const referenced = new Set(records.map(record => record?.domainID).filter((id) => !!id));
|
|
24309
|
+
if (referenced.size === 0) {
|
|
24310
|
+
return [];
|
|
24311
|
+
}
|
|
24312
|
+
const mission = this.userService.currentMission(spaceId);
|
|
24313
|
+
const orgIds = Array.from(new Set([mission?.organisationID, mission?.orderedOrganisationID]
|
|
24314
|
+
.filter((id) => !!id)));
|
|
24315
|
+
const known = new Map();
|
|
24316
|
+
const lists = await Promise.all(orgIds.map(orgId => this.domainService.getAllGenericDomainsAndForOrganisation(orgId).catch(error => {
|
|
24317
|
+
console.warn('[MatterportTagCopyService] Could not read the domains to export:', error);
|
|
24318
|
+
return [];
|
|
24319
|
+
})));
|
|
24320
|
+
lists.flat().forEach(domain => domain?.id && known.set(domain.id, domain));
|
|
24321
|
+
const exported = new Map();
|
|
24322
|
+
const add = async (id) => {
|
|
24323
|
+
if (!id || exported.has(id)) {
|
|
24324
|
+
return;
|
|
24325
|
+
}
|
|
24326
|
+
let domain = known.get(id);
|
|
24327
|
+
if (!domain) {
|
|
24328
|
+
domain = await this.domainService.getDomain(id).catch(() => null);
|
|
24329
|
+
}
|
|
24330
|
+
if (!domain?.name) {
|
|
24331
|
+
return;
|
|
24332
|
+
}
|
|
24333
|
+
exported.set(id, {
|
|
24334
|
+
id: domain.id,
|
|
24335
|
+
name: domain.name,
|
|
24336
|
+
slug: domain.slug ?? null,
|
|
24337
|
+
abbreviation: domain.abbreviation ?? null,
|
|
24338
|
+
description: domain.description ?? null,
|
|
24339
|
+
type: domain.type ?? null,
|
|
24340
|
+
organisationID: domain.organisationID ?? null,
|
|
24341
|
+
parentID: domain.parentID ?? null
|
|
24342
|
+
});
|
|
24343
|
+
await add(domain.parentID);
|
|
24344
|
+
};
|
|
24345
|
+
for (const id of referenced) {
|
|
24346
|
+
await add(id);
|
|
24347
|
+
}
|
|
24348
|
+
return [...exported.values()];
|
|
24349
|
+
}
|
|
24350
|
+
/** Where an export comes from: environment (application origin), location, date, operator. */
|
|
24351
|
+
buildExportOrigin(spaceId, spaceName) {
|
|
24352
|
+
const user = this.userService.cu;
|
|
24353
|
+
const name = user ? `${user.firstName || ''} ${user.lastName || ''}`.trim() : '';
|
|
24354
|
+
return {
|
|
24355
|
+
environment: typeof window !== 'undefined' ? window.location.origin : '',
|
|
24356
|
+
module: this.spModule,
|
|
24357
|
+
spaceId,
|
|
24358
|
+
spaceName: spaceName || '',
|
|
24359
|
+
exportedAt: new Date().toISOString(),
|
|
24360
|
+
exportedBy: { userID: user?.userID ?? user?.id ?? null, name: name || null }
|
|
24361
|
+
};
|
|
24362
|
+
}
|
|
24363
|
+
/** File-name-safe version of a label. */
|
|
24364
|
+
toFileName(label) {
|
|
24365
|
+
return (label || 'space')
|
|
24366
|
+
.normalize('NFD').replace(/[̀-ͯ]/g, '')
|
|
24367
|
+
.replace(/[^a-zA-Z0-9\-_]+/g, '_')
|
|
24368
|
+
.replace(/^_+|_+$/g, '')
|
|
24369
|
+
.substring(0, 60) || 'space';
|
|
24370
|
+
}
|
|
24371
|
+
//
|
|
24372
|
+
// ---------- 3D models of the library ----------
|
|
24373
|
+
//
|
|
24374
|
+
/**
|
|
24375
|
+
* Reference of the model of a 3D object, as the archive indexes its files: the raw S3 key
|
|
24376
|
+
* of an uploaded model, `assets/3Dobjects/objects/<file>` for a library model, null for a
|
|
24377
|
+
* model hosted at an absolute url (nothing to carry over).
|
|
24378
|
+
*/
|
|
24379
|
+
object3DModelKeyOf(rawObject3D) {
|
|
24380
|
+
const path = rawObject3D?.path;
|
|
24381
|
+
if (!path) {
|
|
24382
|
+
return null;
|
|
24383
|
+
}
|
|
24384
|
+
if (rawObject3D.s3Bucket) {
|
|
24385
|
+
return this.extractS3KeyFromValue(path) || null;
|
|
24386
|
+
}
|
|
24387
|
+
const libraryFile = getObject3DLibraryFile(path);
|
|
24388
|
+
return libraryFile ? OBJECT3D_LIBRARY_ASSET_FOLDER + libraryFile : null;
|
|
24389
|
+
}
|
|
24390
|
+
/**
|
|
24391
|
+
* 3D models of an archive that an import could not give to their objects: neither in the
|
|
24392
|
+
* archive (missing on the source, or not exportable — a library model of another format
|
|
24393
|
+
* than .glb) nor shipped by this application. The operator can provide a .glb for each
|
|
24394
|
+
* before importing (see importTagsFromArchive(), `replacementModels`); otherwise the
|
|
24395
|
+
* object is created without a displayable model and the log says so.
|
|
24396
|
+
*/
|
|
24397
|
+
async getMissingObject3DModels(archive) {
|
|
24398
|
+
const missing = new Map();
|
|
24399
|
+
const servedChecks = new Map();
|
|
24400
|
+
for (const object3D of archive?.manifest?.data?.objects3D || []) {
|
|
24401
|
+
const key = this.object3DModelKeyOf(object3D);
|
|
24402
|
+
if (!key) {
|
|
24403
|
+
continue;
|
|
24404
|
+
}
|
|
24405
|
+
const entry = archive.manifest.files?.[key];
|
|
24406
|
+
if (entry?.path && archive.files[entry.path]) {
|
|
24407
|
+
continue; // carried by the archive
|
|
24408
|
+
}
|
|
24409
|
+
const libraryFile = object3D.s3Bucket ? null : getObject3DLibraryFile(object3D.path);
|
|
24410
|
+
if (libraryFile) {
|
|
24411
|
+
if (!servedChecks.has(libraryFile)) {
|
|
24412
|
+
servedChecks.set(libraryFile, this.isLibraryModelServed(libraryFile));
|
|
24413
|
+
}
|
|
24414
|
+
if (await servedChecks.get(libraryFile)) {
|
|
24415
|
+
continue; // shipped by this application
|
|
24416
|
+
}
|
|
24417
|
+
}
|
|
24418
|
+
const model = missing.get(key) ?? { key, fileName: key.split('/').pop() || key, objectNames: [] };
|
|
24419
|
+
model.objectNames.push(object3D.name || object3D.id);
|
|
24420
|
+
missing.set(key, model);
|
|
24421
|
+
}
|
|
24422
|
+
return [...missing.values()];
|
|
24423
|
+
}
|
|
24424
|
+
/**
|
|
24425
|
+
* Model path of a copied / imported 3D object when this application may not write model
|
|
24426
|
+
* files (see OBJECT3D_MODEL_UPLOAD_ENABLED):
|
|
24427
|
+
* - copy between two locations: the same path, an S3 model included — both objects then
|
|
24428
|
+
* share the file, which nothing deletes with an object;
|
|
24429
|
+
* - import: a library model is referenced as is (reported when this application does not
|
|
24430
|
+
* ship it); an S3 model of the other environment cannot be referenced at all, the object
|
|
24431
|
+
* is skipped (Object3DModelUploadDisabledError).
|
|
24432
|
+
*/
|
|
24433
|
+
async modelPathWithoutUpload(rawObject3D) {
|
|
24434
|
+
if (!this.archive) {
|
|
24435
|
+
return rawObject3D.path ?? null;
|
|
24436
|
+
}
|
|
24437
|
+
if (rawObject3D.s3Bucket) {
|
|
24438
|
+
throw new Object3DModelUploadDisabledError(rawObject3D.name || rawObject3D.id);
|
|
24439
|
+
}
|
|
24440
|
+
const file = getObject3DLibraryFile(rawObject3D.path);
|
|
24441
|
+
if (file && !(await this.isLibraryModelAvailable(file))) {
|
|
24442
|
+
this.logItemError('errorObject3dModelMissing', { name: rawObject3D.name || rawObject3D.id, file });
|
|
24443
|
+
}
|
|
24444
|
+
return rawObject3D.path ?? null;
|
|
24445
|
+
}
|
|
24446
|
+
/** Replacement model the operator chose for this object's model, if any. */
|
|
24447
|
+
replacementModelOf(rawObject3D) {
|
|
24448
|
+
const key = this.archive ? this.object3DModelKeyOf(rawObject3D) : null;
|
|
24449
|
+
const file = key ? this.replacementModels.get(key) : undefined;
|
|
24450
|
+
return key && file ? { key, file } : null;
|
|
24451
|
+
}
|
|
24452
|
+
/** Uploads a replacement model once, whatever the number of objects using it. */
|
|
24453
|
+
uploadReplacementModel(model, targetSpaceId) {
|
|
24454
|
+
if (!this.uploadedReplacementKeys.has(model.key)) {
|
|
24455
|
+
const fileName = model.file.name || model.key.split('/').pop() || 'model.glb';
|
|
24456
|
+
const upload = uploadS3Object(buildObject3DModelKey(targetSpaceId, fileName), model.file, GLB_CONTENT_TYPE)
|
|
24457
|
+
.then(key => {
|
|
24458
|
+
this.appendInfoLog(this.translate.instant('matterportCopy.object3dModelReplaced', { file: model.key.split('/').pop(), replacement: fileName }));
|
|
24459
|
+
return key;
|
|
24460
|
+
});
|
|
24461
|
+
// a failed upload is retried by the next object using the model
|
|
24462
|
+
upload.catch(() => this.uploadedReplacementKeys.delete(model.key));
|
|
24463
|
+
this.uploadedReplacementKeys.set(model.key, upload);
|
|
24464
|
+
}
|
|
24465
|
+
return this.uploadedReplacementKeys.get(model.key);
|
|
24466
|
+
}
|
|
24467
|
+
/** File names of the library .glb models the snapshot's 3D objects use (see object3d-model.util.ts). */
|
|
24468
|
+
collectLibraryModelFiles(snapshot) {
|
|
24469
|
+
const files = new Set();
|
|
24470
|
+
for (const object3D of snapshot.objects3D) {
|
|
24471
|
+
const file = object3D?.s3Bucket ? null : getObject3DLibraryFile(object3D?.path);
|
|
24472
|
+
if (file && file.toLowerCase().endsWith('.glb')) {
|
|
24473
|
+
files.add(file);
|
|
24474
|
+
}
|
|
24475
|
+
}
|
|
24476
|
+
return [...files];
|
|
24477
|
+
}
|
|
24478
|
+
/** Url this application serves a library model from. */
|
|
24479
|
+
libraryModelUrl(file) {
|
|
24480
|
+
const base = typeof document !== 'undefined' ? document.baseURI : '/';
|
|
24481
|
+
return new URL(OBJECT3D_LIBRARY_ASSET_FOLDER + file.split('/').map(encodeURIComponent).join('/'), base).toString();
|
|
24482
|
+
}
|
|
24483
|
+
/**
|
|
24484
|
+
* Bytes of a library model as this application serves it; null when it does not ship it.
|
|
24485
|
+
* A single-page host answers an unknown path with the index page (200, text/html): that is
|
|
24486
|
+
* a missing file too.
|
|
24487
|
+
*/
|
|
24488
|
+
async fetchLibraryModel(file) {
|
|
24489
|
+
const response = await fetch(this.libraryModelUrl(file));
|
|
24490
|
+
if (!response.ok || (response.headers.get('content-type') || '').includes('text/html')) {
|
|
24491
|
+
return null;
|
|
24492
|
+
}
|
|
24493
|
+
return new Uint8Array(await response.arrayBuffer());
|
|
24494
|
+
}
|
|
24495
|
+
/** Whether this application ships a library model (checked once per file and per run). */
|
|
24496
|
+
async isLibraryModelAvailable(file) {
|
|
24497
|
+
if (!this.libraryModelAvailability.has(file)) {
|
|
24498
|
+
this.libraryModelAvailability.set(file, this.isLibraryModelServed(file));
|
|
24499
|
+
}
|
|
24500
|
+
return this.libraryModelAvailability.get(file);
|
|
24501
|
+
}
|
|
24502
|
+
/** Asks this application whether it serves a library model (an index page is a no). */
|
|
24503
|
+
isLibraryModelServed(file) {
|
|
24504
|
+
return fetch(this.libraryModelUrl(file), { method: 'HEAD' })
|
|
24505
|
+
.then(response => response.ok && !(response.headers.get('content-type') || '').includes('text/html'))
|
|
24506
|
+
.catch(() => false);
|
|
24507
|
+
}
|
|
24508
|
+
/**
|
|
24509
|
+
* Import of a 3D object whose model comes from the application's library: when the target
|
|
24510
|
+
* application does not ship that model, the copy exported in the archive is uploaded to S3
|
|
24511
|
+
* and the object switched to it. Returns the S3 key, or null to keep the library path
|
|
24512
|
+
* (model available, or impossible to restore — reported in the log).
|
|
24513
|
+
*/
|
|
24514
|
+
async restoreMissingLibraryModel(rawObject3D, targetSpaceId) {
|
|
24515
|
+
const file = getObject3DLibraryFile(rawObject3D?.path);
|
|
24516
|
+
if (!file || await this.isLibraryModelAvailable(file)) {
|
|
24517
|
+
return null;
|
|
24518
|
+
}
|
|
24519
|
+
const entry = this.archive?.manifest.files?.[OBJECT3D_LIBRARY_ASSET_FOLDER + file];
|
|
24520
|
+
const bytes = entry?.path ? this.archive?.files[entry.path] : undefined;
|
|
24521
|
+
if (!bytes) {
|
|
24522
|
+
this.logItemError('errorObject3dModelMissing', { name: rawObject3D?.name || rawObject3D?.id, file });
|
|
24523
|
+
return null;
|
|
24524
|
+
}
|
|
24525
|
+
const key = buildObject3DModelKey(targetSpaceId, file);
|
|
24526
|
+
const uploaded = await uploadS3Object(key, new Blob([bytes], { type: GLB_CONTENT_TYPE }), GLB_CONTENT_TYPE);
|
|
24527
|
+
this.appendInfoLog(this.translate.instant('matterportCopy.object3dModelUploaded', { name: rawObject3D?.name || rawObject3D?.id, file }));
|
|
24528
|
+
return uploaded;
|
|
24529
|
+
}
|
|
23293
24530
|
//
|
|
23294
24531
|
// ---------- Progress / log helpers ----------
|
|
23295
24532
|
//
|
|
@@ -23318,6 +24555,12 @@ class MatterportTagCopyService {
|
|
|
23318
24555
|
this.log.push({ id: `healed-${this.logSeq}`, type: 'healed', text });
|
|
23319
24556
|
this.copyLog$.next([...this.log]);
|
|
23320
24557
|
}
|
|
24558
|
+
/** Appends a permanent, neutral log line (origin of an import, category created...). */
|
|
24559
|
+
appendInfoLog(text) {
|
|
24560
|
+
this.logSeq++;
|
|
24561
|
+
this.log.push({ id: `info-${this.logSeq}`, type: 'info', text });
|
|
24562
|
+
this.copyLog$.next([...this.log]);
|
|
24563
|
+
}
|
|
23321
24564
|
/** Resets the log for a new run. */
|
|
23322
24565
|
resetLog() {
|
|
23323
24566
|
this.log = [];
|
|
@@ -23341,6 +24584,13 @@ class MatterportTagCopyService {
|
|
|
23341
24584
|
this.targetVisibleDomainOrgIds = new Set();
|
|
23342
24585
|
this.targetDomainIdsByTypeAndName = new Map();
|
|
23343
24586
|
this.targetSpaceId = targetSpaceId;
|
|
24587
|
+
this.archive = null;
|
|
24588
|
+
this.importOwnerMissionId = null;
|
|
24589
|
+
this.importDomainOrganisationId = null;
|
|
24590
|
+
this.keepSweepIds = false;
|
|
24591
|
+
this.libraryModelAvailability = new Map();
|
|
24592
|
+
this.replacementModels = new Map();
|
|
24593
|
+
this.uploadedReplacementKeys = new Map();
|
|
23344
24594
|
}
|
|
23345
24595
|
/** Builds and sets a step's log line as "<translated label>: <percent>%", no step numbering. */
|
|
23346
24596
|
setStepProgress(stepId, translationKey, percent) {
|
|
@@ -23465,10 +24715,13 @@ class MatterportTagCopyService {
|
|
|
23465
24715
|
* - otherwise: matched by (type, name) against the domains visible to the TARGET
|
|
23466
24716
|
* operator (loadDomainIndex()); dropped when no equivalent exists there.
|
|
23467
24717
|
*/
|
|
23468
|
-
resolveDomainID(sourceDomainId) {
|
|
24718
|
+
async resolveDomainID(sourceDomainId) {
|
|
23469
24719
|
if (!sourceDomainId) {
|
|
23470
24720
|
return null;
|
|
23471
24721
|
}
|
|
24722
|
+
if (this.archive) {
|
|
24723
|
+
return this.resolveImportedDomainID(sourceDomainId);
|
|
24724
|
+
}
|
|
23472
24725
|
const domain = this.domainsById.get(sourceDomainId);
|
|
23473
24726
|
if (!domain) {
|
|
23474
24727
|
// Not visible to either operator's mission (lookup failed, or it belongs to
|
|
@@ -23485,35 +24738,46 @@ class MatterportTagCopyService {
|
|
|
23485
24738
|
return name.trim().toLowerCase();
|
|
23486
24739
|
}
|
|
23487
24740
|
/**
|
|
23488
|
-
* READ-ONLY
|
|
24741
|
+
* READ-ONLY: hashtag id -> name of a space's hashtags. Creates nothing.
|
|
23489
24742
|
*
|
|
23490
24743
|
* `Feature.hashtags` stores Hashtag *ids*, and a Hashtag is a per-space record, so the
|
|
23491
|
-
* ids have to be translated by name. The translation table is built
|
|
23492
|
-
* keywords are created later, one at a time, only
|
|
23493
|
-
* about to be written (see resolveHashtagIds()).
|
|
24744
|
+
* ids have to be translated by name. The translation table is built from this and
|
|
24745
|
+
* loadTargetHashtagIndex(); the missing keywords are created later, one at a time, only
|
|
24746
|
+
* when a POI that actually uses them is about to be written (see resolveHashtagIds()).
|
|
24747
|
+
* A failed read answers an empty map: the keywords are then dropped.
|
|
23494
24748
|
*/
|
|
23495
|
-
async
|
|
23496
|
-
|
|
23497
|
-
let targetHashtags = [];
|
|
24749
|
+
async loadHashtagNames(spaceId) {
|
|
24750
|
+
const names = new Map();
|
|
23498
24751
|
try {
|
|
23499
|
-
|
|
23500
|
-
|
|
23501
|
-
|
|
23502
|
-
|
|
24752
|
+
const hashtags = await this.hashtagService.listHashtagsForSpace(spaceId);
|
|
24753
|
+
for (const hashtag of hashtags || []) {
|
|
24754
|
+
if (hashtag?.id && hashtag.name) {
|
|
24755
|
+
names.set(hashtag.id, hashtag.name);
|
|
24756
|
+
}
|
|
24757
|
+
}
|
|
23503
24758
|
}
|
|
23504
24759
|
catch (error) {
|
|
23505
|
-
console.warn('[MatterportTagCopyService] Could not read the hashtags, keywords will be dropped:', error);
|
|
23506
|
-
return;
|
|
24760
|
+
console.warn('[MatterportTagCopyService] Could not read the source hashtags, keywords will be dropped:', error);
|
|
23507
24761
|
}
|
|
23508
|
-
|
|
23509
|
-
|
|
23510
|
-
|
|
24762
|
+
return names;
|
|
24763
|
+
}
|
|
24764
|
+
/**
|
|
24765
|
+
* READ-ONLY indexing of the target space's hashtags, by name. When they cannot be read,
|
|
24766
|
+
* the source keywords are dropped too: creating them blindly could duplicate keywords the
|
|
24767
|
+
* target already has.
|
|
24768
|
+
*/
|
|
24769
|
+
async loadTargetHashtagIndex(targetSpaceId) {
|
|
24770
|
+
try {
|
|
24771
|
+
const targetHashtags = await this.hashtagService.listHashtagsForSpace(targetSpaceId);
|
|
24772
|
+
for (const hashtag of targetHashtags || []) {
|
|
24773
|
+
if (hashtag?.id && hashtag.name) {
|
|
24774
|
+
this.targetHashtagIdsByName.set(this.hashtagKey(hashtag.name), hashtag.id);
|
|
24775
|
+
}
|
|
23511
24776
|
}
|
|
23512
24777
|
}
|
|
23513
|
-
|
|
23514
|
-
|
|
23515
|
-
|
|
23516
|
-
}
|
|
24778
|
+
catch (error) {
|
|
24779
|
+
console.warn('[MatterportTagCopyService] Could not read the hashtags, keywords will be dropped:', error);
|
|
24780
|
+
this.sourceHashtagNames = new Map();
|
|
23517
24781
|
}
|
|
23518
24782
|
}
|
|
23519
24783
|
/**
|
|
@@ -23569,36 +24833,42 @@ class MatterportTagCopyService {
|
|
|
23569
24833
|
return resolved.length > 0 ? resolved : null;
|
|
23570
24834
|
}
|
|
23571
24835
|
/**
|
|
23572
|
-
* READ-ONLY
|
|
24836
|
+
* READ-ONLY: mission id -> user id of a space's missions.
|
|
23573
24837
|
*
|
|
23574
24838
|
* A Mission is scoped to one space (it pairs a userID with a spaceID), so the id a
|
|
23575
24839
|
* source comment's `ownerID` points at never designates anyone in the target space.
|
|
23576
|
-
* This
|
|
23577
|
-
* which user a source Mission id belongs to, and which Mission (if
|
|
23578
|
-
* user already holds in the target space.
|
|
24840
|
+
* This and loadTargetMissionIndex() build the two lookup tables resolveCommentOwnerID()
|
|
24841
|
+
* needs to translate it: which user a source Mission id belongs to, and which Mission (if
|
|
24842
|
+
* any) that same user already holds in the target space.
|
|
24843
|
+
* A failed read answers an empty map: comment authorship is then dropped.
|
|
23579
24844
|
*/
|
|
23580
|
-
async
|
|
23581
|
-
|
|
23582
|
-
let targetMissions = [];
|
|
24845
|
+
async loadMissionUserIds(spaceId) {
|
|
24846
|
+
const userIds = new Map();
|
|
23583
24847
|
try {
|
|
23584
|
-
|
|
23585
|
-
|
|
23586
|
-
|
|
23587
|
-
|
|
24848
|
+
const missions = await this.missionService.getAllMissionsForSpace(spaceId);
|
|
24849
|
+
for (const mission of missions || []) {
|
|
24850
|
+
if (mission?.id && mission.userID) {
|
|
24851
|
+
userIds.set(mission.id, mission.userID);
|
|
24852
|
+
}
|
|
24853
|
+
}
|
|
23588
24854
|
}
|
|
23589
24855
|
catch (error) {
|
|
23590
|
-
console.warn('[MatterportTagCopyService] Could not read the missions, comment authorship will be dropped:', error);
|
|
23591
|
-
return;
|
|
24856
|
+
console.warn('[MatterportTagCopyService] Could not read the source missions, comment authorship will be dropped:', error);
|
|
23592
24857
|
}
|
|
23593
|
-
|
|
23594
|
-
|
|
23595
|
-
|
|
24858
|
+
return userIds;
|
|
24859
|
+
}
|
|
24860
|
+
/** READ-ONLY indexing of the target space's missions, by user. */
|
|
24861
|
+
async loadTargetMissionIndex(targetSpaceId) {
|
|
24862
|
+
try {
|
|
24863
|
+
const targetMissions = await this.missionService.getAllMissionsForSpace(targetSpaceId);
|
|
24864
|
+
for (const mission of targetMissions || []) {
|
|
24865
|
+
if (mission?.id && mission.userID && !this.targetMissionIdsByUserId.has(mission.userID)) {
|
|
24866
|
+
this.targetMissionIdsByUserId.set(mission.userID, mission.id);
|
|
24867
|
+
}
|
|
23596
24868
|
}
|
|
23597
24869
|
}
|
|
23598
|
-
|
|
23599
|
-
|
|
23600
|
-
this.targetMissionIdsByUserId.set(mission.userID, mission.id);
|
|
23601
|
-
}
|
|
24870
|
+
catch (error) {
|
|
24871
|
+
console.warn('[MatterportTagCopyService] Could not read the missions, comment authorship will be dropped:', error);
|
|
23602
24872
|
}
|
|
23603
24873
|
}
|
|
23604
24874
|
/**
|
|
@@ -23614,6 +24884,10 @@ class MatterportTagCopyService {
|
|
|
23614
24884
|
* is honest, a misattributed one is not.
|
|
23615
24885
|
*/
|
|
23616
24886
|
resolveCommentOwnerID(sourceOwnerID) {
|
|
24887
|
+
if (this.archive) {
|
|
24888
|
+
// Import: the author's mission belongs to another environment — see importOwnerMissionId.
|
|
24889
|
+
return this.importOwnerMissionId;
|
|
24890
|
+
}
|
|
23617
24891
|
if (!sourceOwnerID) {
|
|
23618
24892
|
return null;
|
|
23619
24893
|
}
|
|
@@ -23806,7 +25080,7 @@ class MatterportTagCopyService {
|
|
|
23806
25080
|
level: raw.level ?? null,
|
|
23807
25081
|
role: raw.role ?? null,
|
|
23808
25082
|
category: raw.category ?? null,
|
|
23809
|
-
domainID: this.resolveDomainID(raw.domainID),
|
|
25083
|
+
domainID: await this.resolveDomainID(raw.domainID),
|
|
23810
25084
|
// --- Matterport anchoring ---
|
|
23811
25085
|
metadata: this.getAdjustedPoiMetadata(sourcePoi.metadata, transform)
|
|
23812
25086
|
};
|
|
@@ -23897,7 +25171,7 @@ class MatterportTagCopyService {
|
|
|
23897
25171
|
* Returns both the patch to send and the list of healed field names, so the caller can
|
|
23898
25172
|
* both perform the update and describe it in the copy log.
|
|
23899
25173
|
*/
|
|
23900
|
-
buildHealPatch(sourceObj, existingTarget, fields, includeDomain) {
|
|
25174
|
+
async buildHealPatch(sourceObj, existingTarget, fields, includeDomain) {
|
|
23901
25175
|
const patch = {};
|
|
23902
25176
|
const healedFields = [];
|
|
23903
25177
|
const fillIfMissing = (key, sourceValue) => {
|
|
@@ -23913,7 +25187,7 @@ class MatterportTagCopyService {
|
|
|
23913
25187
|
fillIfMissing(field, sourceObj[field]);
|
|
23914
25188
|
}
|
|
23915
25189
|
if (includeDomain && (existingTarget.domainID === null || existingTarget.domainID === undefined)) {
|
|
23916
|
-
const resolvedDomainId = this.resolveDomainID(sourceObj.domainID);
|
|
25190
|
+
const resolvedDomainId = await this.resolveDomainID(sourceObj.domainID);
|
|
23917
25191
|
if (resolvedDomainId) {
|
|
23918
25192
|
patch.domainID = resolvedDomainId;
|
|
23919
25193
|
healedFields.push('domainID');
|
|
@@ -23933,7 +25207,7 @@ class MatterportTagCopyService {
|
|
|
23933
25207
|
* Returns the list of fields that were actually healed (empty if nothing was missing).
|
|
23934
25208
|
*/
|
|
23935
25209
|
async healEquipmentIdentity(sourceObj, existingTarget) {
|
|
23936
|
-
const { patch, healedFields } = this.buildHealPatch(sourceObj, existingTarget, ['status', 'annotation', 'family', 'sku', 'manufacturer', 'installDate', 'warrantyEndDate', 'metadata', 'isCreatedByAI'], true);
|
|
25210
|
+
const { patch, healedFields } = await this.buildHealPatch(sourceObj, existingTarget, ['status', 'annotation', 'family', 'sku', 'manufacturer', 'installDate', 'warrantyEndDate', 'metadata', 'isCreatedByAI'], true);
|
|
23937
25211
|
if (!existingTarget.photo && sourceObj.photo) {
|
|
23938
25212
|
patch.photo = await this.copyS3KeyIfPresent(sourceObj.photo, `equipment photo "${sourceObj.name}"`);
|
|
23939
25213
|
healedFields.push('photo');
|
|
@@ -23951,7 +25225,7 @@ class MatterportTagCopyService {
|
|
|
23951
25225
|
* are never part of the heal — by construction, they already agree with the source.
|
|
23952
25226
|
*/
|
|
23953
25227
|
async healTicketIdentity(sourceObj, existingTarget) {
|
|
23954
|
-
const { patch, healedFields } = this.buildHealPatch(sourceObj, existingTarget, ['friendlyLabel', 'status', 'type', 'priority', 'level', 'metadata', 'read', 'projectID', 'problemCode'], true);
|
|
25228
|
+
const { patch, healedFields } = await this.buildHealPatch(sourceObj, existingTarget, ['friendlyLabel', 'status', 'type', 'priority', 'level', 'metadata', 'read', 'projectID', 'problemCode'], true);
|
|
23955
25229
|
if (healedFields.length === 0) {
|
|
23956
25230
|
return healedFields;
|
|
23957
25231
|
}
|
|
@@ -23962,7 +25236,7 @@ class MatterportTagCopyService {
|
|
|
23962
25236
|
/** Same idea, for a pre-existing feature. Keywords, media and POIs are not healed here
|
|
23963
25237
|
* for the same reason notes/POIs are not healed on equipment — see healEquipmentIdentity(). */
|
|
23964
25238
|
async healFeatureIdentity(sourceObj, existingTarget) {
|
|
23965
|
-
const { patch, healedFields } = this.buildHealPatch(sourceObj, existingTarget, ['shortDescription', 'level', 'type', 'index', 'stripeProductID', 'stripePriceID', 'bookingPriceMetadata', 'locale'], true);
|
|
25239
|
+
const { patch, healedFields } = await this.buildHealPatch(sourceObj, existingTarget, ['shortDescription', 'level', 'type', 'index', 'stripeProductID', 'stripePriceID', 'bookingPriceMetadata', 'locale'], true);
|
|
23966
25240
|
if (healedFields.length === 0) {
|
|
23967
25241
|
return healedFields;
|
|
23968
25242
|
}
|
|
@@ -24020,6 +25294,19 @@ class MatterportTagCopyService {
|
|
|
24020
25294
|
yRotation: applyRigidTransformToYRotationDeg(parsed.yRotation, transform)
|
|
24021
25295
|
};
|
|
24022
25296
|
}
|
|
25297
|
+
/**
|
|
25298
|
+
* Moves a 3D object of the scene with the rigid transform: its position like a tag's, its
|
|
25299
|
+
* orientation turned by the same angle around the vertical axis (applyRigidTransformToEulerXYZ).
|
|
25300
|
+
* Its scale does not change: both models are in meters.
|
|
25301
|
+
*/
|
|
25302
|
+
getAdjustedObject3DPlacement(position, rotation, transform) {
|
|
25303
|
+
const moved = applyRigidTransformToPoint({ x: position[0], y: position[1], z: position[2] }, transform);
|
|
25304
|
+
const turned = applyRigidTransformToEulerXYZ({ x: rotation[0], y: rotation[1], z: rotation[2] }, transform);
|
|
25305
|
+
return {
|
|
25306
|
+
position: [moved.x, moved.y, moved.z],
|
|
25307
|
+
rotation: [turned.x, turned.y, turned.z]
|
|
25308
|
+
};
|
|
25309
|
+
}
|
|
24023
25310
|
/**
|
|
24024
25311
|
* Reads a stored coordinate (JSON string or object, whatever its spacing) as a position.
|
|
24025
25312
|
* Null for a virtual POI or an unreadable value.
|
|
@@ -24061,6 +25348,11 @@ class MatterportTagCopyService {
|
|
|
24061
25348
|
findClosestTargetSweepId(sourceSweepID, sourceNavPositions, targetNavPositions, transform) {
|
|
24062
25349
|
if (!sourceSweepID)
|
|
24063
25350
|
return null;
|
|
25351
|
+
// Same Matterport model on both sides: the sweep ids are the model's own, so the very
|
|
25352
|
+
// same sweep exists in the target visit.
|
|
25353
|
+
if (this.keepSweepIds && targetNavPositions.has(sourceSweepID)) {
|
|
25354
|
+
return sourceSweepID;
|
|
25355
|
+
}
|
|
24064
25356
|
const sourcePos = sourceNavPositions.get(sourceSweepID);
|
|
24065
25357
|
if (!sourcePos)
|
|
24066
25358
|
return null;
|
|
@@ -24114,12 +25406,15 @@ class MatterportTagCopyService {
|
|
|
24114
25406
|
* skip the whole item entirely, rather than creating a record with a broken file link.
|
|
24115
25407
|
* - Any other kind of failure (permissions, network, etc.) still throws a generic Error.
|
|
24116
25408
|
*/
|
|
24117
|
-
async copyS3KeyIfPresent(key, contextLabel, folderOverride = null) {
|
|
25409
|
+
async copyS3KeyIfPresent(key, contextLabel, folderOverride = null, buildDestKey = null) {
|
|
24118
25410
|
if (!key) {
|
|
24119
25411
|
return null;
|
|
24120
25412
|
}
|
|
24121
25413
|
const sourceKey = this.extractS3KeyFromValue(key);
|
|
24122
|
-
const destKey = this.buildCopiedAttachmentKey(sourceKey, folderOverride);
|
|
25414
|
+
const destKey = buildDestKey ? buildDestKey(sourceKey) : this.buildCopiedAttachmentKey(sourceKey, folderOverride);
|
|
25415
|
+
if (this.archive) {
|
|
25416
|
+
return this.restoreArchivedFile(sourceKey, destKey, contextLabel);
|
|
25417
|
+
}
|
|
24123
25418
|
// Log the source key to ensure it matches the real S3 object path
|
|
24124
25419
|
console.log(`[DEBUG] Attempting S3 copy from source: "${sourceKey}" to dest: "${destKey}"`);
|
|
24125
25420
|
try {
|
|
@@ -24657,13 +25952,16 @@ class MatterportTagCopyService {
|
|
|
24657
25952
|
this.setStepLog('done', this.translate.instant('matterportCopy.recalibrateSummary', result));
|
|
24658
25953
|
return result;
|
|
24659
25954
|
}
|
|
24660
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MatterportTagCopyService, deps: [{ token: NavigationService }, { token: BaseUserService }, { token: PoiService }, { token: TicketsService }, { token: EquipmentService }, { token: Object3DService }, { token: FeatureService }, { token: MeasurementService }, { token: CommentService }, { token: HashtagService }, { token: MissionService }, { token: OperationService }, { token: DomainService }, { token: i1$1.TranslateService }, { token: ZoneService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
25955
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MatterportTagCopyService, deps: [{ token: NavigationService }, { token: BaseUserService }, { token: PoiService }, { token: TicketsService }, { token: EquipmentService }, { token: Object3DService }, { token: FeatureService }, { token: MeasurementService }, { token: CommentService }, { token: HashtagService }, { token: MissionService }, { token: OperationService }, { token: DomainService }, { token: i1$1.TranslateService }, { token: ZoneService }, { token: OBJECT3D_MODEL_UPLOAD_ENABLED }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
24661
25956
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MatterportTagCopyService, providedIn: 'root' });
|
|
24662
25957
|
}
|
|
24663
25958
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MatterportTagCopyService, decorators: [{
|
|
24664
25959
|
type: Injectable,
|
|
24665
25960
|
args: [{ providedIn: 'root' }]
|
|
24666
|
-
}], ctorParameters: () => [{ type: NavigationService }, { type: BaseUserService }, { type: PoiService }, { type: TicketsService }, { type: EquipmentService }, { type: Object3DService }, { type: FeatureService }, { type: MeasurementService }, { type: CommentService }, { type: HashtagService }, { type: MissionService }, { type: OperationService }, { type: DomainService }, { type: i1$1.TranslateService }, { type: ZoneService }
|
|
25961
|
+
}], ctorParameters: () => [{ type: NavigationService }, { type: BaseUserService }, { type: PoiService }, { type: TicketsService }, { type: EquipmentService }, { type: Object3DService }, { type: FeatureService }, { type: MeasurementService }, { type: CommentService }, { type: HashtagService }, { type: MissionService }, { type: OperationService }, { type: DomainService }, { type: i1$1.TranslateService }, { type: ZoneService }, { type: undefined, decorators: [{
|
|
25962
|
+
type: Inject,
|
|
25963
|
+
args: [OBJECT3D_MODEL_UPLOAD_ENABLED]
|
|
25964
|
+
}] }] });
|
|
24667
25965
|
|
|
24668
25966
|
/* eslint-disable class-methods-use-this */
|
|
24669
25967
|
class OrganisationService {
|
|
@@ -24797,5 +26095,5 @@ function floatValidator() {
|
|
|
24797
26095
|
* Generated bundle index. Do not edit.
|
|
24798
26096
|
*/
|
|
24799
26097
|
|
|
24800
|
-
export { AffectationService, AvatarComponent, BaseLateralTabService, BaseTagService, BaseUserService, BaseVisibilityService, CameraMode, CaptureService, CaptureViewer, CheckboxSliderComponent, CommentService, CommentType, Config, ContentService, CsvExportComponent, DomainService, DomainType, DurationToStringPipe, EmailStatus, EquipmentService, EventService, EventStatus, EventType, FeatureService, FeatureType, FilterService, GAUSSIAN_SPLAT_PLY_SUFFIX, HashtagFromIdPipe, HashtagService, INVENTORY_CUTOFF_SCORES, INVENTORY_DEFAULT_CUTOFF, INVENTORY_DELETE_AT_ONCE, INVENTORY_MESH_FILE, INVENTORY_POSITIONS_FILE, INVENTORY_STALE_AFTER_MS, InterventionService, InventoryFilesComponent, InventoryLaunchComponent, InventoryRunsComponent, InventoryService, InventoryStatus, LayerService, LevelStatus, LoaderComponent, Locale, LocaleService, MATTERPORT_SDK_KEY, MatterportImportService, MatterportService, MatterportTagCopyService, MatterportViewType, MattertagActionMode, MattertagData, MeasurementService, MenuBarComponent, MissionService, NavigationService, NavigatorService, NgxSmarterplanCoreModule, NgxSmarterplanCoreService, NodeService, Object3DService, OperationService, OrganisationService, PLAN_ICONS, PaymentStatus, PlanService, PoiService, PoiType, ProfileEntity, ProfileService, ProfileStatus, PropertyService, PropertyType, RoleStatus, SafeUrlPipe, SearchBarComponent, SearchObjectType, SearchService, SpModule, SpaceService, SpaceStatus, SplatViewerComponent, StatusEquipment, SupportModalComponent, SupportService, SweepLocatorService, THREEJS_MODEL_UP_OPTIONS, TagAction, TemplateService, ThreeJsImportService, ThreeJsService, TicketPriority, TicketStatus, TicketType, TicketsService, TimeDateToLocalStringPipe, TypeNote, UsernameFromIdPipe, VIEWER_BACKGROUND, ValidatorsService, ViewerInteractions, ViewerService, VisitService, ZoneChangeService, ZoneService, applyRigidTransformToDirection, applyRigidTransformToPoint, applyRigidTransformToYRotationDeg, arraysContainSameElements, checkElementById, computeRigidTransform, convertObjToGlb, convertTimestampToLocalZone, copyFileInS3, copyFileInS3ViaDownload, dateHasExpired, dateTimeToLocalString, deleteFromS3, distance, downloadBlob, downloadEquipmentDocument, downloadFile, downloadFileAsObject, durationToString, emailValidator, enumToArray, filterUniqueArrayByID, floatValidator, getBufferForFileFromS3, getCoefficientsForImage, getCurrentLang, getDistanceBetweenTwoPoints, getHighestLevelForMissions, getHighestRoleForMissions, getLevelsBelow, getLocaleLong, getLocaleShort, getMetaForImage, getRolesBelowForManager, getSignedFile, getSignedImageUrlForEquipment, getSignedImageUrlForProfile, getSignedImageUrlForSpace, getSpaceIDFromUrl, getThreeJsPoiOrigin, getVisitUrl, hasObjModel, iconData, iconToDataUrl, isEmptyObject, isGaussianSplatFile, isGaussianSplatPly, isStreamedSplatFile, listFilesInFolder, mean, noEmptyValidator, numberToDateString, openDocument, openModalForVisitSwitch, parseThreeJsPlacement, poiTypeToString, pointToString, readObj, removeAllFilesFromFolderS3, removeNullKeysFromObject, showScanPointsOnPlanInDiv, shuffleArray, solveThreeJsAlignment, sortAlphabeticallyOnName, stringLocaleToEnum, stringToLowercaseNoSpaces, styleButton, svgToDataUrl, textValidator, translateDatePeriod, uploadBase64Image, uploadBase64ImageWithRetry, uploadFileToS3, uploadFileToS3WithProgress, uploadJsonToS3, validEmail, wait, waitUntil };
|
|
26098
|
+
export { AffectationService, AvatarComponent, BaseLateralTabService, BaseTagService, BaseUserService, BaseVisibilityService, CameraMode, CaptureService, CaptureViewer, CheckboxSliderComponent, CommentService, CommentType, Config, ContentService, CsvExportComponent, DomainService, DomainType, DurationToStringPipe, EmailStatus, EquipmentService, EventService, EventStatus, EventType, FeatureService, FeatureType, FilterService, GAUSSIAN_SPLAT_PLY_SUFFIX, GLB_CONTENT_TYPE, HashtagFromIdPipe, HashtagService, INVENTORY_CUTOFF_SCORES, INVENTORY_DEFAULT_CUTOFF, INVENTORY_DELETE_AT_ONCE, INVENTORY_MESH_FILE, INVENTORY_POSITIONS_FILE, INVENTORY_STALE_AFTER_MS, InterventionService, InventoryFilesComponent, InventoryLaunchComponent, InventoryRunsComponent, InventoryService, InventoryStatus, LayerService, LevelStatus, LoaderComponent, Locale, LocaleService, MATTERPORT_SDK_KEY, MatterportImportService, MatterportService, MatterportTagCopyService, MatterportViewType, MattertagActionMode, MattertagData, MeasurementService, MenuBarComponent, MissionService, NavigationService, NavigatorService, NgxSmarterplanCoreModule, NgxSmarterplanCoreService, NodeService, OBJECT3D_LIBRARY_ASSET_FOLDER, OBJECT3D_LIBRARY_FOLDER, OBJECT3D_MODEL_EXTENSIONS, OBJECT3D_MODEL_UPLOAD_ENABLED, OBJECT3D_S3_FOLDER, OBJECT3D_UPLOAD_MAX_BYTES, Object3DService, OperationService, OrganisationService, PLAN_ICONS, PaymentStatus, PlanService, PoiService, PoiType, ProfileEntity, ProfileService, ProfileStatus, PropertyService, PropertyType, RoleStatus, SafeUrlPipe, SearchBarComponent, SearchObjectType, SearchService, SpModule, SpaceService, SpaceStatus, SplatViewerComponent, StatusEquipment, SupportModalComponent, SupportService, SweepLocatorService, TAG_ARCHIVE_FILES_FOLDER, TAG_ARCHIVE_FORMAT, TAG_ARCHIVE_MANIFEST, TAG_ARCHIVE_VERSION, THREEJS_MODEL_UP_OPTIONS, TagAction, TagArchiveError, TemplateService, ThreeJsImportService, ThreeJsService, TicketPriority, TicketStatus, TicketType, TicketsService, TimeDateToLocalStringPipe, TypeNote, UsernameFromIdPipe, VIEWER_BACKGROUND, ValidatorsService, ViewerInteractions, ViewerService, VisitService, ZoneChangeService, ZoneService, applyRigidTransformToDirection, applyRigidTransformToEulerXYZ, applyRigidTransformToPoint, applyRigidTransformToYRotationDeg, arraysContainSameElements, buildObject3DModelKey, buildTagArchive, checkElementById, computeRigidTransform, convertObjToGlb, convertTimestampToLocalZone, copyFileInS3, copyFileInS3ViaDownload, dateHasExpired, dateTimeToLocalString, deleteFromS3, distance, downloadBlob, downloadEquipmentDocument, downloadFile, downloadFileAsObject, downloadS3Object, durationToString, emailValidator, enumToArray, filterUniqueArrayByID, floatValidator, getBufferForFileFromS3, getCoefficientsForImage, getCurrentLang, getDistanceBetweenTwoPoints, getHighestLevelForMissions, getHighestRoleForMissions, getLevelsBelow, getLocaleLong, getLocaleShort, getMetaForImage, getObject3DLibraryFile, getRolesBelowForManager, getSignedFile, getSignedImageUrlForEquipment, getSignedImageUrlForProfile, getSignedImageUrlForSpace, getSpaceIDFromUrl, getThreeJsPoiOrigin, getVisitUrl, hasObjModel, iconData, iconToDataUrl, isEmptyObject, isGaussianSplatFile, isGaussianSplatPly, isStreamedSplatFile, listFilesInFolder, mean, noEmptyValidator, numberToDateString, openDocument, openModalForVisitSwitch, parseThreeJsPlacement, poiTypeToString, pointToString, readObj, readTagArchive, removeAllFilesFromFolderS3, removeNullKeysFromObject, resolveObject3DModelSource, showScanPointsOnPlanInDiv, shuffleArray, solveThreeJsAlignment, sortAlphabeticallyOnName, stringLocaleToEnum, stringToLowercaseNoSpaces, styleButton, svgToDataUrl, tagArchiveFilePath, textValidator, translateDatePeriod, uploadBase64Image, uploadBase64ImageWithRetry, uploadFileToS3, uploadFileToS3WithProgress, uploadJsonToS3, uploadS3Object, validEmail, validateGlbFile, wait, waitUntil };
|
|
24801
26099
|
//# sourceMappingURL=smarterplan-ngx-smarterplan-core.mjs.map
|