* Migrate admin/blink.html to SPA
Add implementations of the three new API routes
Remove old code for templated admin/blink.html
* Remove old handler and template
* start of tests
* fix tests
* temp
* separate into smaller elements
* add more python tests
* fix lint for optional values
* add tests
* fix lint error
* update model names
* use global
* fix test
* fix jsdoc from renaming
* address feedback
* Generate new routes for admin/blink.html
GET /componentsusers - The getter function that list all components and possible users and whether they are owners or just subscribed
PUT /components/{componentId}/users/{userId} - Add a user to a component
DELETE /components/{componentId}/users/{userId} - Remove a user from a component
* remove redundant components
* update names
* Manual changes to support using openapi
.devcontainer/Dockerfile
- Install java in devcontainer
.devcontainer/devcontainer.json
- Make devcontainer automatically install VSCode OpenAPI plugin mentioned in #2769
- Make devcontainer automatically install VSCode plugin for Lit
client-src/elements/chromedash-app.js
- Use the generated client in the frontend.
- Leverage lit-labs/context to provide the client.
- Docs about context and use-cases: https://lit.dev/docs/data/context/
client-src/elements/chromedash-app_test.js
- Add tests for the changes in client-src/elements/chromedash-app.js
client-src/contexts/openapi-context.js
- Declare a context for the openapi client.
framework/basehandlers.py
- add do_put function. previously, all other HTTP verbs had a `do_<verb>` version except PUT.
- Add put function that uses defensive_jsonify. This enables XSSI for PUT requests.
- This needed change is safe to do because the only route using PUT is the admin/blink page which I am migrating into the SPA.
gulpfile.babel.js
- Fix usage of rollupBabel. Previously, @rollup/plugin-node-resolve's default export was named rollupBabel. Which is the wrong package. Fixed to use @rollup/plugin-babel
- Using the correct parameters to rollupBabel from https://www.npmjs.com/package/@rollup/plugin-babel
- Add client-src/contexts/*.js to lint and watch targets
- Add custom onwarn for rollup that comes from using the generated frontend code. Check comment for explanation
package.json
- Add lit-labs/context. Needed for changes in client-src/contexts/openapi-context.js
- Tell NPM to use the generated javascript changes via the `workspaces` key.
- Instead of adding as a dependency like [I initially did here](ccd5c8e71b (diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R101)), rather keep the "dependencies" only for ones pulled from npm remotely.
- workspaces are meant more for packages that comes from the filesystem
- Docs: https://docs.npmjs.com/cli/v9/using-npm/workspaces?v=true
requirements.txt
- Tell pip to install the python package.
package-lock.json
- Generated changes from adding context and workspaces.
* revert accidental Werkzeug upgrade
* fix devcontainer
* Remove context & failed attempt at global
changes:
- Remove the context
- Move the openapi client to js-src
- modify gulp task to:
- ignore the test file
- add the openapi-client to the rollup task instead of the js task since it is a es6 module (because it has an import / require statement)
- Attempt to construct the object in the spa template. It failed to work at load time. More details below:
When trying to call my exported class at page load like the regular client, I get a not defined error.
There are thoughts about this:
- https://stackoverflow.com/a/75026222
- https://stackoverflow.com/a/53630402
- https://stackoverflow.com/a/69888825
This commit serves as an attempt to try it out
Turns out, script type "module" is automatically set to defer and cannot be disabled.
* add new rollup for cjs for openapi client
* add more tests
* fix middleware
* Add initial api.yaml and generated code
Manual changes:
- api.yaml: All the necessary fields to have a valid api.yaml.
- package.json: add `openapi`, `openapi-frontend` and `openapi-backend` scripts. Add @openapitools/openapi-generator-cli as a dependency to do the generation of the code. add gen/ folder to mypy exclusion
- .github/workflows/ci.yml: add gen/ folder to mypy exclusion
Generated changes:
- openapitools.json: Made by openapi-generator-cli on initial generate so that subsequent generation use the same pinned version of the JAR.
- gen/*: The generated code
- package-lock.json: Updated because I added the new devDependency
* use modular openapi file pattern
* add validate cmd & simplify paths file ref
* Add OpenAPI documentation
Changes:
- README.md - Update mention that java is needed both the Datastore emulator (existing dependency) and now openapi-generator-cli
- developer-documentation.md - Add section about adding a new API with example
- openapi-documentation.md - Add documentation about openapi. Maintenance expectations. Explanation of each additional property.
* address feedback from @jrobbins
* remove format field
* update docs with modular openapi files
* simplify paths file ref
* Update developer-documentation.md
* Remove redundant components
* Hacky implementation of beforeunload for SPA.
* Correct impl, except for Submit and Cancel buttons
* More changes to handle submit button
* Add check that we are on the same page after the submit timeout
* Simplify beforeunload and form submit handling.
* update accuracy verification for multiple stages
* Update guide.py to only change fields in form
* fix touched tests
* changes suggested by @jrobbins
* Enable all gates and add reviewers.
* Update approval_defs.py
Add type annotation
* Update core_enums.py
There's no need for all the reviews when shipping something that is just a code change.
* Hide edit button on feature page for enterprises
* After creating an enterprise feature go to the edit all page at the first rollout section
* Open all section on the feature page for enterprise by default
* Adding stage for enterprise features only adds rollout feature
* Remove the action of setting a stage in enterprise features
* Update scrolling behavior to scroll to the element from the hash if no form field is found
* Remove the edit icon from the feature page that navigates to the edit page
* Add an id to the "edit all" section headers to serve as an anchor for navigations