Skip to content

Conversation

@AlexAndBear
Copy link
Contributor

@AlexAndBear AlexAndBear commented Jun 13, 2025

Description

Main motivation of this PR:

Move 'Upload image' and 'Set icon' context menu items into 'Space image' drop and add 'Delete image' action

Misc improvements in this PR:

  • show default image for space without an actual image in all places
  • allow multiple drop menus per section in context menus
  • align right sidebar menu actions order with context actions order
image ## Related Issue
  • Fixes <issue_link>

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@github-project-automation github-project-automation bot moved this to Qualification in OpenCloud Team Board Jun 13, 2025
@AlexAndBear AlexAndBear moved this from Qualification to In Progress in OpenCloud Team Board Jun 13, 2025
@AlexAndBear AlexAndBear marked this pull request as ready for review June 13, 2025 22:17
Copilot AI review requested due to automatic review settings June 13, 2025 22:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a “Delete image” action for spaces and groups all space-image related commands under a new “Space image” dropdown, while renaming the upload label.

  • Introduce useSpaceActionsDeleteImage composable with modal confirmation and service calls
  • Update unit tests for the new delete action and rename upload label
  • Refactor context menus and sidebar components to nest upload, set icon, and delete under a “Space image” drop

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/web-pkg/src/composables/actions/spaces/useSpaceActionsDeleteImage.ts New composable implementing delete flow, store updates, and messages
packages/web-pkg/tests/unit/composables/actions/spaces/useSpaceActionsDeleteImage.spec.ts Tests for visibility, handler modal, and success/error messaging
packages/web-pkg/src/composables/actions/spaces/index.ts Export useSpaceActionsDeleteImage
packages/web-app-files/src/composables/actions/spaces/useSpaceActionsUploadImage.ts Change label from “Edit image” to “Upload image”
packages/web-app-files/src/components/Spaces/SpaceHeader.vue Clear imageContent when no image data
packages/web-app-files/src/components/Spaces/SpaceContextActions.vue Add delete-image action, define Space image dropdown
packages/web-app-files/src/components/SideBar/Actions/SpaceActions.vue Add delete-image action to sidebar
Comments suppressed due to low confidence (2)

packages/web-pkg/tests/unit/composables/actions/spaces/useSpaceActionsDeleteImage.spec.ts:59

  • The test for permission-granted visibility omits spaceImageData, causing isVisible to return false. Mock spaceImageData alongside canEditImage to ensure the test accurately reflects the visible state.
resources: [mock<SpaceResource>({ canEditImage: () => true })]

packages/web-app-files/src/components/SideBar/Actions/SpaceActions.vue:69

  • [nitpick] Action aliases differ between components (deleteImageActions vs deleteSpaceImageActions). Rename one to match the other for consistency.
const { actions: deleteSpaceImageActions } = useSpaceActionsDeleteImage()

} from '@opencloud-eu/web-pkg'
import { useSpaceActionsUploadImage } from '../../composables'
import { computed, defineComponent, PropType, Ref, ref, toRef, unref, VNodeRef } from 'vue'
import { MenuSection } from '@opencloud-eu/web-pkg/src/components/ContextActions/ContextActionMenu.vue'
Copy link

Copilot AI Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Importing MenuSection directly from an internal path may break if the package structure changes. Consider exporting it from the package's public API surface instead.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@JammingBen JammingBen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works nice, I found one weird edge case though: when creating a new space, I have the option to remove the space image, even if I didn't set it before. Removing it then renders some icon until I refresh the page and it shows the default image again.

@AlexAndBear AlexAndBear changed the title feat: remove space image feat: add context menu action to remove space image Jun 23, 2025
…ns.vue

Co-authored-by: Jannik Stehle <50302941+JammingBen@users.noreply.github.com>
@AlexAndBear
Copy link
Contributor Author

Works nice, I found one weird edge case though: when creating a new space, I have the option to remove the space image, even if I didn't set it before.

That's because the backend sets a default space image from their templates

Copy link
Contributor

@kulmann kulmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@AlexAndBear AlexAndBear merged commit 35d46bf into main Jun 24, 2025
17 of 18 checks passed
@AlexAndBear AlexAndBear deleted the remove-space-image branch June 24, 2025 09:45
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenCloud Team Board Jun 24, 2025
@openclouders openclouders mentioned this pull request Jun 24, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants