Closed milanholemans closed 3 months ago
good suggestion. Looks ok to me 👍
one question. Is the color
now maybe present as part of the response from the API? if so we could also update the command output in the folder add
docs
good suggestion. Looks ok to me 👍 one question. Is the
color
now maybe present as part of the response from the API? if so we could also update the command output in thefolder add
docs
Haven't played with it much yet, but as far as I know, this value is not included in the folder properties, so I don't think it's included in the response. I was thinking we should maybe somehow update spo folder get
to return the folder color as well. But this means an extra API request.
Ok seems like I found a way to create a folder with a color in 1 API request, same with renaming a folder. I'll split this issue into two.
Ok seems like I found a way to create a folder with a color in 1 API request, same with renaming a folder. I'll split this issue into two.
good call. it will be easier to handle
Specs updated.
Nice one, specs look clear to me!
Can I work on this?
Thank you @MathijsVerbeeck
The idea is to add some options to set the color of a folder in SharePoint.
Commands to update
spo folder add
Options to add
--color [color]
Remarks:
color
, consider the following: Color0
yellow
1
darkRed
2
darkOrange
3
darkGreen
4
darkTeal
5
darkBlue
6
darkPurple
7
darkPink
8
darkGrey
9
lightRed
10
lightOrange
11
lightGreen
12
lightTeal
13
lightBlue
14
lightPurple
15
lightPink
Examples
Create a folder with a dark blue look
Create a folder with a light teal look
Technical approach
Let's change the current API since it doesn't allow us to stamp the color of a folder. Changing to the API below doesn't change the output generated, so it's not a breaking change. Setting the folder color is easy, you just have to set the
ColorHex
field to a number between 0-15.Notice that this API only works when a color is specified. We could either stick with the old API when no color is specified, or we can just pass
0
with the new API to stamp the folder color "yellow".