Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
03d9c36b
Commit
03d9c36b
authored
Sep 15, 2020
by
Nicolò Maria Mezzopera
Committed by
Enrique Alcántara
Sep 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix npm command getter
- source - tests
parent
eacdaa70
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
8 deletions
+13
-8
app/assets/javascripts/packages/details/store/getters.js
app/assets/javascripts/packages/details/store/getters.js
+2
-2
changelogs/unreleased/243550-missing-slash-in-registry-setup-section-of-npm-module-in-gitlab-re.yml
...-in-registry-setup-section-of-npm-module-in-gitlab-re.yml
+5
-0
spec/frontend/packages/details/components/__snapshots__/npm_installation_spec.js.snap
...ls/components/__snapshots__/npm_installation_spec.js.snap
+2
-2
spec/frontend/packages/details/components/npm_installation_spec.js
...tend/packages/details/components/npm_installation_spec.js
+2
-2
spec/frontend/packages/details/store/getters_spec.js
spec/frontend/packages/details/store/getters_spec.js
+2
-2
No files found.
app/assets/javascripts/packages/details/store/getters.js
View file @
03d9c36b
...
@@ -84,10 +84,10 @@ export const npmSetupCommand = ({ packageEntity, npmPath }) => (type = NpmManage
...
@@ -84,10 +84,10 @@ export const npmSetupCommand = ({ packageEntity, npmPath }) => (type = NpmManage
const
scope
=
packageEntity
.
name
.
substring
(
0
,
packageEntity
.
name
.
indexOf
(
'
/
'
));
const
scope
=
packageEntity
.
name
.
substring
(
0
,
packageEntity
.
name
.
indexOf
(
'
/
'
));
if
(
type
===
NpmManager
.
NPM
)
{
if
(
type
===
NpmManager
.
NPM
)
{
return
`echo
${
scope
}
:registry=
${
npmPath
}
>> .npmrc`
;
return
`echo
${
scope
}
:registry=
${
npmPath
}
/
>> .npmrc`
;
}
}
return
`echo \\"
${
scope
}
:registry\\" \\"
${
npmPath
}
\\" >> .yarnrc`
;
return
`echo \\"
${
scope
}
:registry\\" \\"
${
npmPath
}
/
\\" >> .yarnrc`
;
};
};
export
const
nugetInstallationCommand
=
({
packageEntity
})
=>
export
const
nugetInstallationCommand
=
({
packageEntity
})
=>
...
...
changelogs/unreleased/243550-missing-slash-in-registry-setup-section-of-npm-module-in-gitlab-re.yml
0 → 100644
View file @
03d9c36b
---
title
:
Add Missing slash in 'Registry setup' section of npm packages
merge_request
:
42360
author
:
type
:
changed
spec/frontend/packages/details/components/__snapshots__/npm_installation_spec.js.snap
View file @
03d9c36b
...
@@ -32,7 +32,7 @@ exports[`NpmInstallation renders all the messages 1`] = `
...
@@ -32,7 +32,7 @@ exports[`NpmInstallation renders all the messages 1`] = `
<code-instruction-stub
<code-instruction-stub
copytext="Copy npm setup command"
copytext="Copy npm setup command"
instruction="echo @Test:registry=undefined >> .npmrc"
instruction="echo @Test:registry=undefined
/
>> .npmrc"
label="npm command"
label="npm command"
trackingaction="copy_npm_setup_command"
trackingaction="copy_npm_setup_command"
trackinglabel="code_instruction"
trackinglabel="code_instruction"
...
@@ -40,7 +40,7 @@ exports[`NpmInstallation renders all the messages 1`] = `
...
@@ -40,7 +40,7 @@ exports[`NpmInstallation renders all the messages 1`] = `
<code-instruction-stub
<code-instruction-stub
copytext="Copy yarn setup command"
copytext="Copy yarn setup command"
instruction="echo \\\\\\"@Test:registry\\\\\\" \\\\\\"undefined\\\\\\" >> .yarnrc"
instruction="echo \\\\\\"@Test:registry\\\\\\" \\\\\\"undefined
/
\\\\\\" >> .yarnrc"
label="yarn command"
label="yarn command"
trackingaction="copy_yarn_setup_command"
trackingaction="copy_yarn_setup_command"
trackinglabel="code_instruction"
trackinglabel="code_instruction"
...
...
spec/frontend/packages/details/components/npm_installation_spec.js
View file @
03d9c36b
...
@@ -78,7 +78,7 @@ describe('NpmInstallation', () => {
...
@@ -78,7 +78,7 @@ describe('NpmInstallation', () => {
.
at
(
2
)
.
at
(
2
)
.
props
(),
.
props
(),
).
toMatchObject
({
).
toMatchObject
({
instruction
:
'
echo @Test:registry=undefined >> .npmrc
'
,
instruction
:
'
echo @Test:registry=undefined
/
>> .npmrc
'
,
multiline
:
false
,
multiline
:
false
,
trackingAction
:
TrackingActions
.
COPY_NPM_SETUP_COMMAND
,
trackingAction
:
TrackingActions
.
COPY_NPM_SETUP_COMMAND
,
});
});
...
@@ -90,7 +90,7 @@ describe('NpmInstallation', () => {
...
@@ -90,7 +90,7 @@ describe('NpmInstallation', () => {
.
at
(
3
)
.
at
(
3
)
.
props
(),
.
props
(),
).
toMatchObject
({
).
toMatchObject
({
instruction
:
'
echo
\\
"@Test:registry
\\
"
\\
"undefined
\\
" >> .yarnrc
'
,
instruction
:
'
echo
\\
"@Test:registry
\\
"
\\
"undefined
/
\\
" >> .yarnrc
'
,
multiline
:
false
,
multiline
:
false
,
trackingAction
:
TrackingActions
.
COPY_YARN_SETUP_COMMAND
,
trackingAction
:
TrackingActions
.
COPY_YARN_SETUP_COMMAND
,
});
});
...
...
spec/frontend/packages/details/store/getters_spec.js
View file @
03d9c36b
...
@@ -62,9 +62,9 @@ describe('Getters PackageDetails Store', () => {
...
@@ -62,9 +62,9 @@ describe('Getters PackageDetails Store', () => {
const
mavenSetupXmlBlock
=
generateMavenSetupXml
();
const
mavenSetupXmlBlock
=
generateMavenSetupXml
();
const
npmInstallStr
=
`npm i
${
npmPackage
.
name
}
`
;
const
npmInstallStr
=
`npm i
${
npmPackage
.
name
}
`
;
const
npmSetupStr
=
`echo @Test:registry=
${
registryUrl
}
>> .npmrc`
;
const
npmSetupStr
=
`echo @Test:registry=
${
registryUrl
}
/
>> .npmrc`
;
const
yarnInstallStr
=
`yarn add
${
npmPackage
.
name
}
`
;
const
yarnInstallStr
=
`yarn add
${
npmPackage
.
name
}
`
;
const
yarnSetupStr
=
`echo \\"@Test:registry\\" \\"
${
registryUrl
}
\\" >> .yarnrc`
;
const
yarnSetupStr
=
`echo \\"@Test:registry\\" \\"
${
registryUrl
}
/
\\" >> .yarnrc`
;
const
nugetInstallationCommandStr
=
`nuget install
${
nugetPackage
.
name
}
-Source "GitLab"`
;
const
nugetInstallationCommandStr
=
`nuget install
${
nugetPackage
.
name
}
-Source "GitLab"`
;
const
nugetSetupCommandStr
=
`nuget source Add -Name "GitLab" -Source "
${
registryUrl
}
" -UserName <your_username> -Password <your_token>`
;
const
nugetSetupCommandStr
=
`nuget source Add -Name "GitLab" -Source "
${
registryUrl
}
" -UserName <your_username> -Password <your_token>`
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment