Skip to content

Commit

Permalink
fix(marketplace): Incorrect display of repository visibility. Temopra…
Browse files Browse the repository at this point in the history
…rily removed.
  • Loading branch information
arunmathaisk committed Jan 21, 2025
1 parent b8d63db commit cff6d75
Showing 1 changed file with 22 additions and 49 deletions.
71 changes: 22 additions & 49 deletions dashboard/src2/components/MarketplaceAppListing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
:upload-args="{
doctype: 'Marketplace App',
docname: app.doc.name,
method: 'press.api.marketplace.update_app_image'
method: 'press.api.marketplace.update_app_image',
}"
>
<template
Expand Down Expand Up @@ -61,33 +61,6 @@
v-model="marketplaceApp.title"
/>
</div>
<div class="pb-8 sm:col-span-4">
<span class="text-base font-medium">App Source</span>
<p class="pt-2 text-xs">
Note: Only open-source or source-available applications are
allowed on the Frappe Marketplace. You can keep your repository
private, but if a user requests the source code, you must provide
it.
</p>
<div>
<FormControl
class="pt-4"
label="GitHub Repository URL"
type="text"
:disabled="true"
v-model="marketplaceApp.github_repository_url"
/>
<p
v-if="marketplaceApp.is_public_repo"
class="pt-3 text-xs text-green-700"
>
The GitHub repository is public.
</p>
<p v-else class="pt-3 text-xs text-red-700">
The GitHub repository is private.
</p>
</div>
</div>
<div class="sm:col-span-4">
<span class="text-base font-medium">Links</span>
<div>
Expand Down Expand Up @@ -145,7 +118,7 @@
:upload-args="{
doctype: 'Marketplace App',
docname: app.name,
method: 'press.api.marketplace.add_app_screenshot'
method: 'press.api.marketplace.add_app_screenshot',
}"
>
<template
Expand Down Expand Up @@ -218,7 +191,7 @@ export default {
props: ['app'],
components: {
FileUploader,
TextEditor
TextEditor,
},
data() {
return {
Expand All @@ -234,8 +207,8 @@ export default {
description: '',
long_description: '',
github_repository_url: '',
is_public_repo: false
}
is_public_repo: false,
},
};
},
resources: {
Expand All @@ -247,9 +220,9 @@ export default {
dt: 'Marketplace App',
dn: this.app.doc.name,
method: 'update_listing',
args: this.marketplaceApp
args: this.marketplaceApp,
};
}
},
};
},
listingData() {
Expand All @@ -259,7 +232,7 @@ export default {
return {
dt: 'Marketplace App',
dn: this.app.doc.name,
method: 'listing_details'
method: 'listing_details',
};
},
auto: true,
Expand All @@ -268,14 +241,14 @@ export default {
},
onError(e) {
toast.error(getToastErrorMessage(e, 'Failed to fetch listing data'));
}
},
};
},
removeScreenshot() {
return {
url: 'press.api.marketplace.remove_app_screenshot'
url: 'press.api.marketplace.remove_app_screenshot',
};
}
},
},
methods: {
imageAddSuccess(message) {
Expand All @@ -292,11 +265,11 @@ export default {
return 'Updated successfully';
},
loading: 'Updating listing...',
error: err => {
error: (err) => {
return err.messages?.length
? err.messages.join('\n')
: err.message || 'Failed to update listing';
}
},
});
},
dropdownOptions(image) {
Expand All @@ -308,23 +281,23 @@ export default {
toast.promise(
this.$resources.removeScreenshot.submit({
name: this.app.doc.name,
file: image
file: image,
}),
{
loading: 'Deleting screenshot...',
success: () => {
this.$resources.listingData.reload();
return 'Screenshot deleted successfully';
},
error: err => {
error: (err) => {
return err.messages?.length
? err.messages.join('\n')
: err.message || 'Failed to delete screenshot';
}
}
},
},
);
}
}
},
},
];
},
validateLink(link) {
Expand All @@ -346,12 +319,12 @@ export default {
return false;
}
return true;
}
},
},
computed: {
profileImageUrl() {
return this.app.doc.image;
}
}
},
},
};
</script>

0 comments on commit cff6d75

Please sign in to comment.