Home

JCU Web application framework

This is the (as of writing) current base of the modern web applications that creates the @jcu/spark package.

To make use of this, you can npm install @jcu/spark as long as you have your local NPM configured to point at the JCU Artifactory repository. If you haven't, follow the guide at:

https://secure.jcu.edu.au/confluence/x/X6TCB

Still lacking many features, but we're adding to this all the time. Some content might eventually be broken out into their own packages, and we may re-use Lerna to deploy the packages.

Development

If you'd like to contribute, Jenkins will automatically build all branches. Creating a pull request to the default branch will trigger a build that will publish a pre- release package with the pull request number.

Merge a pull request into the default branch to trigger a release build. You'll be prompted to choose a version bump level.





Future Work / TODOs

In lieu of a better place to put todo items, here's a list. Feel free to add stuff here. Use:

[ ] for an un-ticked checkbox
[x] for a ticked checkbox



Seems Worth Doing

  • [ ] the await in getData in ApiInterface.js is making it impossible to catch 404 errors, switch it all to Promise handling
  • [ ] framework-ify a windowSizes array like in Profile app's src/shared.js, used to define narrow / medium / wide screen sizes. Maybe these are theme-definable?
  • [ ] add some window size utility functions like ifNarrow(value_if_narrow, value_otherwise)
    • this is useful if your DisplayWhen is doing the same Box but with direction="column"
    • also ifMedium, ifWide
    • alternatively, ifSize('N', value_if_narrow, value_otherwise) ?
      • so ifSize('NM', 'a', 'b') returns 'a' if it's narrow or medium
    • maybe they're static funcs attached to DisplayWhen?
  • [ ] make useThemeStyle understand grommet colours
  • [ ] make ThemedGrommet component that gets theme from config?
  • [ ] change Header to use useThemeStyle hook
  • [ ] move EditableText component from profile app into framework. consider changing the X cancel-edit button to use a circle-diagonal-slash icon
  • [ ] re-do early theming efforts to use the custom useThemeStyle hook
  • [ ] make a draft theme for showing early designs to users
  • [ ] add docs for how to get the url from a API Interface (this.config.url) also mention that you shouldn't need to
  • [ ] environment header should heuristically guess the prod url -- apps-test -> apps would get almost all of them
  • [ ] add better warnings for when API manager can't find config for an API. Typos are very common here when beginning a project
  • [ ] Handle time drift errors in OIDC (iat, nbf, and exp drift)



On Hold

  • [ ] storage manager check if storage is working (put on hold, oidc lib dies anyway)



Done

  • [x] add a not property to DisplayWhen
  • [x] add a delay(secs, value) function to ApiInterface for mocking up stuff