-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix note linked text in timeline view (in dark mode) (#6944)
This PR Fixes #6942 Other improvements : - Fetch activities (note and task) title only when loading timeline, so we don't always have a clickable title. - Fixed IconButton width regression. --------- Co-authored-by: Lucas Bordeau <[email protected]>
- Loading branch information
1 parent
d1b4f85
commit 91187dc
Showing
10 changed files
with
107 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...ges/twenty-front/src/modules/activities/timelineActivities/hooks/useLinkedObjectsTitle.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular'; | ||
import { useCombinedFindManyRecords } from '@/object-record/multiple-objects/hooks/useCombinedFindManyRecords'; | ||
import { isNonEmptyArray } from '@sniptt/guards'; | ||
|
||
export const useLinkedObjectsTitle = (linkedObjectIds: string[]) => { | ||
const { loading } = useCombinedFindManyRecords({ | ||
skip: !isNonEmptyArray(linkedObjectIds), | ||
operationSignatures: [ | ||
{ | ||
objectNameSingular: CoreObjectNameSingular.Task, | ||
variables: { | ||
filter: { | ||
id: { | ||
in: linkedObjectIds ?? [], | ||
}, | ||
}, | ||
}, | ||
fields: { | ||
id: true, | ||
title: true, | ||
}, | ||
}, | ||
{ | ||
objectNameSingular: CoreObjectNameSingular.Note, | ||
variables: { | ||
filter: { | ||
id: { | ||
in: linkedObjectIds ?? [], | ||
}, | ||
}, | ||
}, | ||
fields: { | ||
id: true, | ||
title: true, | ||
}, | ||
}, | ||
], | ||
}); | ||
|
||
return { | ||
loading, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...nty-front/src/modules/activities/timelineActivities/types/TimelineActivityLinkedObject.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type TimelineActivityLinkedObject = 'note' | 'task'; |
12 changes: 12 additions & 0 deletions
12
.../modules/activities/timelineActivities/utils/filterTimelineActivityByLinkedObjectTypes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { TimelineActivity } from '@/activities/timelineActivities/types/TimelineActivity'; | ||
import { TimelineActivityLinkedObject } from '@/activities/timelineActivities/types/TimelineActivityLinkedObject'; | ||
|
||
export const filterTimelineActivityByLinkedObjectTypes = | ||
(linkedObjectTypes: TimelineActivityLinkedObject[]) => | ||
(timelineActivity: TimelineActivity) => { | ||
return linkedObjectTypes.some((linkedObjectType) => { | ||
const linkedObjectPartInName = timelineActivity.name.split('.')[0]; | ||
|
||
return linkedObjectPartInName.includes(linkedObjectType); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters