@dative-gpi/foundation-shared-components 1.0.178 → 1.0.179-edit-image

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.
@@ -13,7 +13,7 @@ import { computed, defineComponent, type PropType } from "vue";
13
13
 
14
14
  import { IMAGE_RAW_URL } from "@dative-gpi/foundation-shared-services/config";
15
15
 
16
- import { useImage } from "@dative-gpi/foundation-shared-services/composables";
16
+ import { useImage, useAppAuthToken } from "@dative-gpi/foundation-shared-services/composables";
17
17
 
18
18
  import FSEditImageUI from "./FSEditImageUI.vue";
19
19
 
@@ -32,10 +32,11 @@ export default defineComponent({
32
32
  emits: ["update:imageId"],
33
33
  setup(props) {
34
34
  const { get: getImage, entity: image } = useImage();
35
+ const { authToken } = useAppAuthToken();
35
36
 
36
37
  const source = computed(() => {
37
- return props.imageId ? IMAGE_RAW_URL(props.imageId) : null;
38
- })
38
+ return props.imageId ? IMAGE_RAW_URL(props.imageId, authToken.value) : null;
39
+ });
39
40
 
40
41
  const onError = (): void => {
41
42
  if (props.imageId) {
@@ -84,7 +84,7 @@
84
84
  </template>
85
85
 
86
86
  <script lang="ts">
87
- import { computed, defineComponent, type PropType, ref, type StyleValue } from "vue";
87
+ import { computed, defineComponent, type PropType, ref, type StyleValue, watch } from "vue";
88
88
 
89
89
  import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
90
90
  import { useAppLanguages } from "@dative-gpi/foundation-shared-services/composables";
@@ -165,7 +165,10 @@ export default defineComponent({
165
165
 
166
166
  const dialog = ref(false);
167
167
 
168
- const innerTranslations = ref(props.translations);
168
+ const innerTranslations = ref<{
169
+ languageCode: string;
170
+ [key: string]: string | null;
171
+ }[]>(props.translations);
169
172
 
170
173
  const lights = getColors(ColorEnum.Light);
171
174
  const darks = getColors(ColorEnum.Dark);
@@ -189,7 +192,8 @@ export default defineComponent({
189
192
  if (!translation || !translation[props.property]) {
190
193
  return "";
191
194
  }
192
- return translation[props.property];
195
+
196
+ return translation[props.property] ?? "";
193
197
  };
194
198
 
195
199
  const setTranslation = (languageCode: string, value: string): void => {
@@ -219,6 +223,10 @@ export default defineComponent({
219
223
  }
220
224
  };
221
225
 
226
+ watch(() => props.translations, (newVal) => {
227
+ innerTranslations.value = newVal;
228
+ }, { immediate: true, deep: true });
229
+
222
230
  return {
223
231
  innerTranslations,
224
232
  ColorEnum,
@@ -86,7 +86,7 @@
86
86
  </template>
87
87
 
88
88
  <script lang="ts">
89
- import { computed, defineComponent, type PropType, ref, type StyleValue } from "vue";
89
+ import { computed, defineComponent, type PropType, ref, type StyleValue, watch } from "vue";
90
90
 
91
91
  import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
92
92
  import { useAppLanguages } from "@dative-gpi/foundation-shared-services/composables";
@@ -164,7 +164,10 @@ export default defineComponent({
164
164
 
165
165
  const dialog = ref(false);
166
166
 
167
- const innerTranslations = ref(props.translations);
167
+ const innerTranslations = ref<{
168
+ languageCode: string;
169
+ [key: string]: string | null;
170
+ }[]>(props.translations);
168
171
 
169
172
  const lights = getColors(ColorEnum.Light);
170
173
  const darks = getColors(ColorEnum.Dark);
@@ -188,7 +191,7 @@ export default defineComponent({
188
191
  if (!translation || !translation[props.property]) {
189
192
  return "";
190
193
  }
191
- return translation[props.property];
194
+ return translation[props.property] ?? "";
192
195
  };
193
196
 
194
197
  const setTranslation = (languageCode: string, value: string): void => {
@@ -218,6 +221,10 @@ export default defineComponent({
218
221
  }
219
222
  };
220
223
 
224
+ watch(() => props.translations, (newVal) => {
225
+ innerTranslations.value = newVal;
226
+ }, { immediate: true, deep: true });
227
+
221
228
  return {
222
229
  innerTranslations,
223
230
  ColorEnum,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-components",
3
3
  "sideEffects": false,
4
- "version": "1.0.178",
4
+ "version": "1.0.179-edit-image",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,8 +10,8 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-shared-domain": "1.0.178",
14
- "@dative-gpi/foundation-shared-services": "1.0.178"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.179-edit-image",
14
+ "@dative-gpi/foundation-shared-services": "1.0.179-edit-image"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@dative-gpi/bones-ui": "^1.0.0",
@@ -35,5 +35,5 @@
35
35
  "sass": "1.71.1",
36
36
  "sass-loader": "13.3.2"
37
37
  },
38
- "gitHead": "231d210bbd4400f3a7c3f8efb35384c6bfc6d2cd"
38
+ "gitHead": "72963582266af77cf47e4585c5540f61cf80958f"
39
39
  }