@7365admin1/layer-common 4.90.2-staging.497 → 4.90.2-staging.498

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.
@@ -10,7 +10,7 @@
10
10
  <v-dialog v-model="changeOpen" max-width="620" persistent>
11
11
  <v-card class="screen-modal" data-test="spc-dialog">
12
12
  <v-card-title class="d-flex align-center">
13
- {{ kind === "owner" ? "Change site owner" : `Change or end ${fromName}` }}
13
+ {{ kind === "owner" ? "Change site owner" : `Change or end ${shownFrom}` }}
14
14
  <v-spacer />
15
15
  <v-btn variant="text" icon="mdi-close" class="screen-modal__close" aria-label="Close" :disabled="saving" @click="changeOpen = false" />
16
16
  </v-card-title>
@@ -23,7 +23,7 @@
23
23
  </template>
24
24
  <template v-else>
25
25
  Only {{ preview?.service || "this service" }} at {{ siteName || "this site" }} changes. Other services at the site,
26
- and {{ fromName }}'s other sites, are not touched.
26
+ and {{ shownFrom }}'s other sites, are not touched.
27
27
  </template>
28
28
  </p>
29
29
 
@@ -125,9 +125,20 @@
125
125
  <v-btn v-if="c.canCancel" size="small" variant="outlined" :loading="busy === c._id" data-test="spc-cancel" @click="cancelChange(c)">
126
126
  Cancel this plan
127
127
  </v-btn>
128
- <v-btn v-if="c.canUndo" size="small" variant="outlined" :loading="busy === c._id" data-test="spc-undo" @click="undoChange(c)">
129
- Undo (until {{ day(c.undoUntil) }})
130
- </v-btn>
128
+ <template v-if="c.canUndo">
129
+ <span v-if="confirmUndo === c._id" class="spc-sub align-self-center">Everything this change did is put back.</span>
130
+ <v-btn v-if="confirmUndo === c._id" size="small" variant="text" @click="confirmUndo = ''">Keep it</v-btn>
131
+ <v-btn
132
+ size="small"
133
+ :variant="confirmUndo === c._id ? 'flat' : 'outlined'"
134
+ :color="confirmUndo === c._id ? 'error' : undefined"
135
+ :loading="busy === c._id"
136
+ data-test="spc-undo"
137
+ @click="confirmUndo === c._id ? undoChange(c) : (confirmUndo = c._id)"
138
+ >
139
+ {{ confirmUndo === c._id ? "Yes, undo" : `Undo (until ${day(c.undoUntil)})` }}
140
+ </v-btn>
141
+ </template>
131
142
  </div>
132
143
  </div>
133
144
  </v-card-text>
@@ -165,6 +176,10 @@ const historyOpen = ref(false);
165
176
  const historyLoading = ref(false);
166
177
  const historyError = ref("");
167
178
  const busy = ref("");
179
+ /** The change whose Undo was pressed once; the second press does it. */
180
+ const confirmUndo = ref("");
181
+ /** The company being changed, as the server names it once the preview is in. */
182
+ const shownFrom = computed(() => preview.value?.fromName || fromName.value);
168
183
 
169
184
  const snack = ref(false);
170
185
  const snackText = ref("");
@@ -285,7 +300,7 @@ function openHistory() {
285
300
  }
286
301
 
287
302
  async function undoChange(c: Record<string, any>) {
288
- if (!window.confirm(`Undo "${title(c)}"? Everything this change did at ${props.siteName || "the site"} is put back.`)) return;
303
+ confirmUndo.value = "";
289
304
  busy.value = c._id;
290
305
  try {
291
306
  const res = await undoProviderChange(c._id);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "4.90.2-staging.497",
5
+ "version": "4.90.2-staging.498",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",