Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

form should be its own category #336

Closed
cpgruber opened this issue Aug 26, 2020 · 9 comments
Closed

form should be its own category #336

cpgruber opened this issue Aug 26, 2020 · 9 comments

Comments

@cpgruber
Copy link
Contributor

form category is needed to display surveys in correct content view in hub

https://github.com/Esri/hub.js/blob/master/packages/common/src/categories.ts

const form: string[] = ["Form"];
@tomwayson
Copy link
Member

I agree as far as the content views are concerned, however, I want to verify that is true in the other places that `getCategory is used, for example in search:

https://github.com/Esri/hub.js/blame/722a931c95e351ba5539a63cd42c8d6b713c5eef/packages/search/src/ago/helpers/aggs/collection.ts#L16

https://github.com/Esri/hub.js/blame/163250e0bf6589b75f95ba775cc62ab5757418c4/packages/search/src/ago/helpers/format/format-item.ts#L46

Those were added by @pranavkulkarni - can whomever has taken over that code (@haoliangyu? @mikeringrose?) verify?

@tomwayson tomwayson added this to the Content views MVP milestone Aug 28, 2020
@cpgruber
Copy link
Contributor Author

I don't know what should go where or how. I do know that as long as content views are using getContent, which leans on getCategory, type:form needs to be considered as its own hubType either somewhere in hub.js or in the app.

@haoliangyu
Copy link
Member

The dataset categories are also displayed on the search page and the content library. Having a new category should not create any trouble, except for new icon and a11n string. But I will leave the judgement to @thomas-hervey.

@thomas-hervey
Copy link

@haoliangyu @cpgruber perhaps I'm missing something, but do you mean form should be its own collection? categories.ts appears to be collections with an array of content types, not org or group categories. I think to follow our collection pattern, there should be a collection called 'feedback' with 'form' as an array value. In

@haoliangyu
Copy link
Member

@thomas-hervey right, category is the old name for collection.

@tomwayson
Copy link
Member

Thanks for weighing in @haoliangyu and @thomas-hervey.

Using 'feedback' as the hubTypefor items oftype: 'form'` makes sense to me. I'm also pretty sure I've come across

What do you think @cpgruber?

@cpgruber
Copy link
Contributor Author

@tomwayson I don't really have an opinion on the matter as I haven't spent much time around these here parts.

@tomwayson
Copy link
Member

@haoliangyu @thomas-hervey here's my plan:

  1. introduce a new fn called getCollection(), which will work just like getCategory() only it will return feedback for type: 'Form'
  2. getContent() and related fns will call getCollection()
  3. leave getCategory() as is, but mark it as deprecated

That way the parts of the app that use getCategory() can move over to getCollection() on their own terms (i.e. not necessarily force them to deal w/ feedback at this time.

LMK if that sounds good.

@haoliangyu
Copy link
Member

@tomwayson Looks good to me. Thanks for making the plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants