Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/web-app-files/src/views/spaces/Projects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@
<oc-icon name="group" fill-type="line" />
</oc-button>
</template>
<template #contextMenu="{ resource }">
<template #contextMenu="{ resource, isOpen }">
<space-context-actions
v-if="isOpen && isResourceInSelection(resource)"
:loading="resource.graphPermissions === undefined"
:action-options="{ resources: [resource] as SpaceResource[] }"
/>
Expand Down Expand Up @@ -223,7 +224,8 @@ const {
scrollToResourceFromRoute,
areResourcesLoading,
selectedResourcesIds,
selectedResources
selectedResources,
isResourceInSelection
} = useResourcesViewDefaults({ loadResourcesTask })

let loadPreviewToken: string = null
Expand Down
5 changes: 4 additions & 1 deletion packages/web-pkg/src/components/AppTopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

<script lang="ts">
import { computed, defineComponent, PropType, unref } from 'vue'
import ContextActionMenu, { MenuSection } from './ContextActions/ContextActionMenu.vue'
import ContextActionMenu from './ContextActions/ContextActionMenu.vue'
import { useGettext } from 'vue3-gettext'
import {
Action,
Expand All @@ -107,6 +107,7 @@ import {
import ResourceListItem from './FilesList/ResourceListItem.vue'
import { isPublicSpaceResource, Resource } from '@opencloud-eu/web-client'
import { Duration } from 'luxon'
import { MenuSection } from './ContextActions'

export default defineComponent({
name: 'AppTopBar',
Expand Down Expand Up @@ -218,12 +219,14 @@ export default defineComponent({

.app-topbar-action {
color: var(--oc-role-on-chrome) !important;

svg {
fill: var(--oc-role-on-chrome) !important;
}

&:hover:not(:disabled) {
color: var(--oc-role-on-surface) !important;

svg {
fill: var(--oc-role-on-surface) !important;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import ActionMenuItem from './ActionMenuItem.vue'
import { AppearanceType, uniqueId } from '@opencloud-eu/design-system/helpers'
import type { ActionOptions } from '../../composables'
import type { MenuSectionDrop } from './ContextActionMenu.vue'
import { MenuSectionDrop } from './types'
Copy link

Copilot AI Jun 24, 2025

Choose a reason for hiding this comment

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

[nitpick] Since MenuSectionDrop is only used as a TypeScript type, consider using import type { MenuSectionDrop } from './types' to clarify that this import will be erased at runtime.

Suggested change
import { MenuSectionDrop } from './types'
import type { MenuSectionDrop } from './types'

Copilot uses AI. Check for mistakes.
const { menuSectionDrop, appearance, actionOptions } = defineProps<{
menuSectionDrop: MenuSectionDrop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,10 @@
<script lang="ts">
import { defineComponent, PropType } from 'vue'
import ActionMenuItem from './ActionMenuItem.vue'
import { Action, ActionOptions } from '../../composables'
import { ActionOptions } from '../../composables'
import { AppearanceType } from '@opencloud-eu/design-system/helpers'
import ActionMenuDropItem from './ActionMenuDropItem.vue'
export type MenuSectionDrop = {
label: string
name: string
icon: string
items?: Action[]
emptyMessage?: string
}
export type MenuSection = {
name: string
items?: Action[]
dropItems?: MenuSectionDrop[]
}
import { MenuSection } from './types'
Copy link

Copilot AI Jun 24, 2025

Choose a reason for hiding this comment

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

[nitpick] This import brings in a TypeScript-only type; switching to import type { MenuSection } from './types' can prevent accidental value imports and clarify intent.

Suggested change
import { MenuSection } from './types'
import type { MenuSection } from './types'

Copilot uses AI. Check for mistakes.
export default defineComponent({
name: 'ContextActionMenu',
Expand Down
1 change: 1 addition & 0 deletions packages/web-pkg/src/components/ContextActions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export { default as ActionMenuItem } from './ActionMenuItem.vue'
export { default as ContextActionMenu } from './ContextActionMenu.vue'
export { default as ContextMenuQuickAction } from './ContextMenuQuickAction.vue'
export { default as ActionMenuDropItem } from './ActionMenuDropItem.vue'
export * from './types'
Copy link

Copilot AI Jun 24, 2025

Choose a reason for hiding this comment

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

[nitpick] To make it explicit that only types are being re-exported, you could use export type { MenuSection, MenuSectionDrop } from './types' if your TS version supports it.

Suggested change
export * from './types'
export type { MenuSection, MenuSectionDrop } from './types'

Copilot uses AI. Check for mistakes.
15 changes: 15 additions & 0 deletions packages/web-pkg/src/components/ContextActions/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Action } from '../../composables'

export type MenuSectionDrop = {
label: string
name: string
icon: string
items?: Action[]
emptyMessage?: string
}

export type MenuSection = {
name: string
items?: Action[]
dropItems?: MenuSectionDrop[]
}
3 changes: 2 additions & 1 deletion packages/web-pkg/src/components/FilesList/ContextActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script lang="ts">
import ContextActionMenu, { MenuSection } from '../ContextActions/ContextActionMenu.vue'
import ContextActionMenu from '../ContextActions/ContextActionMenu.vue'
import { computed, defineComponent, PropType, Ref, toRef, unref } from 'vue'
import {
ActionExtension,
Expand Down Expand Up @@ -32,6 +32,7 @@ import {
} from '../../composables'
import { isNil } from 'lodash-es'
import { useGettext } from 'vue3-gettext'
import { MenuSection } from '../ContextActions'

export default defineComponent({
name: 'ContextActions',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ActionMenuDropItem from '../../../../src/components/ContextActions/ActionMenuDropItem.vue'
import { Action } from '../../../../src/composables/actions'
import { defaultPlugins, mount } from '@opencloud-eu/web-test-helpers'
import { MenuSectionDrop } from '../../../../src/components/ContextActions/ContextActionMenu.vue'
import { MenuSectionDrop } from '../../../../src/components/ContextActions'

describe('ActionMenuDropItem component', () => {
it('renders drop menu with actions', () => {
Expand Down