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
ef7e75c4
Commit
ef7e75c4
authored
Jul 21, 2020
by
Enrique Alcantara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Saved Content Changes component
parent
00b75ff4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
135 deletions
+0
-135
app/assets/javascripts/static_site_editor/components/saved_changes_message.vue
...s/static_site_editor/components/saved_changes_message.vue
+0
-79
spec/frontend/static_site_editor/components/saved_changes_message_spec.js
...atic_site_editor/components/saved_changes_message_spec.js
+0
-56
No files found.
app/assets/javascripts/static_site_editor/components/saved_changes_message.vue
deleted
100644 → 0
View file @
00b75ff4
<
script
>
import
{
isString
}
from
'
lodash
'
;
import
{
GlLink
,
GlButton
}
from
'
@gitlab/ui
'
;
const
validateUrlAndLabel
=
value
=>
isString
(
value
.
label
)
&&
isString
(
value
.
url
);
export
default
{
components
:
{
GlLink
,
GlButton
,
},
props
:
{
branch
:
{
type
:
Object
,
required
:
true
,
validator
:
validateUrlAndLabel
,
},
commit
:
{
type
:
Object
,
required
:
true
,
validator
:
validateUrlAndLabel
,
},
mergeRequest
:
{
type
:
Object
,
required
:
true
,
validator
:
validateUrlAndLabel
,
},
returnUrl
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
},
};
</
script
>
<
template
>
<div>
<div
class=
"border-bottom pb-4"
>
<h3>
{{
s__
(
'
StaticSiteEditor|Success!
'
)
}}
</h3>
<p>
{{
s__
(
'
StaticSiteEditor|Your changes have been submitted and a merge request has been created. The changes won’t be visible on the site until the merge request has been accepted.
'
,
)
}}
</p>
<div
class=
"d-flex justify-content-end"
>
<gl-button
v-if=
"returnUrl"
ref=
"returnToSiteButton"
:href=
"returnUrl"
>
{{
s__
(
'
StaticSiteEditor|Return to site
'
)
}}
</gl-button>
<gl-button
ref=
"mergeRequestButton"
class=
"ml-2"
:href=
"mergeRequest.url"
variant=
"success"
>
{{
s__
(
'
StaticSiteEditor|View merge request
'
)
}}
</gl-button>
</div>
</div>
<div
class=
"pt-2"
>
<h4>
{{
s__
(
'
StaticSiteEditor|Summary of changes
'
)
}}
</h4>
<ul>
<li>
{{
s__
(
'
StaticSiteEditor|You created a new branch:
'
)
}}
<gl-link
ref=
"branchLink"
:href=
"branch.url"
>
{{
branch
.
label
}}
</gl-link>
</li>
<li>
{{
s__
(
'
StaticSiteEditor|You created a merge request:
'
)
}}
<gl-link
ref=
"mergeRequestLink"
:href=
"mergeRequest.url"
>
{{
mergeRequest
.
label
}}
</gl-link>
</li>
<li>
{{
s__
(
'
StaticSiteEditor|You added a commit:
'
)
}}
<gl-link
ref=
"commitLink"
:href=
"commit.url"
>
{{
commit
.
label
}}
</gl-link>
</li>
</ul>
</div>
</div>
</
template
>
spec/frontend/static_site_editor/components/saved_changes_message_spec.js
deleted
100644 → 0
View file @
00b75ff4
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
SavedChangesMessage
from
'
~/static_site_editor/components/saved_changes_message.vue
'
;
import
{
returnUrl
,
savedContentMeta
}
from
'
../mock_data
'
;
describe
(
'
~/static_site_editor/components/saved_changes_message.vue
'
,
()
=>
{
let
wrapper
;
const
{
branch
,
commit
,
mergeRequest
}
=
savedContentMeta
;
const
props
=
{
branch
,
commit
,
mergeRequest
,
returnUrl
,
};
const
findReturnToSiteButton
=
()
=>
wrapper
.
find
({
ref
:
'
returnToSiteButton
'
});
const
findMergeRequestButton
=
()
=>
wrapper
.
find
({
ref
:
'
mergeRequestButton
'
});
const
findBranchLink
=
()
=>
wrapper
.
find
({
ref
:
'
branchLink
'
});
const
findCommitLink
=
()
=>
wrapper
.
find
({
ref
:
'
commitLink
'
});
const
findMergeRequestLink
=
()
=>
wrapper
.
find
({
ref
:
'
mergeRequestLink
'
});
beforeEach
(()
=>
{
wrapper
=
shallowMount
(
SavedChangesMessage
,
{
propsData
:
props
,
});
});
afterEach
(()
=>
{
wrapper
.
destroy
();
});
it
.
each
`
text | findEl | url
${
'
Return to site
'
}
|
${
findReturnToSiteButton
}
|
${
props
.
returnUrl
}
${
'
View merge request
'
}
|
${
findMergeRequestButton
}
|
${
props
.
mergeRequest
.
url
}
`
(
'
renders "$text" button link
'
,
({
text
,
findEl
,
url
})
=>
{
const
btn
=
findEl
();
expect
(
btn
.
exists
()).
toBe
(
true
);
expect
(
btn
.
text
()).
toBe
(
text
);
expect
(
btn
.
attributes
(
'
href
'
)).
toBe
(
url
);
});
it
.
each
`
desc | findEl | prop
${
'
branch
'
}
|
${
findBranchLink
}
|
${
props
.
branch
}
${
'
commit
'
}
|
${
findCommitLink
}
|
${
props
.
commit
}
${
'
merge request
'
}
|
${
findMergeRequestLink
}
|
${
props
.
mergeRequest
}
`
(
'
renders $desc link
'
,
({
findEl
,
prop
})
=>
{
const
el
=
findEl
();
expect
(
el
.
exists
()).
toBe
(
true
);
expect
(
el
.
text
()).
toBe
(
prop
.
label
);
expect
(
el
.
attributes
(
'
href
'
)).
toBe
(
prop
.
url
);
});
});
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