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
e7a6531b
Commit
e7a6531b
authored
Jan 18, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move archived component to vue file
parent
d7c7061a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
39 deletions
+60
-39
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_archived.js
...ge_request_widget/components/states/mr_widget_archived.js
+0
-26
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_archived.vue
...e_request_widget/components/states/mr_widget_archived.vue
+31
-0
app/assets/javascripts/vue_merge_request_widget/dependencies.js
...sets/javascripts/vue_merge_request_widget/dependencies.js
+1
-1
app/assets/javascripts/vue_merge_request_widget/index.js
app/assets/javascripts/vue_merge_request_widget/index.js
+3
-0
spec/javascripts/vue_mr_widget/components/states/mr_widget_archived_spec.js
...ue_mr_widget/components/states/mr_widget_archived_spec.js
+25
-12
No files found.
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_archived.js
deleted
100644 → 0
View file @
d7c7061a
import
statusIcon
from
'
../mr_widget_status_icon
'
;
export
default
{
name
:
'
MRWidgetArchived
'
,
components
:
{
statusIcon
,
},
template
:
`
<div class="mr-widget-body media">
<div class="space-children">
<status-icon status="failed" />
<button
type="button"
class="btn btn-success btn-sm"
disabled="true">
Merge
</button>
</div>
<div class="media-body">
<span class="bold">
This project is archived, write access has been disabled
</span>
</div>
</div>
`
,
};
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_archived.vue
0 → 100644
View file @
e7a6531b
<
script
>
import
statusIcon
from
'
../mr_widget_status_icon
'
;
export
default
{
name
:
'
MRWidgetArchived
'
,
components
:
{
statusIcon
,
},
};
</
script
>
<
template
>
<div
class=
"mr-widget-body media"
>
<div
class=
"space-children"
>
<status-icon
status=
"failed"
/>
<button
type=
"button"
class=
"btn btn-success btn-sm"
disabled=
"true"
>
{{
s__
(
"
mrWidget|Merge
"
)
}}
</button>
</div>
<div
class=
"media-body"
>
<span
class=
"bold"
>
{{
s__
(
"
mrWidget|This project is archived, write access has been disabled
"
)
}}
</span>
</div>
</div>
</
template
>
app/assets/javascripts/vue_merge_request_widget/dependencies.js
View file @
e7a6531b
...
@@ -21,7 +21,7 @@ export { default as FailedToMerge } from './components/states/mr_widget_failed_t
...
@@ -21,7 +21,7 @@ export { default as FailedToMerge } from './components/states/mr_widget_failed_t
export
{
default
as
ClosedState
}
from
'
./components/states/mr_widget_closed
'
;
export
{
default
as
ClosedState
}
from
'
./components/states/mr_widget_closed
'
;
export
{
default
as
MergingState
}
from
'
./components/states/mr_widget_merging
'
;
export
{
default
as
MergingState
}
from
'
./components/states/mr_widget_merging
'
;
export
{
default
as
WipState
}
from
'
./components/states/mr_widget_wip
'
;
export
{
default
as
WipState
}
from
'
./components/states/mr_widget_wip
'
;
export
{
default
as
ArchivedState
}
from
'
./components/states/mr_widget_archived
'
;
export
{
default
as
ArchivedState
}
from
'
./components/states/mr_widget_archived
.vue
'
;
export
{
default
as
ConflictsState
}
from
'
./components/states/mr_widget_conflicts
'
;
export
{
default
as
ConflictsState
}
from
'
./components/states/mr_widget_conflicts
'
;
export
{
default
as
NothingToMergeState
}
from
'
./components/states/mr_widget_nothing_to_merge
'
;
export
{
default
as
NothingToMergeState
}
from
'
./components/states/mr_widget_nothing_to_merge
'
;
export
{
default
as
MissingBranchState
}
from
'
./components/states/mr_widget_missing_branch
'
;
export
{
default
as
MissingBranchState
}
from
'
./components/states/mr_widget_missing_branch
'
;
...
...
app/assets/javascripts/vue_merge_request_widget/index.js
View file @
e7a6531b
...
@@ -2,6 +2,9 @@ import {
...
@@ -2,6 +2,9 @@ import {
Vue
,
Vue
,
mrWidgetOptions
,
mrWidgetOptions
,
}
from
'
./dependencies
'
;
}
from
'
./dependencies
'
;
import
Translate
from
'
../vue_shared/translate
'
;
Vue
.
use
(
Translate
);
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
gl
.
mrWidgetData
.
gitlabLogo
=
gon
.
gitlab_logo
;
gl
.
mrWidgetData
.
gitlabLogo
=
gon
.
gitlab_logo
;
...
...
spec/javascripts/vue_mr_widget/components/states/mr_widget_archived_spec.js
View file @
e7a6531b
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
archivedComponent
from
'
~/vue_merge_request_widget/components/states/mr_widget_archived
'
;
import
archivedComponent
from
'
~/vue_merge_request_widget/components/states/mr_widget_archived.vue
'
;
import
mountComponent
from
'
../../../helpers/vue_mount_component_helper
'
;
describe
(
'
MRWidgetArchived
'
,
()
=>
{
describe
(
'
MRWidgetArchived
'
,
()
=>
{
describe
(
'
template
'
,
()
=>
{
let
vm
;
it
(
'
should have correct elements
'
,
()
=>
{
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
archivedComponent
);
const
Component
=
Vue
.
extend
(
archivedComponent
);
const
el
=
new
Component
({
vm
=
mountComponent
(
Component
);
el
:
document
.
createElement
(
'
div
'
),
});
}).
$el
;
afterEach
(()
=>
{
vm
.
$destroy
();
});
expect
(
el
.
classList
.
contains
(
'
mr-widget-body
'
)).
toBeTruthy
();
it
(
'
renders a ci status failed icon
'
,
()
=>
{
expect
(
el
.
querySelector
(
'
button
'
).
classList
.
contains
(
'
btn-success
'
)).
toBeTruthy
();
expect
(
vm
.
$el
.
querySelector
(
'
.ci-status-icon
'
)).
not
.
toBeNull
();
expect
(
el
.
querySelector
(
'
button
'
).
disabled
).
toBeTruthy
();
expect
(
el
.
innerText
).
toContain
(
'
This project is archived, write access has been disabled
'
);
});
});
it
(
'
renders a disabled button
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
button
'
).
getAttribute
(
'
disabled
'
)).
toEqual
(
'
disabled
'
);
expect
(
vm
.
$el
.
querySelector
(
'
button
'
).
textContent
.
trim
()).
toEqual
(
'
Merge
'
);
});
it
(
'
renders information
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.bold
'
).
textContent
.
trim
(),
).
toEqual
(
'
This project is archived, write access has been disabled
'
);
});
});
});
});
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