Skip to content

feat: add asset url for file attachment's press event emitter#1637

Merged
santhoshvai merged 5 commits intodevelopfrom
santhosh/add-file-attachment-additional-info
Aug 11, 2022
Merged

feat: add asset url for file attachment's press event emitter#1637
santhoshvai merged 5 commits intodevelopfrom
santhosh/add-file-attachment-additional-info

Conversation

@santhoshvai
Copy link
Copy Markdown
Member

@santhoshvai santhoshvai commented Aug 11, 2022

🎯 Goal

Adds support for listening to assetUrls in the fileAttachment onPress listeners.

πŸ›  Implementation details

NA

🎨 UI Changes

NA

πŸ§ͺ Testing

NA

β˜‘οΈ Checklist

  • I have signed the Stream CLA (required)
  • PR targets the develop branch
  • Documentation is updated
  • New code is tested in main example apps, including all possible scenarios
    • SampleApp iOS and Android
    • Expo iOS and Android

@santhoshvai santhoshvai marked this pull request as draft August 11, 2022 06:03
@santhoshvai santhoshvai marked this pull request as ready for review August 11, 2022 06:37
@aharwood9
Copy link
Copy Markdown
Contributor

Hi πŸ‘‹ Firstly, thanks for picking up my support ticket. After testing this locally myself, I found myself needing more props from the attachment i.e. mime-type.

Would it be possible to do something like this -

Within Message.tsx -

export type FileAttachmentTouchableHandlerPayload = {
  emitter: 'fileAttachment';
  additionalInfo?: { attachment?: Attachment };
};

export type TouchableHandlerPayload = {
  defaultHandler?: () => void;
  event?: GestureResponderEvent;
} & (
  | {
      emitter?: TouchableEmitter;
    }
  | TextMentionTouchableHandlerPayload
  | UrlTouchableHandlerPayload
  | FileAttachmentTouchableHandlerPayload
);

and then within FileAttachment (but applied to each of the onPress's) -

onPress={(event) => {
        if (onPress) {
          onPress({
            additionalInfo: { attachment },
            defaultHandler: defaultOnPress,
            emitter: 'fileAttachment',
            event,
          });
        }
      }}

From my testing within the Sample App that gives me everything I need. Sorry for the extra request.

@santhoshvai santhoshvai self-assigned this Aug 11, 2022
@santhoshvai santhoshvai marked this pull request as draft August 11, 2022 09:04
@santhoshvai santhoshvai marked this pull request as ready for review August 11, 2022 09:28
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!Β  Β  Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Copy Markdown
Contributor

@madsroskar madsroskar left a comment

Choose a reason for hiding this comment

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

LGTM πŸ‘πŸ»

@santhoshvai santhoshvai merged commit 9df8e59 into develop Aug 11, 2022
@santhoshvai santhoshvai deleted the santhosh/add-file-attachment-additional-info branch August 11, 2022 13:27
This was referenced Aug 16, 2022
@vishalnarkhede
Copy link
Copy Markdown
Contributor

πŸŽ‰ This PR is included in version 4.15.0 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants