2
2
import { GlLink , GlSprintf , GlFormRadioGroup } from ' @gitlab/ui' ;
3
3
import { s__ } from ' ~/locale' ;
4
4
5
- import InstallationTitle from ' ~/packages_and_registries/package_registry/components/details/installation_title .vue' ;
5
+ import InstallationMethod from ' ~/packages_and_registries/package_registry/components/details/installation_method .vue' ;
6
6
import {
7
7
TRACKING_ACTION_COPY_NPM_INSTALL_COMMAND ,
8
8
TRACKING_ACTION_COPY_NPM_SETUP_COMMAND ,
@@ -21,7 +21,7 @@ import CodeInstruction from '~/vue_shared/components/registry/code_instruction.v
21
21
export default {
22
22
name: ' NpmInstallation' ,
23
23
components: {
24
- InstallationTitle ,
24
+ InstallationMethod ,
25
25
CodeInstruction,
26
26
GlLink,
27
27
GlSprintf,
@@ -81,7 +81,7 @@ export default {
81
81
return ` echo ${ scope} :registry=${ npmPathForEndpoint} / >> .npmrc` ;
82
82
}
83
83
84
- return ` echo \\ " ${ scope} :registry\\ " \\ " ${ npmPathForEndpoint} /\\ " >> .yarnrc` ;
84
+ return ` echo ${ scope} :registry ${ npmPathForEndpoint} / >> .yarnrc` ;
85
85
},
86
86
},
87
87
packageManagers: {
@@ -98,11 +98,14 @@ export default {
98
98
helpText: s__ (
99
99
' PackageRegistry|You may also need to setup authentication using an auth token. %{linkStart}See the documentation%{linkEnd} to find out more.' ,
100
100
),
101
+ npmInstallCommandLabel: s__ (' PackageRegistry|npm install command' ),
102
+ yarnInstallCommandLabel: s__ (' PackageRegistry|Yarn install command' ),
103
+ registrySetupCommand: s__ (' PackageRegistry|Registry setup command' ),
101
104
},
102
105
links: { NPM_HELP_PATH },
103
106
installOptions: [
104
- { value: NPM_PACKAGE_MANAGER , label: s__ (' PackageRegistry|Show NPM commands ' ) },
105
- { value: YARN_PACKAGE_MANAGER , label: s__ (' PackageRegistry|Show Yarn commands ' ) },
107
+ { value: NPM_PACKAGE_MANAGER , label: s__ (' PackageRegistry|npm ' ) },
108
+ { value: YARN_PACKAGE_MANAGER , label: s__ (' PackageRegistry|Yarn' ) },
106
109
],
107
110
packageEndpointTypeOptions: [
108
111
{ value: INSTANCE_PACKAGE_ENDPOINT_TYPE , text: s__ (' PackageRegistry|Instance-level' ) },
@@ -114,7 +117,7 @@ export default {
114
117
115
118
<template >
116
119
<div >
117
- <installation-title
120
+ <installation-method
118
121
:package-type =" $options.packageManagers.NPM_PACKAGE_MANAGER"
119
122
:options =" $options.installOptions"
120
123
@change =" instructionType = $event"
@@ -123,6 +126,7 @@ export default {
123
126
<code-instruction
124
127
v-if =" showNpm"
125
128
:instruction =" npmCommand"
129
+ :label =" $options.i18n.npmInstallCommandLabel"
126
130
:copy-text =" s__('PackageRegistry|Copy npm command')"
127
131
:tracking-action =" $options.tracking.TRACKING_ACTION_COPY_NPM_INSTALL_COMMAND"
128
132
:tracking-label =" $options.tracking.TRACKING_LABEL_CODE_INSTRUCTION"
@@ -131,14 +135,16 @@ export default {
131
135
<code-instruction
132
136
v-else
133
137
:instruction =" yarnCommand"
138
+ :label =" $options.i18n.yarnInstallCommandLabel"
134
139
:copy-text =" s__('PackageRegistry|Copy yarn command')"
135
140
:tracking-action =" $options.tracking.TRACKING_ACTION_COPY_YARN_INSTALL_COMMAND"
136
141
:tracking-label =" $options.tracking.TRACKING_LABEL_CODE_INSTRUCTION"
137
142
/>
138
143
139
- <h3 class =" gl-text-lg " >{{ __(' Registry setup') }}</h3 >
144
+ <h3 class =" gl-heading-3 gl-mt-5 " >{{ s__('PackageRegistry| Registry setup') }}</h3 >
140
145
141
146
<gl-form-radio-group
147
+ class =" gl-my-5"
142
148
:options =" $options.packageEndpointTypeOptions"
143
149
:checked =" packageEndpointType"
144
150
@change =" packageEndpointType = $event"
@@ -147,6 +153,7 @@ export default {
147
153
<code-instruction
148
154
v-if =" showNpm"
149
155
:instruction =" npmSetup"
156
+ :label =" $options.i18n.registrySetupCommand"
150
157
:copy-text =" s__('PackageRegistry|Copy npm setup command')"
151
158
:tracking-action =" $options.tracking.TRACKING_ACTION_COPY_NPM_SETUP_COMMAND"
152
159
:tracking-label =" $options.tracking.TRACKING_LABEL_CODE_INSTRUCTION"
@@ -155,6 +162,7 @@ export default {
155
162
<code-instruction
156
163
v-else
157
164
:instruction =" yarnSetupCommand"
165
+ :label =" $options.i18n.registrySetupCommand"
158
166
:copy-text =" s__('PackageRegistry|Copy yarn setup command')"
159
167
:tracking-action =" $options.tracking.TRACKING_ACTION_COPY_YARN_SETUP_COMMAND"
160
168
:tracking-label =" $options.tracking.TRACKING_LABEL_CODE_INSTRUCTION"
0 commit comments