Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FieldNameRenderer missing features and other expected behaviors #116

Closed
ralftokada opened this issue Aug 26, 2018 · 5 comments
Closed

FieldNameRenderer missing features and other expected behaviors #116

ralftokada opened this issue Aug 26, 2018 · 5 comments
Milestone

Comments

@ralftokada
Copy link

ralftokada commented Aug 26, 2018

Category

[x] Enhancement

[x] Bug

[ ] Question

Version

v1.7.0

Expected / Desired Behavior / Question

I would like the FileNameRender control get the next behavior
-DoubleClick is not customizabled -I would like to get the same behavior of a single click achieved in the 1.7.0 version where the default behavior is suppressed
-Share and Show Action menus are gone, desired behavior will be to leave them at it comes unless a customization is possible
-Circle next to the Icon is selected when the link is clicked, default un-selected behavior is desired

Observed Behavior

Explained above

Steps to Reproduce

Install the 1.7.0 version and customize the render sub in the *.tsx file as follow

@OverRide
public render(): React.ReactElement<{}> {
return (
<FieldNameRenderer
text={"mylink"}
isLink={true}
filePath={null}
isNew={false}
hasPreview={false}
onClick={() => this.button_click()}
/>
);
}

public button_click(): any {
window.open("MyUrlHandlerProtocol:" + window.location.protocol + "//"

  • window.location.hostname + this.props.listItem.getValueByName("FileRef"),"_self");
    return "MyUrlHandlerProtocol:" + window.location.protocol + "//"
    + window.location.hostname + this.props.listItem.getValueByName("FileRef");
    }
    }

Submission Guidelines

  •  hasNew     option if it is not specified should detect if this is a new file and show the default new icon.
    
  •  hasPreview  do not know what this does, please explain
    

Thanks!

@estruyf
Copy link
Member

estruyf commented Sep 7, 2018

@AJIXuMuK can you take this one?

@estruyf estruyf added this to the 1.8.0 milestone Sep 7, 2018
@estruyf estruyf assigned estruyf and unassigned estruyf Sep 7, 2018
@AJIXuMuK
Copy link
Collaborator

AJIXuMuK commented Sep 7, 2018

Sorry, @estruyf. Lost the notification in email.

Hi @ralftokada.
Point by point :)

  • DoubleClick - I will be working on it to add ability to override double-click behavior.
  • Share and Show actions. It's really hard to do that. There is not problem to add the icons itself. But unfortunately, there is no way to initiate standard behavior. It means that it should be "duplicated". To my mind it's to complex and hard to maintain.
  • Circle next to item. If you click directly to the text, the row is not selected. So, the behavior is the same as it is for OOTB control. If you want to prevent selecting row when you click anywhere in the cell you need to add onclick event handler to event.domElement in your Field Customizer and stop propagation there.
  • isNew. The component itself is designed to information. It doesn't communicate to SharePoint directly to get properties. It should be done from the entity that is using the component. That's why there is FieldRendererHelper class that actually detects if the item is new:
isNew: SPHelper.getRowItemValueByName(listItem, 'Created_x0020_Date.ifnew') === '1'
  • hasPreview. I will need to update documentation on that one. Basically, this flag impacts on how the link is configured for the default behavior (if onClick is not provided): if hasPreview is set to false than the url will be equal to filePath property which will lead to direct download of the file; if hasPreview is set to true that the url will look like #id=${filePath}&parent=${filePath.substring(0, filePath.lastIndexOf('/'))} - it will notify core engine to show the preview when the link is clicked.

Let me know if the explanation makes sense of if you have any additional thoughts on that!
In a meanwhile I'll be working on double click and documentation for hasPreview flag.

@AJIXuMuK
Copy link
Collaborator

AJIXuMuK commented Sep 7, 2018

@estruyf please, assign it to me.

@ralftokada
Copy link
Author

Hi @AJIXuMuK
Great thanks, stopping the double click default behavior/propagation and execute it as the single customized click behavior will make a significant progress.
For me if hasPreview is set to true and notify the core engine to be displayed regardless of whether onClick is provided or not, this is the desired behavior.

Thanks again for keeping up with this development

AJIXuMuK added a commit to AJIXuMuK/sp-dev-fx-controls-react that referenced this issue Sep 11, 2018
@estruyf
Copy link
Member

estruyf commented Sep 12, 2018

Closing the issue as version 1.8.0 has just been released.

@estruyf estruyf closed this as completed Sep 12, 2018
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

No branches or pull requests

3 participants