aboutsummaryrefslogtreecommitdiff
path: root/resources/vue/store
diff options
context:
space:
mode:
authorPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-09-24 10:53:31 +0200
committerPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-09-24 10:53:31 +0200
commit4459dd7917f4d1c34f40bb68f0e991e9c3d53e4c (patch)
tree5c07151ae61276d334e88f6309c30d439a85c12e /resources/vue/store
parentda0022e5c1abbf9825ae76debaabdff7e8623bb4 (diff)
parent97a188592c679890a25c37ab78463add76a52ff7 (diff)
Merge branch 'main' into issue-3911issue-3911
Diffstat (limited to 'resources/vue/store')
-rw-r--r--resources/vue/store/ContentModulesStore.js2
-rw-r--r--resources/vue/store/MyCoursesStore.js2
-rw-r--r--resources/vue/store/blubber.js2
-rw-r--r--resources/vue/store/courseware/courseware-shelf.module.js24
-rw-r--r--resources/vue/store/courseware/courseware.module.js20
5 files changed, 15 insertions, 35 deletions
diff --git a/resources/vue/store/ContentModulesStore.js b/resources/vue/store/ContentModulesStore.js
index 9dc4609..141a178 100644
--- a/resources/vue/store/ContentModulesStore.js
+++ b/resources/vue/store/ContentModulesStore.js
@@ -52,7 +52,7 @@ export default {
attributes: { value: view === 'tiles' }
};
- return STUDIP.jsonapi.PATCH(`config-values/${documentId}`, { data: { data } }) ;
+ return STUDIP.jsonapi.withPromises().patch(`config-values/${documentId}`, { data: { data } }) ;
},
exchangeModules({ commit, state }, modules) {
const order = modules.filter(module => module.active)
diff --git a/resources/vue/store/MyCoursesStore.js b/resources/vue/store/MyCoursesStore.js
index 08c0389..af8e0fc 100644
--- a/resources/vue/store/MyCoursesStore.js
+++ b/resources/vue/store/MyCoursesStore.js
@@ -71,7 +71,7 @@ export default {
attributes: { value: configValue[configKey] }
};
- return STUDIP.jsonapi.PATCH(`config-values/${documentId}`, { data: { data } })
+ return STUDIP.jsonapi.withPromises().patch(`config-values/${documentId}`, { data: { data } })
},
toggleOpenGroup ({ state, dispatch }, group) {
let open_groups = [ ...state.config.open_groups ];
diff --git a/resources/vue/store/blubber.js b/resources/vue/store/blubber.js
index 9cc474a..d0bd7f6 100644
--- a/resources/vue/store/blubber.js
+++ b/resources/vue/store/blubber.js
@@ -166,7 +166,7 @@ export default {
// if total is missing, there are more comments to fetch
const total = rootGetters['blubber-comments/lastMeta']?.page?.total;
- const hasMore = !total;
+ const hasMore = total ?? true;
commit('setMoreOlder', { id, hasMore });
},
diff --git a/resources/vue/store/courseware/courseware-shelf.module.js b/resources/vue/store/courseware/courseware-shelf.module.js
index dc92a23..d907ee4 100644
--- a/resources/vue/store/courseware/courseware-shelf.module.js
+++ b/resources/vue/store/courseware/courseware-shelf.module.js
@@ -249,33 +249,23 @@ export const actions = {
}
},
async companionInfo({ dispatch }, { info }) {
- await dispatch('setStyleCompanionOverlay', 'default');
- await dispatch('setMsgCompanionOverlay', info);
- return dispatch('setShowCompanionOverlay', true);
+ STUDIP.eventBus.emit('push-system-notification', { type: 'info', message: info});
},
async companionSuccess({ dispatch }, { info }) {
- await dispatch('setStyleCompanionOverlay', 'happy');
- await dispatch('setMsgCompanionOverlay', info);
- return dispatch('setShowCompanionOverlay', true);
+ STUDIP.eventBus.emit('push-system-notification', { type: 'success', message: info});
},
async companionError({ dispatch }, { info }) {
- await dispatch('setStyleCompanionOverlay', 'sad');
- await dispatch('setMsgCompanionOverlay', info);
- return dispatch('setShowCompanionOverlay', true);
+ STUDIP.eventBus.emit('push-system-notification', { type: 'error', message: info});
},
async companionWarning({ dispatch }, { info }) {
- await dispatch('setStyleCompanionOverlay', 'alert');
- await dispatch('setMsgCompanionOverlay', info);
- return dispatch('setShowCompanionOverlay', true);
+ STUDIP.eventBus.emit('push-system-notification', { type: 'warning', message: info});
},
async companionSpecial({ dispatch }, { info }) {
- await dispatch('setStyleCompanionOverlay', 'special');
- await dispatch('setMsgCompanionOverlay', info);
- return dispatch('setShowCompanionOverlay', true);
+ STUDIP.eventBus.emit('push-system-notification', { type: 'info', message: info});
},
coursewareShowCompanionOverlay({dispatch}, { data }) {
return dispatch('setShowCompanionOverlay', data);
@@ -310,7 +300,7 @@ export const actions = {
return dispatch(loadUnits, state.context.id);
},
-
+
async sortUnits({ dispatch, state }, data) {
let loadUnits = null;
if (state.context.type === 'courses') {
@@ -321,7 +311,7 @@ export const actions = {
}
await state.httpClient.post(`${state.context.type}/${state.context.id}/courseware-units/sort`, {data: data});
-
+
return dispatch(loadUnits, state.context.id);
},
diff --git a/resources/vue/store/courseware/courseware.module.js b/resources/vue/store/courseware/courseware.module.js
index c44bba1..784b750 100644
--- a/resources/vue/store/courseware/courseware.module.js
+++ b/resources/vue/store/courseware/courseware.module.js
@@ -874,33 +874,23 @@ export const actions = {
},
async companionInfo({ dispatch }, { info }) {
- await dispatch('coursewareStyleCompanionOverlay', 'default');
- await dispatch('coursewareMsgCompanionOverlay', info);
- return dispatch('coursewareShowCompanionOverlay', true);
+ STUDIP.eventBus.emit('push-system-notification', { type: 'info', message: info});
},
async companionSuccess({ dispatch }, { info }) {
- await dispatch('coursewareStyleCompanionOverlay', 'happy');
- await dispatch('coursewareMsgCompanionOverlay', info);
- return dispatch('coursewareShowCompanionOverlay', true);
+ STUDIP.eventBus.emit('push-system-notification', { type: 'success', message: info});
},
async companionError({ dispatch }, { info }) {
- await dispatch('coursewareStyleCompanionOverlay', 'sad');
- await dispatch('coursewareMsgCompanionOverlay', info);
- return dispatch('coursewareShowCompanionOverlay', true);
+ STUDIP.eventBus.emit('push-system-notification', { type: 'error', message: info});
},
async companionWarning({ dispatch }, { info }) {
- await dispatch('coursewareStyleCompanionOverlay', 'alert');
- await dispatch('coursewareMsgCompanionOverlay', info);
- return dispatch('coursewareShowCompanionOverlay', true);
+ STUDIP.eventBus.emit('push-system-notification', { type: 'exception', message: info});
},
async companionSpecial({ dispatch }, { info }) {
- await dispatch('coursewareStyleCompanionOverlay', 'special');
- await dispatch('coursewareMsgCompanionOverlay', info);
- return dispatch('coursewareShowCompanionOverlay', true);
+ STUDIP.eventBus.emit('push-system-notification', { type: 'warning', message: info});
},
// adds a favorite block type using the `type` of the BlockType