Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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: 6 additions & 0 deletions .changeset/strong-experts-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"storybook": patch
"@orchestrator-ui/orchestrator-ui-components": patch
---

inline edit for description of metadata pages
108 changes: 54 additions & 54 deletions .github/workflows/tag-example-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,63 @@
name: Tag example-orchestrator-ui

on:
push:
tags:
- "@orchestrator-ui/orchestrator-ui-components@[0-9]+.[0-9]+.[0-9]+"
release:
types:
- published
tags:
- "@orchestrator-ui/orchestrator-ui-components@[0-9]+.[0-9]+.[0-9]+"
push:
tags:
- '@orchestrator-ui/orchestrator-ui-components@[0-9]+.[0-9]+.[0-9]+'
release:
types:
- published
tags:
- '@orchestrator-ui/orchestrator-ui-components@[0-9]+.[0-9]+.[0-9]+'

# The main branch of the following repository will be tagged
# with the version part (e.g. 0.3.1) of the tag trigger above.
env:
REPO: "example-orchestrator-ui"
REPO: 'example-orchestrator-ui'

jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Create GitHub app token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.RW_REPOSITORY_CONTENT_APP_ID }}
private-key: ${{ secrets.RW_REPOSITORY_CONTENT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: ${{ env.REPO }}
- name: Get latest commit SHA
id: sha
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const commit = await github.rest.repos.getCommit({
owner: github.repository_owner,
repo: env.REPO,
ref: 'heads/main',
})
return commit.data.sha
- name: Extract REF from ref_name
run: |
REF_NAME=${{ github.ref_name }}
REF=${REF_NAME/@orchestrator-ui\/orchestrator-ui-components@/}
echo REF=${REF} >> $GITHUB_ENV
- name: Add tag to repository
uses: actions/github-script@v7
env:
REF: ${{ format('refs/tags/{0}', env.REF) }}
SHA: ${{ steps.sha.outputs.result }}
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
await github.rest.git.createRef({
owner: github.repository_owner,
repo: env.REPO,
ref: process.env.REF,
sha: process.env.SHA,
})
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Create GitHub app token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.RW_REPOSITORY_CONTENT_APP_ID }}
private-key: ${{ secrets.RW_REPOSITORY_CONTENT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: ${{ env.REPO }}
- name: Get latest commit SHA
id: sha
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const commit = await github.rest.repos.getCommit({
owner: github.repository_owner,
repo: env.REPO,
ref: 'heads/main',
})
return commit.data.sha
- name: Extract REF from ref_name
run: |
REF_NAME=${{ github.ref_name }}
REF=${REF_NAME/@orchestrator-ui\/orchestrator-ui-components@/}
echo REF=${REF} >> $GITHUB_ENV
- name: Add tag to repository
uses: actions/github-script@v7
env:
REF: ${{ format('refs/tags/{0}', env.REF) }}
SHA: ${{ steps.sha.outputs.result }}
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
await github.rest.git.createRef({
owner: github.repository_owner,
repo: env.REPO,
ref: process.env.REF,
sha: process.env.SHA,
})
84 changes: 42 additions & 42 deletions apps/storybook/src/index.css
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
color: #535bf2;
}

body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}

h1 {
font-size: 3.2em;
line-height: 1.1;
font-size: 3.2em;
line-height: 1.1;
}

button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React, { FC } from 'react';

import { useUpdateProductBlockMutation } from '@/rtk/endpoints/metadata/productBlocks';

import { WfoInlineEdit } from '../WfoInlineEdit';

interface WfoProductBlockDescriptionFieldProps {
product_block_id: string;
description: string;
onlyShowOnHover?: boolean;
}

export const WfoProductBlockDescriptionField: FC<
WfoProductBlockDescriptionFieldProps
> = ({ product_block_id, description, onlyShowOnHover = true }) => {
const [updateProductBlock, {}] = useUpdateProductBlockMutation();

return (
<div>
<WfoInlineEdit
value={description}
onlyShowOnHover={onlyShowOnHover}
onSave={(value) =>
updateProductBlock({
product_block_id: product_block_id,
description: value,
})
}
/>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React, { FC } from 'react';

import { useUpdateProductMutation } from '@/rtk/endpoints/metadata/products';

import { WfoInlineEdit } from '../WfoInlineEdit';

interface WfoProductDescriptionFieldProps {
product_id: string;
description: string;
onlyShowOnHover?: boolean;
}

export const WfoProductDescriptionField: FC<
WfoProductDescriptionFieldProps
> = ({ product_id, description, onlyShowOnHover = true }) => {
const [updateProduct, {}] = useUpdateProductMutation();

return (
<div>
<WfoInlineEdit
value={description}
onlyShowOnHover={onlyShowOnHover}
onSave={(value) =>
updateProduct({
product_id: product_id,
description: value,
})
}
/>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React, { FC } from 'react';

import { useUpdateResourceTypeMutation } from '@/rtk/endpoints/metadata/resourceTypes';

import { WfoInlineEdit } from '../WfoInlineEdit';

interface WfoResourceTypeDescriptionFieldProps {
resource_type_id: string;
description: string;
onlyShowOnHover?: boolean;
}

export const WfoResourceTypeDescriptionField: FC<
WfoResourceTypeDescriptionFieldProps
> = ({ resource_type_id, description, onlyShowOnHover = true }) => {
const [updateResourceType, {}] = useUpdateResourceTypeMutation();

return (
<div>
<WfoInlineEdit
value={description}
onlyShowOnHover={onlyShowOnHover}
onSave={(value) =>
updateResourceType({
resource_type_id: resource_type_id,
description: value,
})
}
/>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React, { FC } from 'react';

import { useUpdateWorkflowMutation } from '@/rtk/endpoints/metadata/workflows';

import { WfoInlineEdit } from '../WfoInlineEdit';

interface WfoWorkflowDescriptionFieldProps {
workflow_id: string;
description: string;
onlyShowOnHover?: boolean;
}

export const WfoWorkflowDescriptionField: FC<
WfoWorkflowDescriptionFieldProps
> = ({ workflow_id, description, onlyShowOnHover = true }) => {
const [updateWorkflowType, {}] = useUpdateWorkflowMutation();

return (
<div>
<WfoInlineEdit
value={description}
onlyShowOnHover={onlyShowOnHover}
onSave={(value) =>
updateWorkflowType({
workflow_id: workflow_id,
description: value,
})
}
/>
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ export const IPAM_FREE_SUBNETS_ENDPOINT = `${IPAM_ENDPOINT}/free_subnets`;
export const SUBSCRIPTION_ACTIONS_ENDPOINT = 'subscriptions/workflows';
export const CUSTOMER_DESCRIPTION_ENDPOINT =
'/subscription_customer_descriptions';

//metadata
export const METADATA_PRODUCT_ENDPOINT = 'products';
export const METADATA_PRODUCT_BLOCK_ENDPOINT = 'product_blocks';
export const METADATA_RESOURCE_TYPE_ENDPOINT = 'resource_types';
export const METADATA_WORKFLOWS_ENDPOINT = 'workflows';
Loading
Loading