Commit bce255e5 authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera Committed by Nathan Friend

Update installation components

- conan
- maven
- npm
- nuget
- pipy
parent 22b5c365
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
<template> <template>
<div v-if="showMetadata"> <div v-if="showMetadata">
<h3 class="gl-font-lg gl-mt-5" data-testid="title">{{ __('Additional Metadata') }}</h3> <h3 class="gl-font-lg" data-testid="title">{{ __('Additional Metadata') }}</h3>
<div class="gl-bg-gray-50 gl-inset-border-1-gray-100 gl-rounded-base" data-testid="main"> <div class="gl-bg-gray-50 gl-inset-border-1-gray-100 gl-rounded-base" data-testid="main">
<template v-if="packageEntity.nuget_metadatum"> <template v-if="packageEntity.nuget_metadatum">
......
...@@ -31,18 +31,19 @@ export default { ...@@ -31,18 +31,19 @@ export default {
<template> <template>
<div> <div>
<p class="gl-mt-3 gl-font-weight-bold" data-testid="registry-include-title"> <h3 class="gl-font-lg">{{ __('Installation') }}</h3>
<h4 class="gl-font-base" data-testid="registry-include-title">
{{ $options.i18n.registryInclude }} {{ $options.i18n.registryInclude }}
</p> </h4>
<code-instruction <code-instruction
:instruction="composerRegistryInclude" :instruction="composerRegistryInclude"
:copy-text="$options.i18n.copyRegistryInclude" :copy-text="$options.i18n.copyRegistryInclude"
:tracking-action="$options.trackingActions.COPY_COMPOSER_REGISTRY_INCLUDE_COMMAND" :tracking-action="$options.trackingActions.COPY_COMPOSER_REGISTRY_INCLUDE_COMMAND"
/> />
<h4 class="gl-font-base" data-testid="package-include-title">
<p class="gl-mt-3 gl-font-weight-bold" data-testid="package-include-title">
{{ $options.i18n.packageInclude }} {{ $options.i18n.packageInclude }}
</p> </h4>
<code-instruction <code-instruction
:instruction="composerPackageInclude" :instruction="composerPackageInclude"
:copy-text="$options.i18n.copyPackageInclude" :copy-text="$options.i18n.copyPackageInclude"
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
import { GlLink, GlSprintf } from '@gitlab/ui'; import { GlLink, GlSprintf } from '@gitlab/ui';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import CodeInstruction from './code_instruction.vue'; import CodeInstruction from './code_instruction.vue';
import { TrackingActions, TrackingLabels } from '../constants'; import { TrackingActions } from '../constants';
import { mapGetters, mapState } from 'vuex'; import { mapGetters, mapState } from 'vuex';
import InstallationTabs from './installation_tabs.vue';
export default { export default {
name: 'ConanInstallation', name: 'ConanInstallation',
...@@ -12,7 +11,6 @@ export default { ...@@ -12,7 +11,6 @@ export default {
CodeInstruction, CodeInstruction,
GlLink, GlLink,
GlSprintf, GlSprintf,
InstallationTabs,
}, },
computed: { computed: {
...mapState(['conanHelpPath']), ...mapState(['conanHelpPath']),
...@@ -24,30 +22,29 @@ export default { ...@@ -24,30 +22,29 @@ export default {
), ),
}, },
trackingActions: { ...TrackingActions }, trackingActions: { ...TrackingActions },
trackingLabel: TrackingLabels.CONAN_INSTALLATION,
}; };
</script> </script>
<template> <template>
<installation-tabs :tracking-label="$options.trackingLabel"> <div>
<template #installation> <h3 class="gl-font-lg">{{ __('Installation') }}</h3>
<p class="gl-mt-3 font-weight-bold">{{ s__('PackageRegistry|Conan Command') }}</p> <h4 class="gl-font-base">
{{ s__('PackageRegistry|Conan Command') }}
</h4>
<code-instruction <code-instruction
:instruction="conanInstallationCommand" :instruction="conanInstallationCommand"
:copy-text="s__('PackageRegistry|Copy Conan Command')" :copy-text="s__('PackageRegistry|Copy Conan Command')"
class="js-conan-command"
:tracking-action="$options.trackingActions.COPY_CONAN_COMMAND" :tracking-action="$options.trackingActions.COPY_CONAN_COMMAND"
/> />
</template>
<template #setup> <h3 class="gl-font-lg">{{ __('Registry setup') }}</h3>
<p class="gl-mt-3 font-weight-bold"> <h4 class="gl-font-base">
{{ s__('PackageRegistry|Add Conan Remote') }} {{ s__('PackageRegistry|Add Conan Remote') }}
</p> </h4>
<code-instruction <code-instruction
:instruction="conanSetupCommand" :instruction="conanSetupCommand"
:copy-text="s__('PackageRegistry|Copy Conan Setup Command')" :copy-text="s__('PackageRegistry|Copy Conan Setup Command')"
class="js-conan-setup"
:tracking-action="$options.trackingActions.COPY_CONAN_SETUP_COMMAND" :tracking-action="$options.trackingActions.COPY_CONAN_SETUP_COMMAND"
/> />
<gl-sprintf :message="$options.i18n.helpText"> <gl-sprintf :message="$options.i18n.helpText">
...@@ -55,6 +52,5 @@ export default { ...@@ -55,6 +52,5 @@ export default {
<gl-link :href="conanHelpPath" target="_blank">{{ content }}</gl-link> <gl-link :href="conanHelpPath" target="_blank">{{ content }}</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
</template> </div>
</installation-tabs>
</template> </template>
...@@ -43,7 +43,6 @@ export default { ...@@ -43,7 +43,6 @@ export default {
<template> <template>
<div v-if="installationComponent"> <div v-if="installationComponent">
<h3 class="gl-font-lg gl-mt-5" data-testid="title">{{ __('Installation Commands') }}</h3>
<component <component
:is="installationComponent" :is="installationComponent"
:name="packageEntity.name" :name="packageEntity.name"
......
<script>
import Tracking from '~/tracking';
import { trackInstallationTabChange } from '../utils';
import { GlTab, GlTabs } from '@gitlab/ui';
export default {
name: 'TabWrapper',
components: {
GlTab,
GlTabs,
},
mixins: [Tracking.mixin(), trackInstallationTabChange],
props: {
trackingLabel: {
type: String,
required: true,
},
},
};
</script>
<template>
<div class="gl-mb-3">
<gl-tabs @input="trackInstallationTabChange">
<gl-tab :title="s__('PackageRegistry|Installation')" title-item-class="js-installation-tab">
<div class="gl-ml-3 gl-mr-3">
<slot name="installation"></slot>
</div>
</gl-tab>
<gl-tab :title="s__('PackageRegistry|Registry Setup')" title-item-class="js-setup-tab">
<div class="gl-ml-3 gl-mr-3">
<slot name="setup"></slot>
</div>
</gl-tab>
</gl-tabs>
</div>
</template>
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
import { GlLink, GlSprintf } from '@gitlab/ui'; import { GlLink, GlSprintf } from '@gitlab/ui';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import CodeInstruction from './code_instruction.vue'; import CodeInstruction from './code_instruction.vue';
import { TrackingActions, TrackingLabels } from '../constants'; import { TrackingActions } from '../constants';
import { mapGetters, mapState } from 'vuex'; import { mapGetters, mapState } from 'vuex';
import InstallationTabs from './installation_tabs.vue';
export default { export default {
name: 'MavenInstallation', name: 'MavenInstallation',
...@@ -12,7 +11,6 @@ export default { ...@@ -12,7 +11,6 @@ export default {
CodeInstruction, CodeInstruction,
GlLink, GlLink,
GlSprintf, GlSprintf,
InstallationTabs,
}, },
computed: { computed: {
...mapState(['mavenHelpPath']), ...mapState(['mavenHelpPath']),
...@@ -30,14 +28,16 @@ export default { ...@@ -30,14 +28,16 @@ export default {
), ),
}, },
trackingActions: { ...TrackingActions }, trackingActions: { ...TrackingActions },
trackingLabel: TrackingLabels.MAVEN_INSTALLATION,
}; };
</script> </script>
<template> <template>
<installation-tabs :tracking-label="$options.trackingLabel"> <div>
<template #installation> <h3 class="gl-font-lg">{{ __('Installation') }}</h3>
<p class="gl-mt-3 font-weight-bold">{{ s__('PackageRegistry|Maven XML') }}</p>
<h4 class="gl-font-base">
{{ s__('PackageRegistry|Maven XML') }}
</h4>
<p> <p>
<gl-sprintf :message="$options.i18n.xmlText"> <gl-sprintf :message="$options.i18n.xmlText">
<template #code="{ content }"> <template #code="{ content }">
...@@ -48,23 +48,20 @@ export default { ...@@ -48,23 +48,20 @@ export default {
<code-instruction <code-instruction
:instruction="mavenInstallationXml" :instruction="mavenInstallationXml"
:copy-text="s__('PackageRegistry|Copy Maven XML')" :copy-text="s__('PackageRegistry|Copy Maven XML')"
class="js-maven-xml"
multiline multiline
:tracking-action="$options.trackingActions.COPY_MAVEN_XML" :tracking-action="$options.trackingActions.COPY_MAVEN_XML"
/> />
<p class="gl-mt-3 font-weight-bold"> <h4 class="gl-font-base">
{{ s__('PackageRegistry|Maven Command') }} {{ s__('PackageRegistry|Maven Command') }}
</p> </h4>
<code-instruction <code-instruction
:instruction="mavenInstallationCommand" :instruction="mavenInstallationCommand"
:copy-text="s__('PackageRegistry|Copy Maven command')" :copy-text="s__('PackageRegistry|Copy Maven command')"
class="js-maven-command"
:tracking-action="$options.trackingActions.COPY_MAVEN_COMMAND" :tracking-action="$options.trackingActions.COPY_MAVEN_COMMAND"
/> />
</template>
<template #setup> <h3 class="gl-font-lg">{{ __('Registry setup') }}</h3>
<p> <p>
<gl-sprintf :message="$options.i18n.setupText"> <gl-sprintf :message="$options.i18n.setupText">
<template #code="{ content }"> <template #code="{ content }">
...@@ -75,7 +72,6 @@ export default { ...@@ -75,7 +72,6 @@ export default {
<code-instruction <code-instruction
:instruction="mavenSetupXml" :instruction="mavenSetupXml"
:copy-text="s__('PackageRegistry|Copy Maven registry XML')" :copy-text="s__('PackageRegistry|Copy Maven registry XML')"
class="js-maven-setup-xml"
multiline multiline
:tracking-action="$options.trackingActions.COPY_MAVEN_SETUP" :tracking-action="$options.trackingActions.COPY_MAVEN_SETUP"
/> />
...@@ -84,6 +80,5 @@ export default { ...@@ -84,6 +80,5 @@ export default {
<gl-link :href="mavenHelpPath" target="_blank">{{ content }}</gl-link> <gl-link :href="mavenHelpPath" target="_blank">{{ content }}</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
</template> </div>
</installation-tabs>
</template> </template>
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
import { GlLink, GlSprintf } from '@gitlab/ui'; import { GlLink, GlSprintf } from '@gitlab/ui';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import CodeInstruction from './code_instruction.vue'; import CodeInstruction from './code_instruction.vue';
import { NpmManager, TrackingActions, TrackingLabels } from '../constants'; import { NpmManager, TrackingActions } from '../constants';
import { mapGetters, mapState } from 'vuex'; import { mapGetters, mapState } from 'vuex';
import InstallationTabs from './installation_tabs.vue';
export default { export default {
name: 'NpmInstallation', name: 'NpmInstallation',
...@@ -12,7 +11,6 @@ export default { ...@@ -12,7 +11,6 @@ export default {
CodeInstruction, CodeInstruction,
GlLink, GlLink,
GlSprintf, GlSprintf,
InstallationTabs,
}, },
computed: { computed: {
...mapState(['npmHelpPath']), ...mapState(['npmHelpPath']),
...@@ -36,44 +34,40 @@ export default { ...@@ -36,44 +34,40 @@ export default {
), ),
}, },
trackingActions: { ...TrackingActions }, trackingActions: { ...TrackingActions },
trackingLabel: TrackingLabels.NPM_INSTALLATION,
}; };
</script> </script>
<template> <template>
<installation-tabs :tracking-label="$options.trackingLabel"> <div>
<template #installation> <h3 class="gl-font-lg">{{ __('Installation') }}</h3>
<p class="gl-mt-3 font-weight-bold">{{ s__('PackageRegistry|npm') }}</p> <h4 class="gl-font-base">{{ s__('PackageRegistry|npm command') }}</h4>
<code-instruction <code-instruction
:instruction="npmCommand" :instruction="npmCommand"
:copy-text="s__('PackageRegistry|Copy npm command')" :copy-text="s__('PackageRegistry|Copy npm command')"
class="js-npm-install"
:tracking-action="$options.trackingActions.COPY_NPM_INSTALL_COMMAND" :tracking-action="$options.trackingActions.COPY_NPM_INSTALL_COMMAND"
/> />
<p class="gl-mt-3 font-weight-bold">{{ s__('PackageRegistry|yarn') }}</p> <h4 class="gl-font-base">{{ s__('PackageRegistry|yarn command') }}</h4>
<code-instruction <code-instruction
:instruction="yarnCommand" :instruction="yarnCommand"
:copy-text="s__('PackageRegistry|Copy yarn command')" :copy-text="s__('PackageRegistry|Copy yarn command')"
class="js-yarn-install"
:tracking-action="$options.trackingActions.COPY_YARN_INSTALL_COMMAND" :tracking-action="$options.trackingActions.COPY_YARN_INSTALL_COMMAND"
/> />
</template>
<template #setup> <h3 class="gl-font-lg">{{ __('Registry setup') }}</h3>
<p class="gl-mt-3 font-weight-bold">{{ s__('PackageRegistry|npm') }}</p>
<h4 class="gl-font-base">{{ s__('PackageRegistry|npm command') }}</h4>
<code-instruction <code-instruction
:instruction="npmSetup" :instruction="npmSetup"
:copy-text="s__('PackageRegistry|Copy npm setup command')" :copy-text="s__('PackageRegistry|Copy npm setup command')"
class="js-npm-setup"
:tracking-action="$options.trackingActions.COPY_NPM_SETUP_COMMAND" :tracking-action="$options.trackingActions.COPY_NPM_SETUP_COMMAND"
/> />
<p class="gl-mt-3 font-weight-bold">{{ s__('PackageRegistry|yarn') }}</p> <h4 class="gl-font-base">{{ s__('PackageRegistry|yarn command') }}</h4>
<code-instruction <code-instruction
:instruction="yarnSetupCommand" :instruction="yarnSetupCommand"
:copy-text="s__('PackageRegistry|Copy yarn setup command')" :copy-text="s__('PackageRegistry|Copy yarn setup command')"
class="js-yarn-setup"
:tracking-action="$options.trackingActions.COPY_YARN_SETUP_COMMAND" :tracking-action="$options.trackingActions.COPY_YARN_SETUP_COMMAND"
/> />
...@@ -82,6 +76,5 @@ export default { ...@@ -82,6 +76,5 @@ export default {
<gl-link :href="npmHelpPath" target="_blank">{{ content }}</gl-link> <gl-link :href="npmHelpPath" target="_blank">{{ content }}</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
</template> </div>
</installation-tabs>
</template> </template>
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
import { GlLink, GlSprintf } from '@gitlab/ui'; import { GlLink, GlSprintf } from '@gitlab/ui';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import CodeInstruction from './code_instruction.vue'; import CodeInstruction from './code_instruction.vue';
import { TrackingActions, TrackingLabels } from '../constants'; import { TrackingActions } from '../constants';
import { mapGetters, mapState } from 'vuex'; import { mapGetters, mapState } from 'vuex';
import InstallationTabs from './installation_tabs.vue';
export default { export default {
name: 'NugetInstallation', name: 'NugetInstallation',
...@@ -12,7 +11,6 @@ export default { ...@@ -12,7 +11,6 @@ export default {
CodeInstruction, CodeInstruction,
GlLink, GlLink,
GlSprintf, GlSprintf,
InstallationTabs,
}, },
computed: { computed: {
...mapState(['nugetHelpPath']), ...mapState(['nugetHelpPath']),
...@@ -24,30 +22,28 @@ export default { ...@@ -24,30 +22,28 @@ export default {
), ),
}, },
trackingActions: { ...TrackingActions }, trackingActions: { ...TrackingActions },
trackingLabel: TrackingLabels.NUGET_INSTALLATION,
}; };
</script> </script>
<template> <template>
<installation-tabs :tracking-label="$options.trackingLabel"> <div>
<template #installation> <h3 class="gl-font-lg">{{ __('Installation') }}</h3>
<p class="gl-mt-3 font-weight-bold">{{ s__('PackageRegistry|NuGet Command') }}</p> <h4 class="gl-font-base">
{{ s__('PackageRegistry|NuGet Command') }}
</h4>
<code-instruction <code-instruction
:instruction="nugetInstallationCommand" :instruction="nugetInstallationCommand"
:copy-text="s__('PackageRegistry|Copy NuGet Command')" :copy-text="s__('PackageRegistry|Copy NuGet Command')"
class="js-nuget-command"
:tracking-action="$options.trackingActions.COPY_NUGET_INSTALL_COMMAND" :tracking-action="$options.trackingActions.COPY_NUGET_INSTALL_COMMAND"
/> />
</template> <h3 class="gl-font-lg">{{ __('Registry setup') }}</h3>
<h4 class="gl-font-base">
<template #setup>
<p class="gl-mt-3 font-weight-bold">
{{ s__('PackageRegistry|Add NuGet Source') }} {{ s__('PackageRegistry|Add NuGet Source') }}
</p> </h4>
<code-instruction <code-instruction
:instruction="nugetSetupCommand" :instruction="nugetSetupCommand"
:copy-text="s__('PackageRegistry|Copy NuGet Setup Command')" :copy-text="s__('PackageRegistry|Copy NuGet Setup Command')"
class="js-nuget-setup"
:tracking-action="$options.trackingActions.COPY_NUGET_SETUP_COMMAND" :tracking-action="$options.trackingActions.COPY_NUGET_SETUP_COMMAND"
/> />
<gl-sprintf :message="$options.i18n.helpText"> <gl-sprintf :message="$options.i18n.helpText">
...@@ -55,6 +51,5 @@ export default { ...@@ -55,6 +51,5 @@ export default {
<gl-link :href="nugetHelpPath" target="_blank">{{ content }}</gl-link> <gl-link :href="nugetHelpPath" target="_blank">{{ content }}</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
</template> </div>
</installation-tabs>
</template> </template>
...@@ -44,7 +44,7 @@ export default { ...@@ -44,7 +44,7 @@ export default {
<template> <template>
<div class="issuable-discussion"> <div class="issuable-discussion">
<h3 class="gl-font-lg gl-my-3" data-testid="title">{{ __('History') }}</h3> <h3 class="gl-font-lg" data-testid="title">{{ __('History') }}</h3>
<ul class="timeline main-notes-list notes gl-mb-4" data-testid="timeline"> <ul class="timeline main-notes-list notes gl-mb-4" data-testid="timeline">
<history-element icon="clock" data-testid="created-on"> <history-element icon="clock" data-testid="created-on">
<gl-sprintf :message="$options.i18n.createdOn"> <gl-sprintf :message="$options.i18n.createdOn">
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
import { GlLink, GlSprintf } from '@gitlab/ui'; import { GlLink, GlSprintf } from '@gitlab/ui';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import CodeInstruction from './code_instruction.vue'; import CodeInstruction from './code_instruction.vue';
import { TrackingActions, TrackingLabels } from '../constants'; import { TrackingActions } from '../constants';
import { mapGetters, mapState } from 'vuex'; import { mapGetters, mapState } from 'vuex';
import InstallationTabs from './installation_tabs.vue';
export default { export default {
name: 'PyPiInstallation', name: 'PyPiInstallation',
...@@ -12,7 +11,6 @@ export default { ...@@ -12,7 +11,6 @@ export default {
CodeInstruction, CodeInstruction,
GlLink, GlLink,
GlSprintf, GlSprintf,
InstallationTabs,
}, },
computed: { computed: {
...mapState(['pypiHelpPath']), ...mapState(['pypiHelpPath']),
...@@ -27,25 +25,25 @@ export default { ...@@ -27,25 +25,25 @@ export default {
), ),
}, },
trackingActions: { ...TrackingActions }, trackingActions: { ...TrackingActions },
trackingLabel: TrackingLabels.PYPI_INSTALLATION,
}; };
</script> </script>
<template> <template>
<installation-tabs :tracking-label="$options.trackingLabel"> <div>
<template #installation> <h3 class="gl-font-lg">{{ __('Installation') }}</h3>
<p class="gl-mt-3 font-weight-bold">
<h4 class="gl-font-base">
{{ s__('PackageRegistry|Pip Command') }} {{ s__('PackageRegistry|Pip Command') }}
</p> </h4>
<code-instruction <code-instruction
:instruction="pypiPipCommand" :instruction="pypiPipCommand"
:copy-text="s__('PackageRegistry|Copy Pip command')" :copy-text="s__('PackageRegistry|Copy Pip command')"
data-testid="pip-command" data-testid="pip-command"
:tracking-action="$options.trackingActions.COPY_PIP_INSTALL_COMMAND" :tracking-action="$options.trackingActions.COPY_PIP_INSTALL_COMMAND"
/> />
</template>
<template #setup> <h3 class="gl-font-lg">{{ __('Registry setup') }}</h3>
<p> <p>
<gl-sprintf :message="$options.i18n.setupText"> <gl-sprintf :message="$options.i18n.setupText">
<template #code="{ content }"> <template #code="{ content }">
...@@ -53,6 +51,7 @@ export default { ...@@ -53,6 +51,7 @@ export default {
</template> </template>
</gl-sprintf> </gl-sprintf>
</p> </p>
<code-instruction <code-instruction
:instruction="pypiSetupCommand" :instruction="pypiSetupCommand"
:copy-text="s__('PackageRegistry|Copy .pypirc content')" :copy-text="s__('PackageRegistry|Copy .pypirc content')"
...@@ -65,6 +64,5 @@ export default { ...@@ -65,6 +64,5 @@ export default {
<gl-link :href="pypiHelpPath" target="_blank">{{ content }}</gl-link> <gl-link :href="pypiHelpPath" target="_blank">{{ content }}</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
</template> </div>
</installation-tabs>
</template> </template>
...@@ -13037,7 +13037,7 @@ msgstr "" ...@@ -13037,7 +13037,7 @@ msgstr ""
msgid "Install on clusters" msgid "Install on clusters"
msgstr "" msgstr ""
msgid "Installation Commands" msgid "Installation"
msgstr "" msgstr ""
msgid "Installed" msgid "Installed"
...@@ -17158,9 +17158,6 @@ msgstr "" ...@@ -17158,9 +17158,6 @@ msgstr ""
msgid "PackageRegistry|If you haven't already done so, you will need to add the below to your %{codeStart}pom.xml%{codeEnd} file." msgid "PackageRegistry|If you haven't already done so, you will need to add the below to your %{codeStart}pom.xml%{codeEnd} file."
msgstr "" msgstr ""
msgid "PackageRegistry|Installation"
msgstr ""
msgid "PackageRegistry|Is your favorite package manager missing? We'd love your help in building first-class support for it into GitLab! %{contributionLinkStart}Visit the contribution documentation%{contributionLinkEnd} to learn more about how to build support for new package managers into GitLab. Below is a list of package managers that are on our radar." msgid "PackageRegistry|Is your favorite package manager missing? We'd love your help in building first-class support for it into GitLab! %{contributionLinkStart}Visit the contribution documentation%{contributionLinkEnd} to learn more about how to build support for new package managers into GitLab. Below is a list of package managers that are on our radar."
msgstr "" msgstr ""
...@@ -17209,9 +17206,6 @@ msgstr "" ...@@ -17209,9 +17206,6 @@ msgstr ""
msgid "PackageRegistry|Recipe: %{recipe}" msgid "PackageRegistry|Recipe: %{recipe}"
msgstr "" msgstr ""
msgid "PackageRegistry|Registry Setup"
msgstr ""
msgid "PackageRegistry|Remove package" msgid "PackageRegistry|Remove package"
msgstr "" msgstr ""
...@@ -17266,13 +17260,13 @@ msgstr "" ...@@ -17266,13 +17260,13 @@ msgstr ""
msgid "PackageRegistry|composer.json require package include" msgid "PackageRegistry|composer.json require package include"
msgstr "" msgstr ""
msgid "PackageRegistry|npm" msgid "PackageRegistry|npm command"
msgstr "" msgstr ""
msgid "PackageRegistry|published by %{author}" msgid "PackageRegistry|published by %{author}"
msgstr "" msgstr ""
msgid "PackageRegistry|yarn" msgid "PackageRegistry|yarn command"
msgstr "" msgstr ""
msgid "PackageType|Composer" msgid "PackageType|Composer"
...@@ -20034,6 +20028,9 @@ msgstr "" ...@@ -20034,6 +20028,9 @@ msgstr ""
msgid "Registration|Your profile" msgid "Registration|Your profile"
msgstr "" msgstr ""
msgid "Registry setup"
msgstr ""
msgid "Regulate approvals by authors/committers, based on compliance frameworks. Can be changed only at the instance level." msgid "Regulate approvals by authors/committers, based on compliance frameworks. Can be changed only at the instance level."
msgstr "" msgstr ""
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ConanInstallation renders all the messages 1`] = `
<div>
<h3
class="gl-font-lg"
>
Installation
</h3>
<h4
class="gl-font-base"
>
Conan Command
</h4>
<code-instruction-stub
copytext="Copy Conan Command"
instruction="foo/command"
trackingaction="copy_conan_command"
/>
<h3
class="gl-font-lg"
>
Registry setup
</h3>
<h4
class="gl-font-base"
>
Add Conan Remote
</h4>
<code-instruction-stub
copytext="Copy Conan Setup Command"
instruction="foo/setup"
trackingaction="copy_conan_setup_command"
/>
<gl-sprintf-stub
message="For more information on the Conan registry, %{linkStart}see the documentation%{linkEnd}."
/>
</div>
`;
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`MavenInstallation renders all the messages 1`] = `
<div>
<h3
class="gl-font-lg"
>
Installation
</h3>
<h4
class="gl-font-base"
>
Maven XML
</h4>
<p>
<gl-sprintf-stub
message="Copy and paste this inside your %{codeStart}pom.xml%{codeEnd} %{codeStart}dependencies%{codeEnd} block."
/>
</p>
<code-instruction-stub
copytext="Copy Maven XML"
instruction="foo/xml"
multiline="true"
trackingaction="copy_maven_xml"
/>
<h4
class="gl-font-base"
>
Maven Command
</h4>
<code-instruction-stub
copytext="Copy Maven command"
instruction="foo/command"
trackingaction="copy_maven_command"
/>
<h3
class="gl-font-lg"
>
Registry setup
</h3>
<p>
<gl-sprintf-stub
message="If you haven't already done so, you will need to add the below to your %{codeStart}pom.xml%{codeEnd} file."
/>
</p>
<code-instruction-stub
copytext="Copy Maven registry XML"
instruction="foo/setup"
multiline="true"
trackingaction="copy_maven_setup_xml"
/>
<gl-sprintf-stub
message="For more information on the Maven registry, %{linkStart}see the documentation%{linkEnd}."
/>
</div>
`;
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`NpmInstallation renders all the messages 1`] = `
<div>
<h3
class="gl-font-lg"
>
Installation
</h3>
<h4
class="gl-font-base"
>
npm command
</h4>
<code-instruction-stub
copytext="Copy npm command"
instruction="npm i @Test/package"
trackingaction="copy_npm_install_command"
/>
<h4
class="gl-font-base"
>
yarn command
</h4>
<code-instruction-stub
copytext="Copy yarn command"
instruction="yarn add @Test/package"
trackingaction="copy_yarn_install_command"
/>
<h3
class="gl-font-lg"
>
Registry setup
</h3>
<h4
class="gl-font-base"
>
npm command
</h4>
<code-instruction-stub
copytext="Copy npm setup command"
instruction="echo @Test:registry=undefined >> .npmrc"
trackingaction="copy_npm_setup_command"
/>
<h4
class="gl-font-base"
>
yarn command
</h4>
<code-instruction-stub
copytext="Copy yarn setup command"
instruction="echo \\\\\\"@Test:registry\\\\\\" \\\\\\"undefined\\\\\\" >> .yarnrc"
trackingaction="copy_yarn_setup_command"
/>
<gl-sprintf-stub
message="You may also need to setup authentication using an auth token. %{linkStart}See the documentation%{linkEnd} to find out more."
/>
</div>
`;
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`NugetInstallation renders all the messages 1`] = `
<div>
<h3
class="gl-font-lg"
>
Installation
</h3>
<h4
class="gl-font-base"
>
NuGet Command
</h4>
<code-instruction-stub
copytext="Copy NuGet Command"
instruction="foo/command"
trackingaction="copy_nuget_install_command"
/>
<h3
class="gl-font-lg"
>
Registry setup
</h3>
<h4
class="gl-font-base"
>
Add NuGet Source
</h4>
<code-instruction-stub
copytext="Copy NuGet Setup Command"
instruction="foo/setup"
trackingaction="copy_nuget_setup_command"
/>
<gl-sprintf-stub
message="For more information on the NuGet registry, %{linkStart}see the documentation%{linkEnd}."
/>
</div>
`;
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`PypiInstallation renders all the messages 1`] = `
<div>
<h3
class="gl-font-lg"
>
Installation
</h3>
<h4
class="gl-font-base"
>
Pip Command
</h4>
<code-instruction-stub
copytext="Copy Pip command"
data-testid="pip-command"
instruction="pip install"
trackingaction="copy_pip_install_command"
/>
<h3
class="gl-font-lg"
>
Registry setup
</h3>
<p>
<gl-sprintf-stub
message="If you haven't already done so, you will need to add the below to your %{codeStart}.pypirc%{codeEnd} file."
/>
</p>
<code-instruction-stub
copytext="Copy .pypirc content"
data-testid="pypi-setup-content"
instruction="python setup"
multiline="true"
trackingaction="copy_pypi_setup_command"
/>
<gl-sprintf-stub
message="For more information on the PyPi registry, %{linkStart}see the documentation%{linkEnd}."
/>
</div>
`;
import Vuex from 'vuex'; import Vuex from 'vuex';
import { mount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import ConanInstallation from '~/packages/details/components/conan_installation.vue'; import ConanInstallation from '~/packages/details/components/conan_installation.vue';
import CodeInstructions from '~/packages/details/components/code_instruction.vue';
import { conanPackage as packageEntity } from '../../mock_data'; import { conanPackage as packageEntity } from '../../mock_data';
import { registryUrl as conanPath } from '../mock_data'; import { registryUrl as conanPath } from '../mock_data';
import { GlTabs } from '@gitlab/ui';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
...@@ -25,12 +25,10 @@ describe('ConanInstallation', () => { ...@@ -25,12 +25,10 @@ describe('ConanInstallation', () => {
}, },
}); });
const findTabs = () => wrapper.find(GlTabs); const findCodeInstructions = () => wrapper.findAll(CodeInstructions);
const conanInstallationCommand = () => wrapper.find('.js-conan-command > input');
const conanSetupCommand = () => wrapper.find('.js-conan-setup > input');
function createComponent() { function createComponent() {
wrapper = mount(ConanInstallation, { wrapper = shallowMount(ConanInstallation, {
localVue, localVue,
store, store,
}); });
...@@ -44,21 +42,27 @@ describe('ConanInstallation', () => { ...@@ -44,21 +42,27 @@ describe('ConanInstallation', () => {
if (wrapper) wrapper.destroy(); if (wrapper) wrapper.destroy();
}); });
describe('it renders', () => { it('renders all the messages', () => {
it('with GlTabs', () => { expect(wrapper.element).toMatchSnapshot();
expect(findTabs().exists()).toBe(true);
});
}); });
describe('installation commands', () => { describe('installation commands', () => {
it('renders the correct command', () => { it('renders the correct command', () => {
expect(conanInstallationCommand().element.value).toBe(conanInstallationCommandStr); expect(
findCodeInstructions()
.at(0)
.props('instruction'),
).toBe(conanInstallationCommandStr);
}); });
}); });
describe('setup commands', () => { describe('setup commands', () => {
it('renders the correct command', () => { it('renders the correct command', () => {
expect(conanSetupCommand().element.value).toBe(conanSetupCommandStr); expect(
findCodeInstructions()
.at(1)
.props('instruction'),
).toBe(conanSetupCommandStr);
}); });
}); });
}); });
import { mount } from '@vue/test-utils';
import InstallationTabs from '~/packages/details/components/installation_tabs.vue';
import Tracking from '~/tracking';
import { TrackingActions } from '~/packages/details/constants';
describe('InstallationTabs', () => {
let wrapper;
let eventSpy;
const trackingLabel = 'foo';
function createComponent() {
wrapper = mount(InstallationTabs, {
propsData: {
trackingLabel,
},
});
}
const installationTab = () => wrapper.find('.js-installation-tab > a');
const setupTab = () => wrapper.find('.js-setup-tab > a');
beforeEach(() => {
eventSpy = jest.spyOn(Tracking, 'event');
createComponent();
});
afterEach(() => {
wrapper.destroy();
wrapper = null;
});
describe('tab change tracking', () => {
it('should track when the setup tab is clicked', () => {
setupTab().trigger('click');
return wrapper.vm.$nextTick().then(() => {
expect(eventSpy).toHaveBeenCalledWith(undefined, TrackingActions.REGISTRY_SETUP, {
label: trackingLabel,
});
});
});
it('should track when the installation tab is clicked', () => {
setupTab().trigger('click');
return wrapper.vm
.$nextTick()
.then(() => {
installationTab().trigger('click');
})
.then(() => {
expect(eventSpy).toHaveBeenCalledWith(undefined, TrackingActions.INSTALLATION, {
label: trackingLabel,
});
});
});
});
});
import Vuex from 'vuex'; import Vuex from 'vuex';
import { mount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import MavenInstallation from '~/packages/details/components/maven_installation.vue'; import MavenInstallation from '~/packages/details/components/maven_installation.vue';
import { registryUrl as mavenPath } from '../mock_data'; import CodeInstructions from '~/packages/details/components/code_instruction.vue';
import { mavenPackage as packageEntity } from '../../mock_data'; import { registryUrl as mavenPath } from 'jest/packages/details/mock_data';
import { GlTabs } from '@gitlab/ui'; import { mavenPackage as packageEntity } from 'jest/packages/mock_data';
import { TrackingActions } from '~/packages/details/constants';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
...@@ -27,13 +28,10 @@ describe('MavenInstallation', () => { ...@@ -27,13 +28,10 @@ describe('MavenInstallation', () => {
}, },
}); });
const findTabs = () => wrapper.find(GlTabs); const findCodeInstructions = () => wrapper.findAll(CodeInstructions);
const xmlCode = () => wrapper.find('.js-maven-xml > pre');
const mavenCommand = () => wrapper.find('.js-maven-command > input');
const xmlSetup = () => wrapper.find('.js-maven-setup-xml > pre');
function createComponent() { function createComponent() {
wrapper = mount(MavenInstallation, { wrapper = shallowMount(MavenInstallation, {
localVue, localVue,
store, store,
}); });
...@@ -47,25 +45,47 @@ describe('MavenInstallation', () => { ...@@ -47,25 +45,47 @@ describe('MavenInstallation', () => {
if (wrapper) wrapper.destroy(); if (wrapper) wrapper.destroy();
}); });
describe('it renders', () => { it('renders all the messages', () => {
it('with GlTabs', () => { expect(wrapper.element).toMatchSnapshot();
expect(findTabs().exists()).toBe(true);
});
}); });
describe('installation commands', () => { describe('installation commands', () => {
it('renders the correct xml block', () => { it('renders the correct xml block', () => {
expect(xmlCode().text()).toBe(xmlCodeBlock); expect(
findCodeInstructions()
.at(0)
.props(),
).toMatchObject({
instruction: xmlCodeBlock,
multiline: true,
trackingAction: TrackingActions.COPY_MAVEN_XML,
});
}); });
it('renders the correct maven command', () => { it('renders the correct maven command', () => {
expect(mavenCommand().element.value).toBe(mavenCommandStr); expect(
findCodeInstructions()
.at(1)
.props(),
).toMatchObject({
instruction: mavenCommandStr,
multiline: false,
trackingAction: TrackingActions.COPY_MAVEN_COMMAND,
});
}); });
}); });
describe('setup commands', () => { describe('setup commands', () => {
it('renders the correct xml block', () => { it('renders the correct xml block', () => {
expect(xmlSetup().text()).toBe(mavenSetupXml); expect(
findCodeInstructions()
.at(2)
.props(),
).toMatchObject({
instruction: mavenSetupXml,
multiline: true,
trackingAction: TrackingActions.COPY_MAVEN_SETUP,
});
}); });
}); });
}); });
import Vuex from 'vuex'; import Vuex from 'vuex';
import { mount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import NpmInstallation from '~/packages/details/components/npm_installation.vue'; import NpmInstallation from '~/packages/details/components/npm_installation.vue';
import { npmPackage as packageEntity } from '../../mock_data'; import CodeInstructions from '~/packages/details/components/code_instruction.vue';
import { registryUrl as nugetPath } from '../mock_data'; import { npmPackage as packageEntity } from 'jest/packages/mock_data';
import { GlTabs } from '@gitlab/ui'; import { registryUrl as nugetPath } from 'jest/packages/details/mock_data';
import { TrackingActions } from '~/packages/details/constants';
import { npmInstallationCommand, npmSetupCommand } from '~/packages/details/store/getters';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
...@@ -11,30 +13,21 @@ localVue.use(Vuex); ...@@ -11,30 +13,21 @@ localVue.use(Vuex);
describe('NpmInstallation', () => { describe('NpmInstallation', () => {
let wrapper; let wrapper;
const npmCommandStr = 'npm install'; const findCodeInstructions = () => wrapper.findAll(CodeInstructions);
const npmSetupStr = 'npm setup';
const yarnCommandStr = 'npm install';
const yarnSetupStr = 'npm setup';
const findTabs = () => wrapper.find(GlTabs); function createComponent() {
const npmInstallationCommand = () => wrapper.find('.js-npm-install > input');
const npmSetupCommand = () => wrapper.find('.js-npm-setup > input');
const yarnInstallationCommand = () => wrapper.find('.js-yarn-install > input');
const yarnSetupCommand = () => wrapper.find('.js-yarn-setup > input');
function createComponent(yarn = false) {
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
packageEntity, packageEntity,
nugetPath, nugetPath,
}, },
getters: { getters: {
npmInstallationCommand: () => () => (yarn ? yarnCommandStr : npmCommandStr), npmInstallationCommand,
npmSetupCommand: () => () => (yarn ? yarnSetupStr : npmSetupStr), npmSetupCommand,
}, },
}); });
wrapper = mount(NpmInstallation, { wrapper = shallowMount(NpmInstallation, {
localVue, localVue,
store, store,
}); });
...@@ -48,33 +41,59 @@ describe('NpmInstallation', () => { ...@@ -48,33 +41,59 @@ describe('NpmInstallation', () => {
if (wrapper) wrapper.destroy(); if (wrapper) wrapper.destroy();
}); });
describe('it renders', () => { it('renders all the messages', () => {
it('with GlTabs', () => { expect(wrapper.element).toMatchSnapshot();
expect(findTabs().exists()).toBe(true);
});
}); });
describe('npm commands', () => { describe('installation commands', () => {
it('renders the correct install command', () => { it('renders the correct npm command', () => {
expect(npmInstallationCommand().element.value).toBe(npmCommandStr); expect(
findCodeInstructions()
.at(0)
.props(),
).toMatchObject({
instruction: 'npm i @Test/package',
multiline: false,
trackingAction: TrackingActions.COPY_NPM_INSTALL_COMMAND,
});
}); });
it('renders the correct setup command', () => { it('renders the correct yarn command', () => {
expect(npmSetupCommand().element.value).toBe(npmSetupStr); expect(
findCodeInstructions()
.at(1)
.props(),
).toMatchObject({
instruction: 'yarn add @Test/package',
multiline: false,
trackingAction: TrackingActions.COPY_YARN_INSTALL_COMMAND,
}); });
}); });
describe('yarn commands', () => {
beforeEach(() => {
createComponent(true);
}); });
it('renders the correct install command', () => { describe('setup commands', () => {
expect(yarnInstallationCommand().element.value).toBe(yarnCommandStr); it('renders the correct npm command', () => {
expect(
findCodeInstructions()
.at(2)
.props(),
).toMatchObject({
instruction: 'echo @Test:registry=undefined >> .npmrc',
multiline: false,
trackingAction: TrackingActions.COPY_NPM_SETUP_COMMAND,
});
}); });
it('renders the correct setup command', () => { it('renders the correct yarn command', () => {
expect(yarnSetupCommand().element.value).toBe(yarnSetupStr); expect(
findCodeInstructions()
.at(3)
.props(),
).toMatchObject({
instruction: 'echo \\"@Test:registry\\" \\"undefined\\" >> .yarnrc',
multiline: false,
trackingAction: TrackingActions.COPY_YARN_SETUP_COMMAND,
});
}); });
}); });
}); });
import Vuex from 'vuex'; import Vuex from 'vuex';
import { mount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import NugetInstallation from '~/packages/details/components/nuget_installation.vue'; import NugetInstallation from '~/packages/details/components/nuget_installation.vue';
import { nugetPackage as packageEntity } from '../../mock_data'; import CodeInstructions from '~/packages/details/components/code_instruction.vue';
import { registryUrl as nugetPath } from '../mock_data'; import { nugetPackage as packageEntity } from 'jest/packages/mock_data';
import { GlTabs } from '@gitlab/ui'; import { registryUrl as nugetPath } from 'jest/packages/details/mock_data';
import { TrackingActions } from '~/packages/details/constants';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
...@@ -25,12 +26,10 @@ describe('NugetInstallation', () => { ...@@ -25,12 +26,10 @@ describe('NugetInstallation', () => {
}, },
}); });
const findTabs = () => wrapper.find(GlTabs); const findCodeInstructions = () => wrapper.findAll(CodeInstructions);
const nugetInstallationCommand = () => wrapper.find('.js-nuget-command > input');
const nugetSetupCommand = () => wrapper.find('.js-nuget-setup > input');
function createComponent() { function createComponent() {
wrapper = mount(NugetInstallation, { wrapper = shallowMount(NugetInstallation, {
localVue, localVue,
store, store,
}); });
...@@ -44,21 +43,33 @@ describe('NugetInstallation', () => { ...@@ -44,21 +43,33 @@ describe('NugetInstallation', () => {
if (wrapper) wrapper.destroy(); if (wrapper) wrapper.destroy();
}); });
describe('it renders', () => { it('renders all the messages', () => {
it('with GlTabs', () => { expect(wrapper.element).toMatchSnapshot();
expect(findTabs().exists()).toBe(true);
});
}); });
describe('installation commands', () => { describe('installation commands', () => {
it('renders the correct command', () => { it('renders the correct command', () => {
expect(nugetInstallationCommand().element.value).toBe(nugetInstallationCommandStr); expect(
findCodeInstructions()
.at(0)
.props(),
).toMatchObject({
instruction: nugetInstallationCommandStr,
trackingAction: TrackingActions.COPY_NUGET_INSTALL_COMMAND,
});
}); });
}); });
describe('setup commands', () => { describe('setup commands', () => {
it('renders the correct command', () => { it('renders the correct command', () => {
expect(nugetSetupCommand().element.value).toBe(nugetSetupCommandStr); expect(
findCodeInstructions()
.at(1)
.props(),
).toMatchObject({
instruction: nugetSetupCommandStr,
trackingAction: TrackingActions.COPY_NUGET_SETUP_COMMAND,
});
}); });
}); });
}); });
import Vuex from 'vuex'; import Vuex from 'vuex';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import PypiInstallation from '~/packages/details/components/pypi_installation.vue'; import PypiInstallation from '~/packages/details/components/pypi_installation.vue';
import InstallationTabs from '~/packages/details/components/installation_tabs.vue'; import { pypiPackage as packageEntity } from 'jest/packages/mock_data';
import { pypiPackage as packageEntity } from '../../mock_data';
import { GlTabs } from '@gitlab/ui';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
...@@ -25,7 +23,6 @@ describe('PypiInstallation', () => { ...@@ -25,7 +23,6 @@ describe('PypiInstallation', () => {
}, },
}); });
const findTabs = () => wrapper.find(GlTabs);
const pipCommand = () => wrapper.find('[data-testid="pip-command"]'); const pipCommand = () => wrapper.find('[data-testid="pip-command"]');
const setupInstruction = () => wrapper.find('[data-testid="pypi-setup-content"]'); const setupInstruction = () => wrapper.find('[data-testid="pypi-setup-content"]');
...@@ -33,9 +30,6 @@ describe('PypiInstallation', () => { ...@@ -33,9 +30,6 @@ describe('PypiInstallation', () => {
wrapper = shallowMount(PypiInstallation, { wrapper = shallowMount(PypiInstallation, {
localVue, localVue,
store, store,
stubs: {
InstallationTabs,
},
}); });
} }
...@@ -48,10 +42,8 @@ describe('PypiInstallation', () => { ...@@ -48,10 +42,8 @@ describe('PypiInstallation', () => {
wrapper = null; wrapper = null;
}); });
describe('it renders', () => { it('renders all the messages', () => {
it('with GlTabs', () => { expect(wrapper.element).toMatchSnapshot();
expect(findTabs().exists()).toBe(true);
});
}); });
describe('installation commands', () => { describe('installation commands', () => {
......
...@@ -38,7 +38,7 @@ RSpec.shared_examples 'package details link' do |property| ...@@ -38,7 +38,7 @@ RSpec.shared_examples 'package details link' do |property|
page.within('[data-qa-selector="package_information_content"]') do page.within('[data-qa-selector="package_information_content"]') do
expect(page).to have_content('Installation') expect(page).to have_content('Installation')
expect(page).to have_content('Registry Setup') expect(page).to have_content('Registry setup')
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment