diff --git a/packages/server/src/utils/getChatMessage.ts b/packages/server/src/utils/getChatMessage.ts index 1e40e0681..57b835f9e 100644 --- a/packages/server/src/utils/getChatMessage.ts +++ b/packages/server/src/utils/getChatMessage.ts @@ -162,7 +162,7 @@ async function handleFeedbackQuery(params: { // First get session IDs with pagination const sessionQuery = appServer.AppDataSource.getRepository(ChatMessage) .createQueryBuilder('chat_message') - .select('DISTINCT chat_message.sessionId', 'sessionId') + .select('chat_message.sessionId', 'sessionId') .where('chat_message.chatflowid = :chatflowid', { chatflowid }) // Apply basic filters diff --git a/packages/ui/src/layout/MainLayout/Header/ProfileSection/index.jsx b/packages/ui/src/layout/MainLayout/Header/ProfileSection/index.jsx index a39bb5e1c..1e47faedd 100644 --- a/packages/ui/src/layout/MainLayout/Header/ProfileSection/index.jsx +++ b/packages/ui/src/layout/MainLayout/Header/ProfileSection/index.jsx @@ -101,7 +101,14 @@ const ExportDialog = ({ show, onCancel, onExport }) => { {!isExporting && ( - + {dataToExport.map((data, index) => ( { {hasPermission('templates:marketplace') && hasPermission('templates:custom') && ( - - - - + + + + + + setSelectedUsecases(newValue)} + disableCloseOnSelect + getOptionLabel={(option) => option} + isOptionEqualToValue={(option, value) => option === value} + renderOption={(props, option, { selected }) => { + const isDisabled = eligibleUsecases.length > 0 && !eligibleUsecases.includes(option) + + return ( +
  • + + +
  • + ) + }} + renderInput={(params) => } + sx={{ + width: 300 + }} + limitTags={2} + renderTags={(value, getTagProps) => { + const totalTags = value.length + const limitTags = 2 + + return ( + <> + {value.slice(0, limitTags).map((option, index) => ( + + ))} + + {totalTags > limitTags && ( + + {value.slice(limitTags).map((item, i) => ( +
  • {item}
  • + ))} + + } + placement='top' + > + +{totalTags - limitTags} +
    + )} + + ) + }} + slotProps={{ + paper: { + sx: { + boxShadow: '0 4px 12px rgba(0, 0, 0, 0.2)' + } + } + }} + /> +
    )} - - {usecases.map((usecase, index) => ( - { - setSelectedUsecases( - event.target.checked - ? [...selectedUsecases, usecase] - : selectedUsecases.filter((item) => item !== usecase) - ) - }} - sx={{ - '& .MuiSvgIcon-root': { - color: - eligibleUsecases.length === 0 || !eligibleUsecases.includes(usecase) - ? '#888 !important' - : undefined - } - }} - /> - } - label={usecase} - sx={{ - '& .MuiFormControlLabel-label': { - color: - eligibleUsecases.length === 0 || !eligibleUsecases.includes(usecase) - ? '#888 !important' - : undefined - } - }} - /> - ))} - - {selectedUsecases.length > 0 && ( - - )} - {!view || view === 'card' ? ( <> {isLoading ? (