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

chore: add support for PAYG billing #8582

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions frontend/src/component/menu/Footer/ApiDetails/ApiDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ interface IApiDetailsProps {
export const ApiDetails = (props: IApiDetailsProps): ReactElement => {
const instanceId = props.uiConfig.versionInfo?.instanceId;
const { name, version, buildNumber } = formatCurrentVersion(props.uiConfig);
const environment = props.uiConfig.environment;
const { environment, billing } = props.uiConfig;
const updateNotification = formatUpdateNotification(props.uiConfig);

const buildInfo = buildNumber ? <small>({buildNumber})</small> : '';
return (
<section title='API details'>
<FooterTitle>
{name} {environment ? environment : ''} {version} {buildInfo}
{name} {environment ? environment : ''}
{billing === 'pay-as-you-go' ? ' Pay-as-You-Go' : ''} {version}{' '}
{buildInfo}
</FooterTitle>
<ConditionallyRender
condition={Boolean(updateNotification)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface IPartialUiConfig {
version: string;
slogan?: string;
environment?: string;
billing?: string;
versionInfo?: IVersionInfo;
}

Expand Down
1 change: 1 addition & 0 deletions frontend/src/interfaces/uiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface IUiConfig {
name: string;
slogan: string;
environment?: string;
billing?: 'subscription' | 'pay-as-you-go';
unleashUrl?: string;
version: string;
versionInfo?: IVersionInfo;
Expand Down
6 changes: 6 additions & 0 deletions src/lib/openapi/spec/ui-config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export const uiConfigSchema = {
'What kind of Unleash instance it is: Enterprise, Pro, or Open source',
example: 'Enterprise',
},
billing: {
type: 'string',
description: 'The billing model in use for this Unleash instance.',
example: 'subscription',
enum: ['subscription', 'pay-as-you-go'],
},
unleashUrl: {
type: 'string',
description: 'The URL of the Unleash instance.',
Expand Down
Loading