Skip to content

Commit

Permalink
[5.x] Display special install commands for first-party addons (#10640)
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean authored Aug 15, 2024
1 parent e1629e3 commit 8c93c43
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions resources/js/components/AddonDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</template>
<template v-else>
<p v-text="`${__('messages.addon_install_command')}:`" />
<code-block copyable :text="`composer require ${package}`" />
<code-block copyable :text="installCommand" />
</template>
<p v-html="link"></p>
</div>
Expand Down Expand Up @@ -69,10 +69,6 @@ import AddonEditions from './addons/Editions.vue';
},
computed: {
toEleven() {
return {timeout: Statamic.$config.get('ajaxTimeout')};
},
package() {
return this.addon.package;
},
Expand All @@ -91,6 +87,19 @@ import AddonEditions from './addons/Editions.vue';
link() {
return __('Learn more about :link', { link: `<a href="https://statamic.dev/addons" target="_blank">${__('Addons')}</a>`}) + '.';
},
installCommand() {
switch (this.package) {
case 'statamic/collaboration':
return 'php please install:collaboration';
case 'statamic/eloquent-driver':
return 'php please install:eloquent-driver';
case 'statamic/ssg':
return 'php please install:ssg';
default:
return `composer require ${this.package}`;
}
},
},
created() {
Expand Down

0 comments on commit 8c93c43

Please sign in to comment.