fauxcoding / pickles

A simple gherkin editor for the Azure DevOps work item form
MIT License
1 stars 2 forks source link

How to properly add to TFS 2017? "Failed to load Pickles-heymega." #2

Open helldemon13 opened 3 years ago

helldemon13 commented 3 years ago

How to properly add to TFS 2017? I created <FIELD name="PicklesField" refname="Microsoft.VSTS.Common.PicklesField" type="HTML" />. I also tried it with the Plain Text type. Added to the form

<Extensions>
<Extension Id="heymega.Pickles" />
</Extensions>

and

<ControlContribution Label="PicklesField" Id="heymega.Pickles.sample-work-item-form-control">
<Inputs>
<Input Id="PicklesInput" Value="Microsoft.VSTS.Common.PicklesField" />
</Inputs>
</ControlContribution>

When loading a work item, an error appears in this field: "Failed to load Pickles-heymega."

FokkoVeegens commented 11 months ago

Although the question is old, maybe my answer helps others;

Field

The field definition (child of <FIELDS>) should be:

<FIELD name="PicklesField" refname="YourCompany.PicklesField" type="PlainText" />

Where you would replace YourCompany with a relevant replacement.

Extension

This should be as indicated above:

<Extensions>
   <Extension Id="heymega.Pickles" />
</Extensions>

This code should be placed right below this code:

        <!--**********************Work Item Extensions**********************

Extension:
  Name: Pickles
  Id: heymega.Pickles

  Control contribution:
    Id: heymega.Pickles.sample-work-item-form-control
    Description: Gherkin editor form control
    Inputs:
      Id: PicklesInput
      Description: Reference name of a string field to be updated.
      Type: WorkItemField
      Data Type: String
      IsRequired: true

Note: For more information on work item extensions use the following topic:
http://go.microsoft.com/fwlink/?LinkId=816513
-->

Form control

The control on the form should be put inside the Page > Section > Group structure as a child of <WebLayout>. This is an example, where the control will appear on a separate tab in the Work Item. The name of the tab will be "Gherkin":

<Page Label="Gherkin" Id="Gherkin">
   <Section>
      <Group Label="Gherkin" Id="Gherkin">
         <ControlContribution Label="PicklesField" Id="heymega.Pickles.sample-work-item-form-control">
            <Inputs>
               <Input Id="PicklesInput" Value="YourCompany.PicklesField" />
            </Inputs>
         </ControlContribution>
      </Group>
   </Section>
</Page>

Again, don't forget to replace YourCompany with something appropriate for your situation.