Fix dependency prefill issue

This commit is contained in:
Nassim Jahnke 2022-07-10 18:14:56 +02:00
parent dab2c3ae7d
commit de3c467f61
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 15 additions and 6 deletions

View File

@ -126,8 +126,8 @@ function getBorderClasses(version: Version): string {
<div class="flex flex-wrap items-center">
<span class="text-xl md:basis-full">{{ item.name }}</span>
<Tag :name="item.channel.name" :color="{ background: item.channel.color }" />
<IconMdiCancel v-if="item.visibility === Visibility.SOFT_DELETE"></IconMdiCancel>
<IconMdiEyeOff v-else-if="item.visibility !== Visibility.PUBLIC"></IconMdiEyeOff>
<IconMdiCancel v-if="item.visibility === Visibility.SOFT_DELETE" class="ml-1"></IconMdiCancel>
<IconMdiEyeOff v-else-if="item.visibility !== Visibility.PUBLIC" class="ml-1"></IconMdiEyeOff>
</div>
</div>
<div class="basis-3/12 <md:(mt-2 basis-6/12)">

View File

@ -146,11 +146,15 @@ async function createPendingVersion() {
}
async function createVersion() {
if (!pendingVersion.value) return false;
if (!pendingVersion.value) {
return false;
}
loading.submit = true;
pendingVersion.value!.description = descriptionEditor.value.rawEdited;
pendingVersion.value!.channelColor = currentChannel.value!.color;
pendingVersion.value!.channelFlags = currentChannel.value!.flags;
// played around trying to get this to happen in jackson's deserialization, but couldn't figure it out.
for (const platform in pendingVersion.value.platformDependencies) {
if (pendingVersion.value!.platformDependencies[platform as Platform].length < 1) {
@ -162,9 +166,14 @@ async function createVersion() {
delete pendingVersion.value!.pluginDependencies[platform as Platform];
}
}
console.log("pending", pendingVersion.value);
console.log("editor", descriptionEditor.value);
console.log("rawEdited", descriptionEditor.value.rawEdited);
for (const platform in pendingVersion.value.platformDependencies) {
if (!selectedPlatforms.value.includes(platform as Platform)) {
delete pendingVersion.value.platformDependencies[platform as Platform];
delete pendingVersion.value.pluginDependencies[platform as Platform];
}
}
try {
await useInternalApi(`versions/version/${props.project.id}/create`, true, "post", pendingVersion.value);
await router.push(`/${route.params.user}/${route.params.project}/versions`);