Skip to content

Commit

Permalink
#8387 Spaces/User admin list edit quota batch actions - Followup (#8438)
Browse files Browse the repository at this point in the history
  • Loading branch information
lookacat authored Feb 15, 2023
1 parent b9a3e39 commit fe151df
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ We've added the batch edit quota functionality to the admin panel for users pers

https://github.com/owncloud/web/pull/8387
https://github.com/owncloud/web/pull/8430
https://github.com/owncloud/web/pull/8438
https://github.com/owncloud/web/issues/8417
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<quota-modal
v-if="quotaModalIsOpen"
:cancel="closeQuotaModal"
:spaces="[resources[0]]"
:spaces="resources"
@space-quota-updated="spaceQuotaUpdated"
/>
<oc-list id="oc-spaces-actions-sidebar" class-name="oc-mt-s">
Expand Down
6 changes: 3 additions & 3 deletions packages/web-app-admin-settings/src/views/Spaces.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default defineComponent({
const { sideBarOpen, sideBarActivePanel } = useSideBar()
const loadResourcesEventToken = ref(null)
const updateQuotaForSpaceEventToken = ref(null)
let updateQuotaForSpaceEventToken
const template = ref(null)
const listHeaderPosition = ref(0)
const selectedSpaces = ref([])
Expand Down Expand Up @@ -265,7 +265,7 @@ export default defineComponent({
window.addEventListener('resize', calculateListHeaderPosition)
resizeObserver.observe(unref(appBarActionsRef))
updateQuotaForSpaceEventToken.value = eventBus.subscribe(
updateQuotaForSpaceEventToken = eventBus.subscribe(
'app.admin-settings.spaces.space.quota.updated',
({ spaceId, quota }) => {
const space = unref(spaces).find((s) => s.id === spaceId)
Expand All @@ -280,7 +280,7 @@ export default defineComponent({
eventBus.unsubscribe('app.admin-settings.list.load', unref(loadResourcesEventToken))
eventBus.unsubscribe(
'app.admin-settings.spaces.space.quota.updated',
unref(updateQuotaForSpaceEventToken)
updateQuotaForSpaceEventToken
)
resizeObserver.unobserve(unref(appBarActionsRef))
})
Expand Down
11 changes: 6 additions & 5 deletions packages/web-app-admin-settings/src/views/Users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,12 @@ export default defineComponent({
watch(selectedUserIds, async () => {
sideBarLoading.value = true
// Load additional user data
const requests = []
unref(selectedUsers).forEach((user) => {
requests.push(loadAdditionalUserDataTask.perform(user))
})
await Promise.all(requests)
const requests = unref(selectedUsers).map((user) => loadAdditionalUserDataTask.perform(user))
const results = await Promise.allSettled<Array<unknown>>(requests)
const failedRequests = results.filter((result) => result.status === 'rejected')
if (failedRequests.length > 0) {
console.debug('Failed to load additional user data', failedRequests)
}
if (unref(selectedUsers).length === 1) {
loadedUser.value = unref(selectedUsers)[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<quota-modal
v-if="quotaModalIsOpen"
:cancel="closeQuotaModal"
:spaces="quotaModalSelectedSpace"
:spaces="quotaModalSelectedSpaces"
/>
<readme-content-modal
v-if="readmeContentModalIsOpen"
Expand Down Expand Up @@ -74,7 +74,7 @@ export default defineComponent({
},
computed: {
quotaModalSelectedSpace() {
quotaModalSelectedSpaces() {
return [this.$data.$_editQuota_selectedSpace]
},
quotaModalIsOpen() {
Expand Down
2 changes: 1 addition & 1 deletion packages/web-pkg/src/components/Spaces/QuotaModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default defineComponent({
}
},
mounted() {
this.selectedOption = this.spaces[0].spaceQuota.total || 0
this.selectedOption = this.spaces[0]?.spaceQuota?.total || 0
},
methods: {
...mapActions(['showMessage']),
Expand Down
54 changes: 26 additions & 28 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fe151df

Please sign in to comment.