Skip to content

Commit

Permalink
Add badges for configuration/acquisition properties
Browse files Browse the repository at this point in the history
  • Loading branch information
cjsha committed Oct 29, 2024
1 parent 1b858cd commit 430d4e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion template/ManagedReference.extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@ function processChildProperty(child, sharedModel) {
const enumFields = sharedModel[`~/api/${child.syntax.return.type.uid}.yml`]?.type === 'enum' ?
extractEnumData(sharedModel[`~/api/${child.syntax.return.type.uid}.yml`]) :
[];
const acquisition = child?.attributes.some(attribute => attribute.type === 'System.ComponentModel.CategoryAttribute' && attribute?.arguments[0].value === 'Acquisition');
const configuration = child?.attributes.some(attribute => attribute.type === 'System.ComponentModel.CategoryAttribute' && attribute?.arguments[0].value === 'Configuration');
return {
'name': child.name[0].value,
'type': child.syntax.return.type.specName[0].value,
'propertyDescription': {
'text': addCodeTag([child.summary, child.remarks].join('')),
'hasEnum': enumFields.length > 0,
'enum': enumFields,
}
},
'configuration': configuration,
'acquisition': acquisition
}
}

Expand Down
2 changes: 2 additions & 0 deletions template/partials/propertyTables.tmpl.partial
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<tr>
<td style = "white-space: nowrap;">
<code>{{{name}}}</code>
{{#acquisition}}<div style="padding-top: 0.5rem"><small class="mb-3 px-2 py-1 fw-semibold text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-2">acquisition</small></div>{{/acquisition}}
{{#configuration}}<div style="padding-top: 0.5rem"><small class="mb-3 px-2 py-1 fw-semibold text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2">configuration</small></div>{{/configuration}}
</td>
<td style = "white-space: nowrap;">
{{{type}}}
Expand Down

0 comments on commit 430d4e3

Please sign in to comment.