quasar-ui-danx 0.0.29 → 0.0.30
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -165,7 +165,7 @@ export function useListActions(name, {
|
|
165
165
|
* @returns {Promise<Awaited<void>[]>}
|
166
166
|
*/
|
167
167
|
async function refreshAll() {
|
168
|
-
return Promise.all([loadList(), loadSummary(), loadFilterFieldOptions()]);
|
168
|
+
return Promise.all([loadList(), loadSummary(), loadFilterFieldOptions(), getActiveItemDetails()]);
|
169
169
|
}
|
170
170
|
|
171
171
|
/**
|
@@ -260,19 +260,30 @@ export function useListActions(name, {
|
|
260
260
|
// Controls the tab on the Ad Form
|
261
261
|
const formTab = ref("general");
|
262
262
|
|
263
|
+
/**
|
264
|
+
* Gets the additional details for the currently active item.
|
265
|
+
* (ie: data that is not normally loaded in the list because it is not needed for the list view)
|
266
|
+
* @returns {Promise<void>}
|
267
|
+
*/
|
268
|
+
async function getActiveItemDetails() {
|
269
|
+
if (!activeItem.value) return;
|
270
|
+
|
271
|
+
const result = await itemDetailsRoute(activeItem.value);
|
272
|
+
|
273
|
+
// Only set the ad details if we are the response for the currently loaded item
|
274
|
+
// NOTE: race conditions might allow the finished loading item to be different to the currently
|
275
|
+
// requested item
|
276
|
+
if (result?.id === activeItem.value?.id) {
|
277
|
+
activeItem.value = result;
|
278
|
+
}
|
279
|
+
}
|
280
|
+
|
263
281
|
// Whenever the active item changes, fill the additional item details
|
264
282
|
// (ie: tasks, verifications, creatives, etc.)
|
265
283
|
if (itemDetailsRoute) {
|
266
284
|
watch(() => activeItem.value, async (newItem, oldItem) => {
|
267
285
|
if (newItem && oldItem?.id !== newItem.id) {
|
268
|
-
|
269
|
-
|
270
|
-
// Only set the ad details if we are the response for the currently loaded item
|
271
|
-
// NOTE: race conditions might allow the finished loading item to be different to the currently
|
272
|
-
// requested item
|
273
|
-
if (result?.id === activeItem.value?.id) {
|
274
|
-
activeItem.value = result;
|
275
|
-
}
|
286
|
+
await getActiveItemDetails();
|
276
287
|
}
|
277
288
|
});
|
278
289
|
}
|
@@ -18,16 +18,17 @@ export function usePerformAction(actions: any[]) {
|
|
18
18
|
*
|
19
19
|
* @param name - can either be a string or an action object
|
20
20
|
* @param targets - an array of targets (or a single target object)
|
21
|
+
* @param options
|
21
22
|
* @returns {Promise<void>}
|
22
23
|
*/
|
23
|
-
async performAction(name, targets) {
|
24
|
+
async performAction(name, targets, options = {}) {
|
24
25
|
const action = typeof name === "string" ? actions.find(a => a.name === name) : name;
|
25
26
|
if (!action) {
|
26
27
|
throw new Error(`Unknown action: ${name}`);
|
27
28
|
}
|
28
29
|
targets = Array.isArray(targets) ? targets : [targets];
|
29
30
|
|
30
|
-
await performAction(action, targets);
|
31
|
+
await performAction({ ...action, ...options }, targets);
|
31
32
|
}
|
32
33
|
};
|
33
34
|
}
|