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

Question library #675

Open
jenbutongit opened this issue Oct 7, 2021 · 1 comment
Open

Question library #675

jenbutongit opened this issue Oct 7, 2021 · 1 comment

Comments

@jenbutongit
Copy link
Contributor

jenbutongit commented Oct 7, 2021

Is your feature request related to a problem? Please describe.
Canned questions for your convenience! Yeehaw.

There have been several requests for a way to load up previously created questions, commonly asked questions/commonly used patterns such as "What is your name". As well as lists, such as countries or nationality. It could be a great way to share and try out content.

This feature could populate components, pages or lists.

Describe the solution you'd like

I think eventually we'd like this to be an API where all departments can submit, share and use these prebuilt questions. It will also allow them to be updated or "dynamic" if necessary. For now, let's load these up via JSON in the designer (server or client).

proposed JSON

{
  "author": "jen",
  "title": "FCDO patterns across different projects",
  "patterns": [
    {
      "title": "Eligibility",
      "description": "Commonly used components across FCDO's prove your eligibility services currently in beta.",
      "tags": [],
      "page": [
        /**
         * as you would usually define a page. These must be standalone pages (not linking to others)
         */
        {
          "title": "",

          /**
           * components here should be considered "private", since they should not be used out of context
           * or without other components. These components should not have a metadata object
           * so that they are not searchable.
           */
          "components": [],

          /**
           * some additional information and context so that this page can be searchable and for a user to be 
           * able to decide whether or not this page would be suitable for their use.
           */
          "metadata": {
            "description": "Some description of the page",
            "tags": []
          },
        }
      ],
      component: [
        /**
         * Standalone components that can be added to a page.
         * if it is a component that requires a list, it must be defined in the lists property
         */
        {
          "options": {},
          "list": "nationality",
          "type": "AutocompleteField",
          "name": "nationality",
          "title": "What is your nationality",
          "schema": {},
          "metadata": {
            "description": "This is how FCDO ask for a user's nationality",
            "tags": ["nationality", "country", "fcdo"]
          },
        }
      ]
    },
    { 
      "title": "FCDO's assistance patterns"
    }
  ],
  "lists": [{
    "name": "nationality",
    "title": "Nationality",
    "type": "string",
    "items": [
    ],
    "metadata": {
      "description": "Nationalities list provided by FCDO, last updated..",
      "tags": ["fcdo", "nationalities", "nationality"]
    },
  }],
  "schemaVersion": 2 
}

We could add these as a separate monorepo, or within the designer itself. The path of least friction would be to add it to the app. I'd like departments/orgs/teams to submit their own of the above to this repo and we can find a new home for them if we need to. in the patterns directory.

In the designer UI, when adding a new page or component, it could give you an option to fill from pattern. If there are any path or name clashes, a nanoid can be generated to prevent these clashes and a resultant joi schema validation error.

Later down the line we can add functionality to "save as pattern" or "save to pattern"

Describe alternatives you've considered

Additional context

@jenbutongit
Copy link
Contributor Author

paging @superafroman

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

No branches or pull requests

1 participant