Skip to content

Commit

Permalink
Add AcceptableMediaTypes to organizationalBrandingProperties medi…
Browse files Browse the repository at this point in the history
…a stream properties (#471)

* Add acceptable media types

* Add input and output test data

* Remove unnecessary script
  • Loading branch information
irvinesunday authored Oct 25, 2023
1 parent be8ec06 commit d1bb282
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 0 deletions.
24 changes: 24 additions & 0 deletions transforms/csdl/preprocess_csdl.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,30 @@
</xsl:copy>
</xsl:template>

<!-- Add Acceptable Media Types -->
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='organizationalBrandingProperties']/edm:Property[@Name='backgroundImage']|
edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='organizationalBrandingProperties']/edm:Property[@Name='bannerLogo']|
edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='organizationalBrandingProperties']/edm:Property[@Name='customCSS']|
edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='organizationalBrandingProperties']/edm:Property[@Name='favicon']|
edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='organizationalBrandingProperties']/edm:Property[@Name='headerLogo']|
edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='organizationalBrandingProperties']/edm:Property[@Name='squareLogo']|
edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='organizationalBrandingProperties']/edm:Property[@Name='squareLogoDark']">
<xsl:copy>
<xsl:copy-of select="@* | node()" />
<Annotation Term="Org.OData.Core.V1.AcceptableMediaTypes">
<Collection>
<String>image/bmp</String>
<String>image/jpg</String>
<String>image/jpeg</String>
<String>image/gif</String>
<String>image/vnd.microsoft.icon</String>
<String>image/png</String>
<String>image/tiff</String>
</Collection>
</Annotation>
</xsl:copy>
</xsl:template>

<!-- Add odata cast annotation -->
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='group']/edm:NavigationProperty[@Name='members']|
edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='group']/edm:NavigationProperty[@Name='membersWithLicenseErrors']|
Expand Down
9 changes: 9 additions & 0 deletions transforms/csdl/preprocess_csdl_test_input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@
<EntityType Name="rbacApplication" BaseType="graph.entity">
<NavigationProperty Name="transitiveRoleAssignments" Type="Collection(graph.unifiedRoleAssignment)" ContainsTarget="true" />
</EntityType>
<EntityType Name="organizationalBrandingProperties" BaseType="graph.entity" Abstract="true">
<Property Name="backgroundImage" Type="Edm.Stream" />
<Property Name="bannerLogo" Type="Edm.Stream" />
<Property Name="customCSS" Type="Edm.Stream" />
<Property Name="favicon" Type="Edm.Stream" />
<Property Name="headerLogo" Type="Edm.Stream" />
<Property Name="squareLogo" Type="Edm.Stream" />
<Property Name="squareLogoDark" Type="Edm.Stream" />
</EntityType>
<Annotations Target="microsoft.graph.user/joinedGroups">
<Annotation Term="Org.OData.Capabilities.V1.ChangeTracking">
<Record>
Expand Down
93 changes: 93 additions & 0 deletions transforms/csdl/preprocess_csdl_test_output.xml
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,99 @@
</Annotation>
</NavigationProperty>
</EntityType>
<EntityType Name="organizationalBrandingProperties" BaseType="graph.entity" Abstract="true">
<Property Name="backgroundImage" Type="Edm.Stream">
<Annotation Term="Org.OData.Core.V1.AcceptableMediaTypes" xmlns:edm="http://docs.oasis-open.org/odata/ns/edm">
<Collection>
<String>image/bmp</String>
<String>image/jpg</String>
<String>image/jpeg</String>
<String>image/gif</String>
<String>image/vnd.microsoft.icon</String>
<String>image/png</String>
<String>image/tiff</String>
</Collection>
</Annotation>
</Property>
<Property Name="bannerLogo" Type="Edm.Stream">
<Annotation Term="Org.OData.Core.V1.AcceptableMediaTypes" xmlns:edm="http://docs.oasis-open.org/odata/ns/edm">
<Collection>
<String>image/bmp</String>
<String>image/jpg</String>
<String>image/jpeg</String>
<String>image/gif</String>
<String>image/vnd.microsoft.icon</String>
<String>image/png</String>
<String>image/tiff</String>
</Collection>
</Annotation>
</Property>
<Property Name="customCSS" Type="Edm.Stream">
<Annotation Term="Org.OData.Core.V1.AcceptableMediaTypes" xmlns:edm="http://docs.oasis-open.org/odata/ns/edm">
<Collection>
<String>image/bmp</String>
<String>image/jpg</String>
<String>image/jpeg</String>
<String>image/gif</String>
<String>image/vnd.microsoft.icon</String>
<String>image/png</String>
<String>image/tiff</String>
</Collection>
</Annotation>
</Property>
<Property Name="favicon" Type="Edm.Stream">
<Annotation Term="Org.OData.Core.V1.AcceptableMediaTypes" xmlns:edm="http://docs.oasis-open.org/odata/ns/edm">
<Collection>
<String>image/bmp</String>
<String>image/jpg</String>
<String>image/jpeg</String>
<String>image/gif</String>
<String>image/vnd.microsoft.icon</String>
<String>image/png</String>
<String>image/tiff</String>
</Collection>
</Annotation>
</Property>
<Property Name="headerLogo" Type="Edm.Stream">
<Annotation Term="Org.OData.Core.V1.AcceptableMediaTypes" xmlns:edm="http://docs.oasis-open.org/odata/ns/edm">
<Collection>
<String>image/bmp</String>
<String>image/jpg</String>
<String>image/jpeg</String>
<String>image/gif</String>
<String>image/vnd.microsoft.icon</String>
<String>image/png</String>
<String>image/tiff</String>
</Collection>
</Annotation>
</Property>
<Property Name="squareLogo" Type="Edm.Stream">
<Annotation Term="Org.OData.Core.V1.AcceptableMediaTypes" xmlns:edm="http://docs.oasis-open.org/odata/ns/edm">
<Collection>
<String>image/bmp</String>
<String>image/jpg</String>
<String>image/jpeg</String>
<String>image/gif</String>
<String>image/vnd.microsoft.icon</String>
<String>image/png</String>
<String>image/tiff</String>
</Collection>
</Annotation>
</Property>
<Property Name="squareLogoDark" Type="Edm.Stream">
<Annotation Term="Org.OData.Core.V1.AcceptableMediaTypes" xmlns:edm="http://docs.oasis-open.org/odata/ns/edm">
<Collection>
<String>image/bmp</String>
<String>image/jpg</String>
<String>image/jpeg</String>
<String>image/gif</String>
<String>image/vnd.microsoft.icon</String>
<String>image/png</String>
<String>image/tiff</String>
</Collection>
</Annotation>
</Property>
</EntityType>
<Annotations Target="microsoft.graph.user/joinedGroups">
<Annotation Term="Org.OData.Capabilities.V1.ChangeTracking">
<Record>
Expand Down

0 comments on commit d1bb282

Please sign in to comment.