sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Custom Command Set Customizer in Document Library Web Part

Open AJIXuMuK opened this issue 8 years ago • 15 comments

Category

  • [x] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Today I found custom Command Set in Document Library Web Part. It was displayed incorrectly - instead of title I see alias from manifest file.

I know that the web part in in preview and we can expect it to work incorrectly. But I'm just letting you know and additionally asking if you have any specific thought on when and what to expect.

Thanks!

Steps to Reproduce

  1. apply custom command set customizer to doc library
  2. display doc library in Document Library Web Part.

screen shot 2018-10-02 at 9 06 30 pm

AJIXuMuK avatar Oct 03 '18 04:10 AJIXuMuK

Can you provide the manifest.json file and your commandset TS file sample code?

vmiy avatar Nov 01 '18 06:11 vmiy

OK, so here is a full picture. Initial description was a bit incorrect: Document Library Web Part uses not alias from manifest but the Title of CustomAction from elements.xml. It's easy to reproduce:

  1. Scaffold OOTB Command Set with yo @microsoft/sharepoint
  2. Add CustomAction declaration into elements.xml to display command set in Document Library:
<CustomAction
        Title="DocLibTest"
        RegistrationId="101"
        RegistrationType="List"
        Location="ClientSideExtension.ListViewCommandSet.CommandBar"
        ClientSideComponentId="30d0a9a4-f3a6-4aef-9954-89a9034d22f5"
        ClientSideComponentProperties="{&quot;sampleTextOne&quot;:&quot;One item is selected in the list.&quot;, &quot;sampleTextTwo&quot;:&quot;This command is always visible.&quot;}">
    </CustomAction>
  1. After that you'll see DocLibTest button in Command Bar of Doc Library Web Part. Even more, in OOTB Command Set there are 2 commands, but only one button is added to the Command Bar.

Please, let me know if you need more details.

AJIXuMuK avatar Nov 08 '18 17:11 AJIXuMuK

Thx @AJIXuMuK, that's a strange implementation indeed and have been routed finally to right people. Sorry for the delay on the triage.

VesaJuvonen avatar Nov 20 '18 17:11 VesaJuvonen

Thanks @VesaJuvonen!

AJIXuMuK avatar Nov 20 '18 18:11 AJIXuMuK

we are looking into this issue and will provide update as soon as we can. Thank you

ahackettms avatar Dec 03 '18 23:12 ahackettms

The work to enable ListViewCommandSet in webpart is done and will be available to customer in mid-late January 2019.

ahackettms avatar Dec 21 '18 06:12 ahackettms

Will there be ability to check if the command set is displayed in web part or in regular list? Also will there be an API to get viewId in the web part? Currently I can get it from query string and/or pageContext. What about web part? There could be multiple web parts on the page.

AJIXuMuK avatar Dec 21 '18 06:12 AJIXuMuK

This feature should be enabled for customer now. Please give it a try. Thank you

ahackettms avatar Feb 04 '19 17:02 ahackettms

Hi @ahackettms! Thanks for the update! I quickly looked at the functionality and it looks like there are still issues. For example, icon for custom command set is not displayed. iconImageUrl in Command Set manifest is set to display an icon from Azure CDN. It works fine in Document library itself, but in the web part I'm getting

<img src="" class="ms-Image-image ms-Image-image--contain ms-Image-image--portrait is-notLoaded is-fadeIn is-error image-666">

src is not set.

AJIXuMuK avatar Feb 04 '19 17:02 AJIXuMuK

When the web part is added to a small zone command part is rendered with overlap screen shot 2019-02-04 at 9 38 58 am

AJIXuMuK avatar Feb 04 '19 17:02 AJIXuMuK

And, as I previously mentioned, it looks like there is no way to get viewId for the web part.

AJIXuMuK avatar Feb 04 '19 17:02 AJIXuMuK

@AJIXuMuK the icon issue was just fixed recently. Please allow another 1-2 weeks and try again. For the commandbar overlap issue in small webpart, @VesaJuvonen could you file a new issue for us to track that? it most likely a generic commandbar issue which is not related to client-side extensions.

For the ViewID issue, I don't think we have API supporting that. @VesaJuvonen feel free to Chime in

ahackettms avatar Feb 06 '19 19:02 ahackettms

Hi. Seems issue with icons steel exists. Currently I get this in both cases: if iconImageUrl has value and whet it's empty

<img src(unknown) class="ms-Image-image ms-Image-image--contain ms-Image-image--portrait is-notLoaded is-fadeIn is-error image-333">

Any suggestions?

vlad-nvs avatar Mar 01 '19 12:03 vlad-nvs

Checked current behavior - seems to be fixed.

AJIXuMuK avatar Sep 03 '21 16:09 AJIXuMuK

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

ghost avatar Sep 10 '21 18:09 ghost