-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(coder plugin): make template names optional (#103)
* wip: update type definitions and parsing logic for config values * refactor: update some code for clarity * fix: update property names in top-level config * wip: commit progress on link update * chore: finish updates for CreateWorkspaceLink * chore: add new test case for disabled state * fix: cleanup markup and text for EntityDataReminder * chore: add readEntityData as context value * refactor: rename DataEntityReminder to ReminderAcoordionItem * chore: extract core accordion item logic to parent * chore: finish initial version of ReminderAccordion * wip: commit test stubs for ReminderAccordion * chore: rename isReadingEntityData prop * chore: update mock context values in tests * wip: commit test stub for hiding cta button when there is no repo URL * chore: hide CTA button when there is no repo URL * chore: rename AccordionItem to Disclosure * chore: update tests for Disclosure * chore: remove needless hasAssertions calls * fix: update conditional logic for ReminderAccordion * fix: more accordion bug fixes * chore: finish another test case * chore: add another accordion test case * refactor: rename props for clarity * refactor: simplify condition for entity reminder * refactor: update prop for Disclosure * chore: finish all tests for accordion * refactor: update type definition for mock config * refactor: polish up accordion tests * chore: finish up all tests * fix: add missing property to mock setup to help compiler pass * refactor: move isReadingEntityData property to workspaces config * fix: add overflow-y and max height behavior to accordion * chore: polish styling for accordion * fix: add reminder accordion as exported plugin component * refactor: rename imported component to reduce visual noise when reading * fix: make no-link message more clear for button * fix: update text to account for new tooltip * docs: add page about catalog-info * docs: finish all docs updates for coder plugin * docs: add docs section for ReminderAccordion * fix: update link for documentation in UI
- Loading branch information
1 parent
6c050f1
commit ece362a
Showing
30 changed files
with
989 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# `catalog-info.yaml` files | ||
|
||
This file provides documentation for all properties that the Coder plugin recognizes from Backstage's [`catalog-info.yaml` files](https://backstage.io/docs/features/software-catalog/descriptor-format/). | ||
|
||
## Example file | ||
|
||
```yaml | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: python-project | ||
spec: | ||
type: other | ||
lifecycle: unknown | ||
owner: pms | ||
|
||
# Properties for the Coder plugin are placed here | ||
coder: | ||
templateName: 'devcontainers' | ||
mode: 'auto' | ||
params: | ||
repo: 'custom' | ||
region: 'us-pittsburgh' | ||
``` | ||
All config properties are placed under the `spec.coder` property. | ||
|
||
## Where these properties are used | ||
|
||
At present, there are two main areas where these values are used: | ||
|
||
- [`CoderWorkspacesCard`](./components.md#coderworkspacescard) (and all sub-components) | ||
- [`useCoderWorkspacesConfig`](./hooks.md#usecoderworkspacesconfig) | ||
|
||
## Property listing | ||
|
||
### `templateName` | ||
|
||
**Type:** Optional `string` | ||
|
||
This defines the name of the Coder template you would like to use when creating new workspaces from Backstage. | ||
|
||
**Note:** This value has overlap with the `defaultTemplateName` property defined in [`CoderAppConfig`](types.md#coderappconfig). In the event that both values are present, the YAML file's `templateName` property will always be used instead. | ||
|
||
### `templateName` | ||
|
||
**Type:** Optional union of `manual` or `auto` | ||
|
||
This defines the workspace creation mode that will be embedded as a URL parameter in any outgoing links to make new workspaces in your Coder deployment. (e.g.,`useCoderWorkspacesConfig`'s `creationUrl` property) | ||
|
||
**Note:** This value has overlap with the `defaultMode` property defined in [`CoderAppConfig`](types.md#coderappconfig). In the event that both values are present, the YAML file's `mode` property will always be used instead. | ||
|
||
### `params` | ||
|
||
**Type:** Optional JSON object of string values (equivalent to TypeScript's `Record<string, string | undefined>`) | ||
|
||
This allows you to define additional Coder workspace parameter values that should be passed along to any outgoing URLs for making new workspaces in your Coder deployment. These values are fully dynamic, and unfortunately, cannot have much type safety. | ||
|
||
**Note:** The properties from the `params` property are automatically merged with the properties defined via `CoderAppConfig`'s `params` property. In the event of any key conflicts, the params from `catalog-info.yaml` will always win. |
Oops, something went wrong.