Skip to content

Update 'spo page control get' to retrieve dynamicData properties #750

@mpowney

Description

@mpowney

Summary

Two new JSON properties are added to ClientSideWebpartData when a web part has dynanicData enabled properties.

The example below JSON is an extract of the ClientSideWebpartData object when there are 10 dynamicData enabled properties added to it. The first (index 0) has been attached to a dynamic data source, the remaining nine (index 1 through 9) have not been attached, and have blank values in statically defined dynamic data values:

(Note: the property names 'dynamicPropertyX' are selected by the web part developer; they are not system generated)

{  
   "id":"342dfde7-7188-44c8-93b0-0d7f44eb6b81",
   "instanceId":"ca82ce06-b188-463b-b775-3671214cf1dd",
   "title":"HelloWorld",
   "description":"HelloWorld description",
   "serverProcessedContent":{  
      "htmlStrings":{  

      },
      "searchablePlainTexts":{  

      },
      "imageSources":{  

      },
      "links":{  

      }
   },
   "dynamicDataPaths":{  
      "dynamicProperty0":"WebPart.2bacb933-9f9d-457f-bfa5-b00bfc9cd625.69800bc3-0d7c-495c-a5b6-3423f226d5c5:queryText"
   },
   "dynamicDataValues":{  
      "dynamicProperty1":"",
      "dynamicProperty2":"",
      "dynamicProperty3":"",
      "dynamicProperty4":"",
      "dynamicProperty5":"",
      "dynamicProperty6":"",
      "dynamicProperty7":"",
      "dynamicProperty8":"",
      "dynamicProperty9":""
   },
   "dataVersion":"1.0",
   "properties":{  
   }
}

Current behaviour

Currently the spo page control get command exposes the following properties:

  • canvasDataVersion
  • controlData
  • dataVersion
  • description
  • htmlProperties
  • id
  • order
  • propertieJson
  • serverProcessedContent
  • title
  • webPartId

Additional behaviour

Add the following properties to spo page control get output:

  • dynamicDataPaths (optional)
  • dynamicDataValues (optional)

To Do

  • Update the ClientSideWebpart class in ./src/o365/spo/commands/page/clientsidepages.ts
  • Update output of spo page control get to confirm new properties are exposed when the web part supports dynamic data
  • Regression test any other commands with dependency on ClientSideWebpart class

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions