@yuuvis/client-core 2.3.9 → 2.3.11
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.
|
@@ -1779,15 +1779,13 @@ class SystemService {
|
|
|
1779
1779
|
#fetchObjectTypeForm(objectTypeId, situation) {
|
|
1780
1780
|
return this.#backend.get(Utils.buildUri(`/dms/forms/${objectTypeId}`, { situation })).pipe(
|
|
1781
1781
|
// add form to cache
|
|
1782
|
-
|
|
1782
|
+
switchMap((res) => this.#appCache.setItem(`${this.#STORAGE_KEY_FORMS}${objectTypeId}_${situation}`, res).pipe(map(() => res))));
|
|
1783
1783
|
}
|
|
1784
1784
|
#clearObjectTypeFormCache() {
|
|
1785
1785
|
// reset cache of object forms
|
|
1786
1786
|
return this.#appCache
|
|
1787
1787
|
.getStorageKeys()
|
|
1788
|
-
.pipe(
|
|
1789
|
-
forkJoin(keys.filter((key) => key.startsWith(this.#STORAGE_KEY_FORMS)).map((key) => this.#appCache.removeItem(key).pipe(catchError(() => of(null))))).subscribe();
|
|
1790
|
-
}))
|
|
1788
|
+
.pipe(switchMap((keys) => forkJoin(keys.filter((key) => key.startsWith(this.#STORAGE_KEY_FORMS)).map((key) => this.#appCache.removeItem(key).pipe(catchError(() => of(null)))))))
|
|
1791
1789
|
.subscribe();
|
|
1792
1790
|
}
|
|
1793
1791
|
/**
|
|
@@ -3964,6 +3962,29 @@ class DmsService {
|
|
|
3964
3962
|
#searchResultToDmsObject(resItem) {
|
|
3965
3963
|
return new DmsObject(resItem);
|
|
3966
3964
|
}
|
|
3965
|
+
/**
|
|
3966
|
+
* Transforms a plain data object to a DmsObject.
|
|
3967
|
+
* @param data The plain data object
|
|
3968
|
+
* @returns DmsObject
|
|
3969
|
+
*/
|
|
3970
|
+
toDmsObject(data) {
|
|
3971
|
+
const fields = new Map();
|
|
3972
|
+
Object.keys(data).forEach((key) => fields.set(key, data[key]));
|
|
3973
|
+
const item = {
|
|
3974
|
+
content: {
|
|
3975
|
+
contentStreamId: data[ContentStreamField.ID],
|
|
3976
|
+
mimeType: data[ContentStreamField.MIME_TYPE],
|
|
3977
|
+
fileName: data[ContentStreamField.FILENAME],
|
|
3978
|
+
size: data[ContentStreamField.LENGTH],
|
|
3979
|
+
digest: data[ContentStreamField.DIGEST],
|
|
3980
|
+
repositoryId: data[ContentStreamField.REPOSITORY_ID],
|
|
3981
|
+
range: data[ContentStreamField.RANGE]
|
|
3982
|
+
},
|
|
3983
|
+
objectTypeId: data[BaseObjectTypeField.OBJECT_TYPE_ID],
|
|
3984
|
+
fields
|
|
3985
|
+
};
|
|
3986
|
+
return this.#searchResultToDmsObject(item);
|
|
3987
|
+
}
|
|
3967
3988
|
batchUpdateTag(ids, tag, value) {
|
|
3968
3989
|
return this.#backend.batch(ids.map((id) => ({
|
|
3969
3990
|
method: 'POST',
|