Skip to content

Commit

Permalink
Nightly Merge Thu 20 Feb 2025 16:15:43 GMT
Browse files Browse the repository at this point in the history
  • Loading branch information
toxophilist committed Feb 20, 2025
2 parents 699ec44 + 3267d64 commit cf22598
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 21 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/development-build-desktop-application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ jobs:
echo "okit_release_version=$(jq -r '.release' okitweb/static/okit/json/release.json)" >> "$GITHUB_OUTPUT"
echo "okit_release_tag=$(jq -r '.tag' okitweb/static/okit/json/release.json)" >> "$GITHUB_OUTPUT"
echo "okit_release_title=$(jq -r '.title' okitweb/static/okit/json/release.json)" >> "$GITHUB_OUTPUT"
update-or-create-release:
create-release:
needs: [generate-variables]
runs-on: ubuntu-latest
continue-on-error: true
Expand All @@ -43,27 +44,22 @@ jobs:
RELEASE_TAG: ${{ needs.generate-variables.outputs.okit_release_tag }}
RELEASE_TITLE: ${{ needs.generate-variables.outputs.okit_release_title }}
OCD_VERSION: ${{ needs.generate-variables.outputs.ocd_version }}
# BRANCH_OCD_VERSION: ${{ needs.generate-variables.outputs.ocd_version }}-${{ github.head_ref || github.ref_name }}
BRANCH_RELEASE_TAG: ocd.${{ github.head_ref || github.ref_name }}
steps:
- uses: actions/checkout@v4
- name: Delete Release
id: delete_release
run: |
gh release delete ${{ env.BRANCH_RELEASE_TAG }} --yes --cleanup-tag
# - name: Update Release
# id: update_release
# run: |
# gh release edit ${{ env.BRANCH_RELEASE_TAG }} --title "OCD ${{ env.BRANCH }} Release ${{ env.OCD_VERSION }}" --notes-file ./ocd/README.md --target ${{ env.BRANCH }} --latest
- name: Create Release if Update fails
if: failure() || success()
id: create_release
run: |
gh release create ${{ env.BRANCH_RELEASE_TAG }} --title "OCD ${{ env.BRANCH }} Release ${{ env.OCD_VERSION }}" --notes-file ./ocd/README.md --target ${{ env.BRANCH }} --prerelease=true
gh release edit ${{ env.BRANCH_RELEASE_TAG }} --draft=false
# gh release edit ${{ env.BRANCH_RELEASE_TAG }} --draft=false
build-and-release:
needs: [update-or-create-release, generate-variables]
needs: [create-release, generate-variables]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -120,3 +116,20 @@ jobs:
gh release upload ${{ env.BRANCH_RELEASE_TAG }} ./ocd/dist/make/deb/x64/ocd_${{ env.OCD_VERSION }}*.deb --clobber
# gh release upload ${{ env.BRANCH_RELEASE_TAG }} ./ocd/dist/release/${{ env.OCD_VERSION }}/ocd-${{ env.OCD_VERSION }}-*.snap --clobber
# gh release upload ${{ env.BRANCH_RELEASE_TAG }} ./ocd/dist/linux/ocd-${{ env.OCD_VERSION }}-*.AppImage --clobber
update-release:
needs: [build-and-release]
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_RELEASE_TAG: ocd.${{ github.head_ref || github.ref_name }}
steps:
- uses: actions/checkout@v4
- name: Update Release
id: update_release
run: |
gh release edit ${{ env.BRANCH_RELEASE_TAG }} --draft=false
2 changes: 1 addition & 1 deletion ocd/packages/model/src/OcdDesign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ export namespace OcdDesign {
export function newOciFreeformTag(): OciFreeformTag {
return {
// id: uuidv4(),
key: `TAG Key ${uuidv4().slice(-4)}`,
key: `Key${uuidv4().slice(-4)}`,
value: ''
}
}
Expand Down
17 changes: 11 additions & 6 deletions ocd/packages/react/src/components/OcdProperties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,21 +218,26 @@ const OcdResourceTags = ({ocdDocument, setOcdDocument}: DesignerResourceProperti
const tag = freeformTags.find((t) => t.key === oldKey)
if (tag) {
tag.key = newKey
setFreeformTags([...freeformTags])
// setFreeformTags([...freeformTags])
updateFreeformTags(freeformTags)
}
})
const onFreeformValueChange = ((key: string, value: string) => {
const tag = freeformTags.find((t) => t.key === key)
if (tag) {
tag.value = value
setFreeformTags([...freeformTags])
// setFreeformTags([...freeformTags])
updateFreeformTags(freeformTags)
}
})
const updateFreeformTags = (tags: OciFreeformTag[]) => selectedResourceProxy.freeformTags = OcdDesign.ociFreeformTagArrayToTags(tags)
const onDefinedTagDeleteClick = ((namespace:string, key: string) => {
console.debug('OcdProperies: Deleting Defined Row', key, ocdDocument)
console.debug('OcdProperies: Deleting Defined Row', key, ocdDocument, definedTags)
const namespaceKey = `${namespace}.${key}`
const updatedTags = definedTags.filter((t) => `${t.namespace}.${t.key}` !== namespaceKey)
console.debug('OcdCommonTags: Deleting Defined Row', namespaceKey, updatedTags)
setDefinedTags(updatedTags)
updateDefinedTags(updatedTags)
})
const onDefinedTagAddClick = (() => {
const newTag = OcdDesign.newOciDefinedTag()
Expand All @@ -245,23 +250,23 @@ const OcdResourceTags = ({ocdDocument, setOcdDocument}: DesignerResourceProperti
const tag = definedTags.find((t) => t.namespace === oldNamespace && t.key === key)
if (tag) {
tag.namespace = newNamespace
setDefinedTags([...definedTags])
// setDefinedTags([...definedTags])
updateDefinedTags(definedTags)
}
})
const onDefinedKeyChange = ((namespace: string, oldKey: string, newKey: string) => {
const tag = definedTags.find((t) => t.namespace === namespace && t.key === oldKey)
if (tag) {
tag.key = newKey
setDefinedTags([...definedTags])
// setDefinedTags([...definedTags])
updateDefinedTags(definedTags)
}
})
const onDefinedValueChange = ((namespace: string, key: string, value: string) => {
const tag = definedTags.find((t) => t.namespace === namespace && t.key === key)
if (tag) {
tag.value = value
setDefinedTags([...definedTags])
// setDefinedTags([...definedTags])
updateDefinedTags(definedTags)
}
})
Expand Down
17 changes: 11 additions & 6 deletions ocd/packages/react/src/pages/OcdCommonTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ export const OcdCommonTags = ({ ocdConsoleConfig, setOcdConsoleConfig, ocdDocume
const [freeformTags, setFreeformTags] = useState(OcdDesign.ociFreeformTagsToArray(ocdDocument.design.model.oci.tags.freeformTags))
const [definedTags, setDefinedTags] = useState(OcdDesign.ociDefinedTagsToArray(ocdDocument.design.model.oci.tags.definedTags))
const onOciDefinedTagDeleteClick = ((namespace:string, key: string) => {
console.debug('OcdCommonTags: Deleting Defined Row', key, ocdDocument)
console.debug('OcdCommonTags: Deleting Defined Row', key, ocdDocument, definedTags)
const namespaceKey = `${namespace}.${key}`
const updatedTags = definedTags.filter((t) => `${t.namespace}.${t.key}` !== namespaceKey)
console.debug('OcdCommonTags: Deleting Defined Row', namespaceKey, updatedTags)
setDefinedTags(updatedTags)
updateDefinedTags(updatedTags)
// const clone = OcdDocument.clone(ocdDocument)
// if (clone.design.model.oci.tags.defined) {
// clone.design.model.oci.tags.defined = clone.design.model.oci.tags.defined.filter((v) => v.key !== key)
Expand All @@ -34,23 +39,23 @@ export const OcdCommonTags = ({ ocdConsoleConfig, setOcdConsoleConfig, ocdDocume
const tag = definedTags.find((t) => t.namespace === oldNamespace && t.key === key)
if (tag) {
tag.namespace = newNamespace
setDefinedTags([...definedTags])
// setDefinedTags([...definedTags])
updateDefinedTags(definedTags)
}
})
const onOciDefinedKeyChange = ((namespace: string, oldKey: string, newKey: string) => {
const tag = definedTags.find((t) => t.namespace === namespace && t.key === oldKey)
if (tag) {
tag.key = newKey
setDefinedTags([...definedTags])
// setDefinedTags([...definedTags])
updateDefinedTags(definedTags)
}
})
const onOciDefinedValueChange = ((namespace: string, key: string, value: string) => {
const tag = definedTags.find((t) => t.namespace === namespace && t.key === key)
if (tag) {
tag.value = value
setDefinedTags([...definedTags])
// setDefinedTags([...definedTags])
updateDefinedTags(definedTags)
}
})
Expand Down Expand Up @@ -80,15 +85,15 @@ export const OcdCommonTags = ({ ocdConsoleConfig, setOcdConsoleConfig, ocdDocume
const tag = freeformTags.find((t) => t.key === oldKey)
if (tag) {
tag.key = newKey
setFreeformTags([...freeformTags])
// setFreeformTags([...freeformTags])
updateFreeformTags(freeformTags)
}
})
const onFreeformValueChange = ((key: string, value: string) => {
const tag = freeformTags.find((t) => t.key === key)
if (tag) {
tag.value = value
setFreeformTags([...freeformTags])
// setFreeformTags([...freeformTags])
updateFreeformTags(freeformTags)
}
})
Expand Down

0 comments on commit cf22598

Please sign in to comment.