-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
153b2fa
commit 37d7b92
Showing
7 changed files
with
177 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<template> | ||
<!-- TODO: Check responsiveness on mobile --> | ||
<Drawer class="!w-[30rem]" position="right" header="Edit" v-model:visible="show"> | ||
<form id="editForm" @submit.prevent="onFormSubmit" class="flex flex-col gap-4 w-full"> | ||
<input name="orgName" hidden required :value="orgName" /> | ||
<input name="appName" hidden required :value="appName" /> | ||
<input name="releaseId" hidden required :value="releaseId" /> | ||
<div class="flex flex-col gap-1"> | ||
<Textarea rows="5" form="editForm" :pt="{ | ||
root: { | ||
'name': 'releaseNotes', | ||
}, | ||
}" id="releaseNotes" ref="refTextArea" placeholder="Release Notes" /> | ||
</div> | ||
<Button type="submit" severity="secondary" label="Save" data-testid="save_edit_btn" :loading="isPending" /> | ||
</form> | ||
</Drawer> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
const { params } = useRoute() | ||
const appName = params.appId as string | ||
const orgName = params.orgName as string | ||
const releaseId = params.detailArtifact as string | ||
const show = defineModel<boolean>() | ||
const props = defineProps({ | ||
releaseNotes: { | ||
type: String, | ||
required: true, | ||
}, | ||
}) | ||
const emit = defineEmits(['onEdited']) | ||
const refTextArea = ref() | ||
if (import.meta.client) { | ||
watchEffect(() => { | ||
const releaseNotes = props?.releaseNotes | ||
if (refTextArea.value) { | ||
// @ts-ignore | ||
document.getElementById('releaseNotes').value = releaseNotes | ||
} | ||
}) | ||
} | ||
const { mutate, isPending } = useMutation({ | ||
mutationFn: async (r: any) => { | ||
await $fetch.raw('/api/artifacts/edit-artifact', { | ||
method: 'post', | ||
body: r, | ||
}) | ||
show.value = false | ||
emit('onEdited') | ||
}, | ||
}) | ||
const onFormSubmit = (ev: Event) => { | ||
const request = getObjectForm(ev) | ||
mutate(request) | ||
}; | ||
</script> |
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,28 @@ | ||
export default defineEventHandler(async (event) => { | ||
const { orgName, appName, releaseId, releaseNotes } = await readValidatedBody(event, z.object({ | ||
orgName: z.string().min(1).max(128), | ||
appName: z.string().min(1).max(128), | ||
releaseId: z.string().min(1).transform(e => parseInt(e)), | ||
releaseNotes: z.string().max(5000).nullish(), | ||
}).parse) | ||
|
||
if (await roleEditNotAllowed(event, orgName)) { | ||
throw createError({ | ||
message: 'Request edit artifact not valid', | ||
statusCode: 400, | ||
}) | ||
} | ||
|
||
const { userApp } = await getUserApp(event, orgName, appName) | ||
|
||
const db = event.context.drizzle | ||
await db.update(tables.artifacts) | ||
.set({ | ||
releaseNotes: releaseNotes, | ||
}) | ||
.where(and( | ||
eq(tables.artifacts.organizationId, userApp.organizationsId!), | ||
eq(tables.artifacts.appsId, userApp.id), | ||
eq(tables.artifacts.releaseId, releaseId), | ||
)) | ||
}) |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
# bun ./bun.lockb --hash: 9C6BD510801E669E-b9e992dc8afcebe9-C3460F3346A56EF7-17f2b2a0b5817ed9 | ||
# bun ./bun.lockb --hash: 471406DA03FCAB71-dbd7609dacd0b1f0-78C7D76ACD43F5ED-e317421320cbae69 | ||
|
||
|
||
"@aashutoshrathi/word-wrap@^1.2.3": | ||
|
@@ -1849,7 +1849,7 @@ | |
untyped "^1.4.2" | ||
"@nuxt/schema" "3.11.1" | ||
|
||
"@nuxt/kit@^3.11.2", "@nuxt/kit@^3.2.0", "@nuxt/kit@^3.7.3", "@nuxt/kit@^3.8.2": | ||
"@nuxt/kit@^3.11.2", "@nuxt/kit@^3.2.0", "@nuxt/kit@^3.8.2": | ||
version "3.11.2" | ||
resolved "https://registry.npmjs.org/@nuxt/kit/-/kit-3.11.2.tgz" | ||
integrity sha512-yiYKP0ZWMW7T3TCmsv4H8+jEsB/nFriRAR8bKoSqSV9bkVYWPE36sf7JDux30dQ91jSlQG6LQkB3vCHYTS2cIg== | ||
|
@@ -1899,7 +1899,7 @@ | |
untyped "^1.4.2" | ||
"@nuxt/schema" "3.12.4" | ||
|
||
"@nuxt/kit@^3.13.2", "@nuxt/kit@^3.8.2": | ||
"@nuxt/kit@^3.13.2", "@nuxt/kit@^3.7.3", "@nuxt/kit@^3.8.2": | ||
version "3.13.2" | ||
resolved "https://registry.npmjs.org/@nuxt/kit/-/kit-3.13.2.tgz" | ||
integrity sha512-KvRw21zU//wdz25IeE1E5m/aFSzhJloBRAQtv+evcFeZvuroIxpIQuUqhbzuwznaUwpiWbmwlcsp5uOWmi4vwA== | ||
|
@@ -2283,66 +2283,66 @@ | |
resolved "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.25.tgz" | ||
integrity sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ== | ||
|
||
"@primeuix/styled@^0.0.5": | ||
version "0.0.5" | ||
resolved "https://registry.npmjs.org/@primeuix/styled/-/styled-0.0.5.tgz" | ||
integrity sha512-pVoGn/uPkVm/DyF3TR3EmH/pL/dP4nR42FcYbVduFq9VfO3KVeOEqvcCULHXos66RZO9MCbCFUoLy6ctf9GUGQ== | ||
"@primeuix/styled@^0.3.2": | ||
version "0.3.2" | ||
resolved "https://registry.npmjs.org/@primeuix/styled/-/styled-0.3.2.tgz" | ||
integrity sha512-ColZes0+/WKqH4ob2x8DyNYf1NENpe5ZguOvx5yCLxaP8EIMVhLjWLO/3umJiDnQU4XXMLkn2mMHHw+fhTX/mw== | ||
dependencies: | ||
"@primeuix/utils" "^0.0.5" | ||
"@primeuix/utils" "^0.3.2" | ||
|
||
"@primeuix/utils@^0.0.5": | ||
version "0.0.5" | ||
resolved "https://registry.npmjs.org/@primeuix/utils/-/utils-0.0.5.tgz" | ||
integrity sha512-ntUiUgtRtkF8KuaxHffzhYxQxoXk6LAPHm7CVlFjdqS8Rx8xRkLkZVyo84E+pO2hcNFkOGVP/GxHhQ2s94O8zA== | ||
"@primeuix/utils@^0.3.2": | ||
version "0.3.2" | ||
resolved "https://registry.npmjs.org/@primeuix/utils/-/utils-0.3.2.tgz" | ||
integrity sha512-B+nphqTQeq+i6JuICLdVWnDMjONome2sNz0xI65qIOyeB4EF12CoKRiCsxuZ5uKAkHi/0d1LqlQ9mIWRSdkavw== | ||
|
||
"@primevue/auto-import-resolver@4.0.2": | ||
version "4.0.2" | ||
resolved "https://registry.npmjs.org/@primevue/auto-import-resolver/-/auto-import-resolver-4.0.2.tgz" | ||
integrity sha512-RVCwZVK4Yzx8K3fFvF3O7CX+EirkmxAx3+ZWbatSMT+zRUhsdNFKh5jcPYJk/yGs/hI4lh8lTOqhFf2uXCflQg== | ||
"@primevue/auto-import-resolver@4.2.5": | ||
version "4.2.5" | ||
resolved "https://registry.npmjs.org/@primevue/auto-import-resolver/-/auto-import-resolver-4.2.5.tgz" | ||
integrity sha512-+jeH7QhzyKYYo1yWvJ/HDeHWTddvIbtI6/Gr4pY0hW94RHvRXlnWS20lrXGQ60P/3pkl6p423wysY1hhvsMUjQ== | ||
dependencies: | ||
"@primevue/metadata" "4.0.2" | ||
"@primevue/metadata" "4.2.5" | ||
|
||
"@primevue/core@4.0.2": | ||
version "4.0.2" | ||
resolved "https://registry.npmjs.org/@primevue/core/-/core-4.0.2.tgz" | ||
integrity sha512-SpCIQ1LG6B66cecmZt1UdFeY7tbdJrgnhncADolfE9fcCyTSBtbaVLLhCV2E4Q9myMwCFE5KQxqazA4rdLWk4w== | ||
"@primevue/core@4.2.5": | ||
version "4.2.5" | ||
resolved "https://registry.npmjs.org/@primevue/core/-/core-4.2.5.tgz" | ||
integrity sha512-+oWBIQs5dLd2Ini4KEVOlvPILk989EHAskiFS3R/dz3jeOllJDMZFcSp8V9ddV0R3yDaPdLVkfHm2Q5t42kU2Q== | ||
dependencies: | ||
"@primeuix/styled" "^0.0.5" | ||
"@primeuix/utils" "^0.0.5" | ||
"@primeuix/styled" "^0.3.2" | ||
"@primeuix/utils" "^0.3.2" | ||
|
||
"@primevue/icons@4.0.2": | ||
version "4.0.2" | ||
resolved "https://registry.npmjs.org/@primevue/icons/-/icons-4.0.2.tgz" | ||
integrity sha512-S1VEpMsx4uUAsTjZtII03LQqgocYwSKbXMF0YDFWybY8r5LaHaveVZxS/i+KbsCLaL18BXJw0L/7L1eQdJHzaA== | ||
"@primevue/icons@4.2.5": | ||
version "4.2.5" | ||
resolved "https://registry.npmjs.org/@primevue/icons/-/icons-4.2.5.tgz" | ||
integrity sha512-WFbUMZhQkXf/KmwcytkjGVeJ9aGEDXjP3uweOjQZMmRdEIxFnqYYpd90wE90JE1teZn3+TVnT4ZT7ejGyEXnFQ== | ||
dependencies: | ||
"@primeuix/utils" "^0.0.5" | ||
"@primevue/core" "4.0.2" | ||
"@primeuix/utils" "^0.3.2" | ||
"@primevue/core" "4.2.5" | ||
|
||
"@primevue/metadata@4.0.2": | ||
version "4.0.2" | ||
resolved "https://registry.npmjs.org/@primevue/metadata/-/metadata-4.0.2.tgz" | ||
integrity sha512-zJ5fZNKDuuOf86qNm4NbVzoW/d3n9p8lnt1qsqIMEXWrlGjhRbGg+vbjUKhiUpgKNvwy+HsnAnRFnPCyxuByfQ== | ||
"@primevue/metadata@4.2.5": | ||
version "4.2.5" | ||
resolved "https://registry.npmjs.org/@primevue/metadata/-/metadata-4.2.5.tgz" | ||
integrity sha512-dABQ8BecGg6NRnrLx11MvmCQCFn2inUEmao8t17/Tc2wxwoXY315TaakDa5ebOdYnTG91lh+NX7SBpTH+MYIyQ== | ||
|
||
"@primevue/nuxt-module@^4.0.2": | ||
version "4.0.2" | ||
resolved "https://registry.npmjs.org/@primevue/nuxt-module/-/nuxt-module-4.0.2.tgz" | ||
integrity sha512-vK5CFypYvdJO8EtVEpiQlvyrYjKF97V3dzRST+QeVvRd7gy49tgFTwU2jp7fZsnSnyAq74ZhJWeOid0gUmbJdg== | ||
"@primevue/nuxt-module@^4.2.5": | ||
version "4.2.5" | ||
resolved "https://registry.npmjs.org/@primevue/nuxt-module/-/nuxt-module-4.2.5.tgz" | ||
integrity sha512-/zs9pYCu81Le56l7HCz1AUv6g3eW17XLx3BNCeE3BcYxQAcwTP9rd9uUxvrRvigQABGoc21Ye+Wb02uv1/uRtg== | ||
dependencies: | ||
"@nuxt/kit" "^3.7.3" | ||
"@primeuix/styled" "^0.0.5" | ||
"@primeuix/utils" "^0.0.5" | ||
"@primeuix/styled" "^0.3.2" | ||
"@primeuix/utils" "^0.3.2" | ||
unplugin-vue-components "0.27.0" | ||
pathe "^1.1.2" | ||
"@primevue/auto-import-resolver" "4.0.2" | ||
"@primevue/metadata" "4.0.2" | ||
primevue "4.0.2" | ||
primevue "4.2.5" | ||
"@primevue/auto-import-resolver" "4.2.5" | ||
"@primevue/metadata" "4.2.5" | ||
|
||
"@primevue/themes@^4.0.2": | ||
version "4.0.2" | ||
resolved "https://registry.npmjs.org/@primevue/themes/-/themes-4.0.2.tgz" | ||
integrity sha512-DGrdFOWRUb8/qDX+Hjkg0SkU2hvo6EmEE5/fA/+NSlLAemj5fcR8r3wo9jhFMIU0QVNl17jZycuL5taU0H72BA== | ||
"@primevue/themes@^4.2.5": | ||
version "4.2.5" | ||
resolved "https://registry.npmjs.org/@primevue/themes/-/themes-4.2.5.tgz" | ||
integrity sha512-8F7yA36xYIKtNuAuyBdZZEks/bKDwlhH5WjpqGGB0FdwfAEoBYsynQ5sdqcT2Lb/NsajHmS5lc++Ttlvr1g1Lw== | ||
dependencies: | ||
"@primeuix/styled" "^0.0.5" | ||
"@primeuix/styled" "^0.3.2" | ||
|
||
"@rollup/plugin-alias@^5.1.0": | ||
version "5.1.0" | ||
|
@@ -8694,15 +8694,15 @@ primeicons@^7.0.0: | |
resolved "https://registry.npmjs.org/primeicons/-/primeicons-7.0.0.tgz" | ||
integrity sha512-jK3Et9UzwzTsd6tzl2RmwrVY/b8raJ3QZLzoDACj+oTJ0oX7L9Hy+XnVwgo4QVKlKpnP/Ur13SXV/pVh4LzaDw== | ||
|
||
primevue@4.0.2, primevue@^4.0.2: | ||
version "4.0.2" | ||
resolved "https://registry.npmjs.org/primevue/-/primevue-4.0.2.tgz" | ||
integrity sha512-bf5In//ixosZDOcfJ0iaBXhtQSpNC/CuAOE2KHd/SgUKZdij3VRljQ+I9+Be/TTxfikIeKH7eZ4gzDbWiIZurw== | ||
primevue@4.2.5, primevue@^4.2.5: | ||
version "4.2.5" | ||
resolved "https://registry.npmjs.org/primevue/-/primevue-4.2.5.tgz" | ||
integrity sha512-7UMOIJvdFz4jQyhC76yhNdSlHtXvVpmE2JSo2ndUTBWjWJOkYyT562rQ4ayO+bMdJLtzBGqgY64I9ZfEvNd7vQ== | ||
dependencies: | ||
"@primeuix/styled" "^0.0.5" | ||
"@primeuix/utils" "^0.0.5" | ||
"@primevue/icons" "4.0.2" | ||
"@primevue/core" "4.0.2" | ||
"@primeuix/styled" "^0.3.2" | ||
"@primeuix/utils" "^0.3.2" | ||
"@primevue/core" "4.2.5" | ||
"@primevue/icons" "4.2.5" | ||
|
||
proc-log@^3.0.0: | ||
version "3.0.0" | ||
|
@@ -10489,7 +10489,7 @@ vscode-uri@^3.0.2: | |
"@vue/server-renderer" "3.4.23" | ||
"@vue/compiler-sfc" "3.4.23" | ||
|
||
[email protected], "vue@>=2.7 || >=3", vue@>=3.2.13, vue@^3, vue@^3.2.0, vue@^3.2.25, vue@^3.3.4, vue@^3.4.32: | ||
[email protected], "vue@>=2.7 || >=3", vue@>=3.2.13, vue@^3, vue@^3.2.0, vue@^3.2.25, vue@^3.3.0, vue@^3.3.4, vue@^3.4.32: | ||
version "3.4.38" | ||
resolved "https://registry.npmjs.org/vue/-/vue-3.4.38.tgz" | ||
integrity sha512-f0ZgN+mZ5KFgVv9wz0f4OgVKukoXtS3nwET4c2vLBGQR50aI8G0cqbFtLlX9Yiyg3LFGBitruPHt2PxwTduJEw== | ||
|