mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-11-03 20:48:07 +00:00 
			
		
		
		
	chore: Update inbox view context menu (#12090)
# Pull Request Template ## Description This PR updates the inbox view context menu to use the existing conversation card context menu for consistency. ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? ### Screenshots **Before** <img width="395" height="257" alt="image" src="https://github.com/user-attachments/assets/88620d0c-99b4-480d-a9c3-89b78907dfc6" /> <img width="395" height="257" alt="image" src="https://github.com/user-attachments/assets/e42523ba-f880-47c6-b3a0-131ffa41fb1b" /> **After** <img width="395" height="257" alt="image" src="https://github.com/user-attachments/assets/13cf7528-2c37-4077-9e66-7bd0e53df0d5" /> <img width="395" height="257" alt="image" src="https://github.com/user-attachments/assets/8558f574-ef33-4b58-b0f7-fbddbcefe200" /> ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [ ] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --------- Co-authored-by: Pranav <pranavrajs@gmail.com>
This commit is contained in:
		@@ -63,11 +63,12 @@ const lastActivityAt = computed(() => {
 | 
				
			|||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const menuItems = computed(() => [
 | 
					const menuItems = computed(() => [
 | 
				
			||||||
  { key: 'delete', label: t('INBOX.MENU_ITEM.DELETE') },
 | 
					 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    key: isUnread.value ? 'mark_as_read' : 'mark_as_unread',
 | 
					    key: isUnread.value ? 'mark_as_read' : 'mark_as_unread',
 | 
				
			||||||
 | 
					    icon: isUnread.value ? 'mail' : 'mail-unread',
 | 
				
			||||||
    label: t(`INBOX.MENU_ITEM.MARK_AS_${isUnread.value ? 'READ' : 'UNREAD'}`),
 | 
					    label: t(`INBOX.MENU_ITEM.MARK_AS_${isUnread.value ? 'READ' : 'UNREAD'}`),
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					  { key: 'delete', icon: 'delete', label: t('INBOX.MENU_ITEM.DELETE') },
 | 
				
			||||||
]);
 | 
					]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const messageClasses = computed(() => ({
 | 
					const messageClasses = computed(() => ({
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -246,7 +246,7 @@ onMounted(() => {
 | 
				
			|||||||
          :key="notificationItem.id"
 | 
					          :key="notificationItem.id"
 | 
				
			||||||
          :inbox-item="notificationItem"
 | 
					          :inbox-item="notificationItem"
 | 
				
			||||||
          :state-inbox="stateInbox(notificationItem.primaryActor?.inboxId)"
 | 
					          :state-inbox="stateInbox(notificationItem.primaryActor?.inboxId)"
 | 
				
			||||||
          class="inbox-card rounded-lg hover:rounded-lg hover:bg-n-alpha-1 dark:hover:bg-n-alpha-3"
 | 
					          class="inbox-card rounded-none hover:rounded-lg hover:bg-n-alpha-1 dark:hover:bg-n-alpha-3"
 | 
				
			||||||
          :class="
 | 
					          :class="
 | 
				
			||||||
            currentConversationId === notificationItem.primaryActor?.id
 | 
					            currentConversationId === notificationItem.primaryActor?.id
 | 
				
			||||||
              ? 'bg-n-alpha-1 dark:bg-n-alpha-3 rounded-lg active'
 | 
					              ? 'bg-n-alpha-1 dark:bg-n-alpha-3 rounded-lg active'
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,32 +1,27 @@
 | 
				
			|||||||
<script>
 | 
					<script setup>
 | 
				
			||||||
import ContextMenu from 'dashboard/components/ui/ContextMenu.vue';
 | 
					import ContextMenu from 'dashboard/components/ui/ContextMenu.vue';
 | 
				
			||||||
import MenuItem from './MenuItem.vue';
 | 
					import MenuItem from 'dashboard/components/widgets/conversation/contextMenu/menuItem.vue';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					defineProps({
 | 
				
			||||||
  components: {
 | 
					  contextMenuPosition: {
 | 
				
			||||||
    MenuItem,
 | 
					    type: Object,
 | 
				
			||||||
    ContextMenu,
 | 
					    default: () => ({}),
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  props: {
 | 
					  menuItems: {
 | 
				
			||||||
    contextMenuPosition: {
 | 
					    type: Array,
 | 
				
			||||||
      type: Object,
 | 
					    default: () => [],
 | 
				
			||||||
      default: () => ({}),
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    menuItems: {
 | 
					 | 
				
			||||||
      type: Array,
 | 
					 | 
				
			||||||
      default: () => [],
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  emits: ['close', 'selectAction'],
 | 
					 | 
				
			||||||
  methods: {
 | 
					 | 
				
			||||||
    handleClose() {
 | 
					 | 
				
			||||||
      this.$emit('close');
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    onMenuItemClick(key) {
 | 
					 | 
				
			||||||
      this.$emit('selectAction', key);
 | 
					 | 
				
			||||||
      this.handleClose();
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const emit = defineEmits(['close', 'selectAction']);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const handleClose = () => {
 | 
				
			||||||
 | 
					  emit('close');
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const onMenuItemClick = key => {
 | 
				
			||||||
 | 
					  emit('selectAction', key);
 | 
				
			||||||
 | 
					  handleClose();
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -37,12 +32,14 @@ export default {
 | 
				
			|||||||
    @close="handleClose"
 | 
					    @close="handleClose"
 | 
				
			||||||
  >
 | 
					  >
 | 
				
			||||||
    <div
 | 
					    <div
 | 
				
			||||||
      class="bg-n-alpha-3 backdrop-blur-[100px] w-40 py-2 px-2 outline outline-1 outline-n-container shadow-lg rounded-xl"
 | 
					      class="p-1 rounded-md shadow-xl bg-n-alpha-3/50 backdrop-blur-[100px] outline-1 outline outline-n-weak/50"
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
      <MenuItem
 | 
					      <MenuItem
 | 
				
			||||||
        v-for="item in menuItems"
 | 
					        v-for="item in menuItems"
 | 
				
			||||||
        :key="item.key"
 | 
					        :key="item.key"
 | 
				
			||||||
        :label="item.label"
 | 
					        :option="item"
 | 
				
			||||||
 | 
					        variant="icon"
 | 
				
			||||||
 | 
					        class="!w-48"
 | 
				
			||||||
        @click.stop="onMenuItemClick(item.key)"
 | 
					        @click.stop="onMenuItemClick(item.key)"
 | 
				
			||||||
      />
 | 
					      />
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user