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

Added column sample generic-published-version #850

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mkacena
Copy link

@mkacena mkacena commented Sep 29, 2024

Q A
Bug fix? no
New sample? yes
Related issues?

What's in this Pull Request?

Added new sample generic-published-version.

This sample creates a button for downloading the currently published version of a document. The sample is supposed to be used in a SharePoint Online document library with minor versions enabled. Button is displayed for every document with a published version, i.e., version at least 1.0. It is linked to the latest published version of the document - for example, if the latest draft of the document is at version 2.6, the button downloads version 2.0.

@tecchan1107 tecchan1107 self-assigned this Sep 29, 2024
@tecchan1107
Copy link
Collaborator

Hi @mkacena . Thank you for sharing this awesome sample! I didn’t know it was possible to open a specific version of a file this way—very cool!

After trying it out, I had one point of concern regarding the "Download" button.

I thought clicking the button would download the file, but when I clicked it, it did not download, but opened the specified version of the file. Therefore, I felt a little uncomfortable with the button labeled "Download"...

If you agree with this, how about replacing the label “Download” with some other letter? (e.g. Open Version XX.0)

⚠️ If you replace it, I am sorry, but you will need to modify the screenshots and README as well as the JSON.

@mkacena
Copy link
Author

mkacena commented Oct 2, 2024

Hi @tecchan1107 . Thank you for your feedback. Can I ask how did you manage to get the file open? This was actually my main concern - that it downloads files instead of opening them in browser or app. I have tried it in 2 different tenants with libraries of different settings, and different browsers (Firefox, Chrome), but it always downloaded the file. I would be actually happy if I could make it open the previous version instead of download.

@tecchan1107
Copy link
Collaborator

Can I ask how did you manage to get the file open?

I did not set anything in particular, but the file opened...

When I click the download button in my environment, I get the following behavior (sorry for the Japanese)

word

However, when I clicked on the Visio download button, the Visio file was downloaded.

visio

In my environment, I have desktop apps like Word, PowerPoint, and Excel installed, but the Visio desktop app is not installed.

Maybe the file is opened or downloaded depending on whether the target desktop app is installed or not...?

@tecchan1107
Copy link
Collaborator

For reference, if it is a PDF, the PDF was opened in a separate tab.

pdf

@mkacena
Copy link
Author

mkacena commented Oct 3, 2024

I see. Thank you, that was really helpful.

You use Microsoft Edge and it behaves differently from Firefox and Chrome. It asks whether to open file, and is able to open Word app directly with file stored in SharePoint.

I tried to make Firefox do the same and after adjusting settings for handling files, it now asks whether to open or save file. So I can open it "directly", but in fact the file is being downloaded and stored locally in Downloads folder.

Chrome was the "worst" in this case. I have spent hours trying to make it open Word files directly, but there is not even a setting as in Firefox, and the official Office extension does not work.

@tecchan1107 Anyway, do you still want me to update the sample as you suggested (rename to "Open Version XX.0")? Just a real-world experience: I had the button named "Open" at one customer, but users were using Chrome and the files were being downloaded so they complained about the name being misleading.

@tecchan1107
Copy link
Collaborator

Hi @mkacena !

You use Microsoft Edge and it behaves differently from Firefox and Chrome. It asks whether to open file, and is able to open Word app directly with file stored in SharePoint.

Yes. I usually use Microsoft Edge and was using Microsoft Edge when the above video was taken.

I tried to make Firefox do the same and after adjusting settings for handling files, it now asks whether to open or save file. So I can open it "directly", but in fact the file is being downloaded and stored locally in Downloads folder.

Chrome was the "worst" in this case. I have spent hours trying to make it open Word files directly, but there is not even a setting as in Firefox, and the official Office extension does not work.

I also tried a different browser and the file downloaded!
If possible, could you please add a note in the README that the behavior is different for each browser?

Anyway, do you still want me to update the sample as you suggested (rename to "Open Version XX.0")?

Hmmm, do you have any other suggestions...? I've been thinking for the past few days about what word would be appropriate for the button, as the file behaves differently when opened and saved in different browsers, but I couldn't come up with a good idea...

@mkacena
Copy link
Author

mkacena commented Oct 6, 2024

Hi @tecchan1107 ,
I don't have a better idea for the button's name. If you agree, I will update it as you suggested ("Open Version XX.0"). After all, it is a sample and people can update it for their environment as they see fit. I will also add a note about different behavior in different browsers.

@tecchan1107
Copy link
Collaborator

I don't have a better idea for the button's name. If you agree, I will update it as you suggested ("Open Version XX.0"). After all, it is a sample and people can update it for their environment as they see fit. I will also add a note about different behavior in different browsers.

I agree. Sorry, but please correct the code, screenshots, and README.

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.

2 participants