hub.js icon indicating copy to clipboard operation
hub.js copied to clipboard

Fetch content owner's full name as part of `getContent`

Open drewdaemon opened this issue 5 years ago • 4 comments

Getting an owner's full name requires an async request to the API to fetch the user object. Currently this work is being pushed into client applications. We should make it part of getContent so that they don't have to worry about it.

We can add an ownerFullName property to IContent that contains the owner's full name.

drewdaemon avatar Oct 26 '20 18:10 drewdaemon

I wonder if we need more than just the fullName. I know that @ajturner has talked about having owner be the user:

https://github.com/Esri/hub.js/pull/271/files#diff-4b9c55dbc42166a101bfc837cf8c396c86ef25d3b5ea84da12561004d0ebb2ceR55

We could have owner: string | IHubMember w/o it being a breaking change I think.

Early on I had advocated that IHubContent extend IItem, and since up until now we've been making that work might want to play it safe and introduce a new property like publisher: IHubMember

tomwayson avatar Oct 26 '20 18:10 tomwayson

For now in the Hub app we've added a ownerUser: IUser property to content and we are currently fetching it for all types.

tomwayson avatar Oct 27 '20 19:10 tomwayson

@tomwayson would now be a good time to push this into Hub.js?

drewdaemon avatar Jan 12 '21 21:01 drewdaemon

Sure. I guess we could.

tomwayson avatar Jan 12 '21 21:01 tomwayson