Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ability to add a title to a strategy
- Loading branch information
Showing
30 changed files
with
232 additions
and
46 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
39 changes: 39 additions & 0 deletions
39
...feature/FeatureStrategy/FeatureStrategyForm/FeatureStrategyTitle/FeatureStrategyTitle.tsx
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,39 @@ | ||
import { Box, Typography } from '@mui/material'; | ||
import Input from 'component/common/Input/Input'; | ||
import { VFC } from 'react'; | ||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; | ||
|
||
interface IFeatureStrategyTitleProps { | ||
title: string; | ||
setTitle: (title: string) => void; | ||
} | ||
|
||
export const FeatureStrategyTitle: VFC<IFeatureStrategyTitleProps> = ({ | ||
title, | ||
setTitle, | ||
}) => { | ||
const { uiConfig } = useUiConfig(); | ||
|
||
if (!uiConfig.flags.strategyTitle) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Box sx={{ paddingBottom: theme => theme.spacing(2) }}> | ||
<Typography | ||
sx={{ | ||
paddingBottom: theme => theme.spacing(2), | ||
}} | ||
> | ||
What would you like to call this strategy? (optional) | ||
</Typography> | ||
<Input | ||
label="Strategy title" | ||
id="title-input" | ||
value={title} | ||
onChange={e => setTitle(e.target.value)} | ||
sx={{ width: '100%' }} | ||
/> | ||
</Box> | ||
); | ||
}; |
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
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,37 @@ | ||
/** | ||
* Generated by Orval | ||
* Do not edit manually. | ||
* See `gen:api` script in package.json | ||
*/ | ||
import type { AddonCreateUpdateSchemaParameters } from './addonCreateUpdateSchemaParameters'; | ||
|
||
/** | ||
* Data required to create or update an [Unleash addon](https://docs.getunleash.io/reference/addons) instance. | ||
*/ | ||
export interface AddonCreateUpdateSchema { | ||
/** The addon provider, such as "webhook" or "slack". This string is **case sensitive** and maps to the provider's `name` property. | ||
The list of all supported providers and their parameters for a specific Unleash instance can be found by making a GET request to the `api/admin/addons` endpoint: the `providers` property of that response will contain all available providers. | ||
The default set of providers can be found in the [addons reference documentation](https://docs.getunleash.io/reference/addons). The default supported options are: | ||
- `datadog` for [Datadog](https://docs.getunleash.io/reference/addons/datadog) | ||
- `slack` for [Slack](https://docs.getunleash.io/reference/addons/slack) | ||
- `teams` for [Microsoft Teams](https://docs.getunleash.io/reference/addons/teams) | ||
- `webhook` for [webhooks](https://docs.getunleash.io/reference/addons/webhook) | ||
The provider you choose for your addon dictates what properties the `parameters` object needs. Refer to the documentation for each provider for more information. | ||
*/ | ||
provider: string; | ||
/** A description of the addon. */ | ||
description?: string; | ||
/** Whether the addon should be enabled or not. */ | ||
enabled: boolean; | ||
/** Parameters for the addon provider. This object has different required and optional properties depending on the provider you choose. Consult the documentation for details. */ | ||
parameters: AddonCreateUpdateSchemaParameters; | ||
/** The event types that will trigger this specific addon. */ | ||
events: string[]; | ||
/** The projects that this addon will listen to events from. An empty list means it will listen to events from **all** projects. */ | ||
projects?: string[]; | ||
/** The list of environments that this addon will listen to events from. An empty list means it will listen to events from **all** environments. */ | ||
environments?: string[]; | ||
} |
10 changes: 10 additions & 0 deletions
10
frontend/src/openapi/models/addonCreateUpdateSchemaParameters.ts
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,10 @@ | ||
/** | ||
* Generated by Orval | ||
* Do not edit manually. | ||
* See `gen:api` script in package.json | ||
*/ | ||
|
||
/** | ||
* Parameters for the addon provider. This object has different required and optional properties depending on the provider you choose. Consult the documentation for details. | ||
*/ | ||
export type AddonCreateUpdateSchemaParameters = { [key: string]: unknown }; |
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
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
Oops, something went wrong.