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
a140976a
Commit
a140976a
authored
Feb 12, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-02-12
parents
9e37c293
7611ec4e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
92 additions
and
82 deletions
+92
-82
app/assets/javascripts/ci_variable_list/ci_variable_list.js
app/assets/javascripts/ci_variable_list/ci_variable_list.js
+1
-1
app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.js
...sidebar/components/time_tracking/sidebar_time_tracking.js
+2
-2
app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue
...scripts/sidebar/components/time_tracking/time_tracker.vue
+77
-72
app/views/ci/variables/_variable_row.html.haml
app/views/ci/variables/_variable_row.html.haml
+1
-1
changelogs/unreleased/refactor-move-issuable-time-tracker-vue-component.yml
...sed/refactor-move-issuable-time-tracker-vue-component.yml
+5
-0
spec/javascripts/ci_variable_list/ci_variable_list_spec.js
spec/javascripts/ci_variable_list/ci_variable_list_spec.js
+1
-1
spec/javascripts/issuable_time_tracker_spec.js
spec/javascripts/issuable_time_tracker_spec.js
+1
-1
spec/support/features/variable_list_shared_examples.rb
spec/support/features/variable_list_shared_examples.rb
+4
-4
No files found.
app/assets/javascripts/ci_variable_list/ci_variable_list.js
View file @
a140976a
...
...
@@ -39,7 +39,7 @@ export default class VariableList {
},
protected
:
{
selector
:
'
.js-ci-variable-input-protected
'
,
default
:
'
tru
e
'
,
default
:
'
fals
e
'
,
},
environment_scope
:
{
// We can't use a `.js-` class here because
...
...
app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.js
View file @
a140976a
...
...
@@ -2,7 +2,7 @@ import _ from 'underscore';
import
'
~/smart_interval
'
;
import
timeTracker
from
'
./time_tracker
'
;
import
IssuableTimeTracker
from
'
./time_tracker.vue
'
;
import
Store
from
'
../../stores/sidebar_store
'
;
import
Mediator
from
'
../../sidebar_mediator
'
;
...
...
@@ -16,7 +16,7 @@ export default {
};
},
components
:
{
'
issuable-time-tracker
'
:
t
imeTracker
,
IssuableT
imeTracker
,
},
methods
:
{
listenForQuickActions
()
{
...
...
app/assets/javascripts/sidebar/components/time_tracking/time_tracker.
js
→
app/assets/javascripts/sidebar/components/time_tracking/time_tracker.
vue
View file @
a140976a
<
script
>
import
timeTrackingHelpState
from
'
./help_state
'
;
import
timeTrackingCollapsedState
from
'
./collapsed_state
'
;
import
timeTrackingSpentOnlyPane
from
'
./spent_only_pane
'
;
...
...
@@ -8,7 +9,15 @@ import timeTrackingComparisonPane from './comparison_pane';
import
eventHub
from
'
../../event_hub
'
;
export
default
{
name
:
'
issuable-time-tracker
'
,
name
:
'
IssuableTimeTracker
'
,
components
:
{
'
time-tracking-collapsed-state
'
:
timeTrackingCollapsedState
,
'
time-tracking-estimate-only-pane
'
:
timeTrackingEstimateOnlyPane
,
'
time-tracking-spent-only-pane
'
:
timeTrackingSpentOnlyPane
,
'
time-tracking-no-tracking-pane
'
:
timeTrackingNoTrackingPane
,
'
time-tracking-comparison-pane
'
:
timeTrackingComparisonPane
,
'
time-tracking-help-state
'
:
timeTrackingHelpState
,
},
props
:
{
time_estimate
:
{
type
:
Number
,
...
...
@@ -38,14 +47,6 @@ export default {
showHelp
:
false
,
};
},
components
:
{
'
time-tracking-collapsed-state
'
:
timeTrackingCollapsedState
,
'
time-tracking-estimate-only-pane
'
:
timeTrackingEstimateOnlyPane
,
'
time-tracking-spent-only-pane
'
:
timeTrackingSpentOnlyPane
,
'
time-tracking-no-tracking-pane
'
:
timeTrackingNoTrackingPane
,
'
time-tracking-comparison-pane
'
:
timeTrackingComparisonPane
,
'
time-tracking-help-state
'
:
timeTrackingHelpState
,
},
computed
:
{
timeSpent
()
{
return
this
.
time_spent
;
...
...
@@ -81,6 +82,9 @@ export default {
return
!!
this
.
showHelp
;
},
},
created
()
{
eventHub
.
$on
(
'
timeTracker:updateData
'
,
this
.
update
);
},
methods
:
{
toggleHelpState
(
show
)
{
this
.
showHelp
=
show
;
...
...
@@ -92,72 +96,73 @@ export default {
this
.
human_time_spent
=
data
.
human_time_spent
;
},
},
created
()
{
eventHub
.
$on
(
'
timeTracker:updateData
'
,
this
.
update
);
},
template
:
`
<div
class="time_tracker time-tracking-component-wrap"
v-cloak
>
<time-tracking-collapsed-state
:show-comparison-state="showComparisonState"
:show-no-time-tracking-state="showNoTimeTrackingState"
:show-help-state="showHelpState"
:show-spent-only-state="showSpentOnlyState"
:show-estimate-only-state="showEstimateOnlyState"
};
</
script
>
<
template
>
<div
class=
"time_tracker time-tracking-component-wrap"
v-cloak
>
<time-tracking-collapsed-state
:show-comparison-state=
"showComparisonState"
:show-no-time-tracking-state=
"showNoTimeTrackingState"
:show-help-state=
"showHelpState"
:show-spent-only-state=
"showSpentOnlyState"
:show-estimate-only-state=
"showEstimateOnlyState"
:time-spent-human-readable=
"timeSpentHumanReadable"
:time-estimate-human-readable=
"timeEstimateHumanReadable"
/>
<div
class=
"title hide-collapsed"
>
{{
__
(
'
Time tracking
'
)
}}
<div
class=
"help-button pull-right"
v-if=
"!showHelpState"
@
click=
"toggleHelpState(true)"
>
<i
class=
"fa fa-question-circle"
aria-hidden=
"true"
>
</i>
</div>
<div
class=
"close-help-button pull-right"
v-if=
"showHelpState"
@
click=
"toggleHelpState(false)"
>
<i
class=
"fa fa-close"
aria-hidden=
"true"
>
</i>
</div>
</div>
<div
class=
"time-tracking-content hide-collapsed"
>
<time-tracking-estimate-only-pane
v-if=
"showEstimateOnlyState"
:time-estimate-human-readable=
"timeEstimateHumanReadable"
/>
<time-tracking-spent-only-pane
v-if=
"showSpentOnlyState"
:time-spent-human-readable=
"timeSpentHumanReadable"
/>
<time-tracking-no-tracking-pane
v-if=
"showNoTimeTrackingState"
/>
<time-tracking-comparison-pane
v-if=
"showComparisonState"
:time-estimate=
"timeEstimate"
:time-spent=
"timeSpent"
:time-spent-human-readable=
"timeSpentHumanReadable"
:time-estimate-human-readable=
"timeEstimateHumanReadable"
/>
<div class="title hide-collapsed">
{{ __('Time tracking') }}
<div
class="help-button pull-right"
v-if="!showHelpState"
@click="toggleHelpState(true)"
>
<i
class="fa fa-question-circle"
aria-hidden="true"
/>
</div>
<div
class="close-help-button pull-right"
<transition
name=
"help-state-toggle"
>
<time-tracking-help-state
v-if=
"showHelpState"
@click="toggleHelpState(false)"
>
<i
class="fa fa-close"
aria-hidden="true"
/>
</div>
</div>
<div class="time-tracking-content hide-collapsed">
<time-tracking-estimate-only-pane
v-if="showEstimateOnlyState"
:time-estimate-human-readable="timeEstimateHumanReadable"
:root-path=
"rootPath"
/>
<time-tracking-spent-only-pane
v-if="showSpentOnlyState"
:time-spent-human-readable="timeSpentHumanReadable"
/>
<time-tracking-no-tracking-pane
v-if="showNoTimeTrackingState"
/>
<time-tracking-comparison-pane
v-if="showComparisonState"
:time-estimate="timeEstimate"
:time-spent="timeSpent"
:time-spent-human-readable="timeSpentHumanReadable"
:time-estimate-human-readable="timeEstimateHumanReadable"
/>
<transition name="help-state-toggle">
<time-tracking-help-state
v-if="showHelpState"
:rootPath="rootPath"
/>
</transition>
</div>
</transition>
</div>
`
,
};
</div>
</
template
>
app/views/ci/variables/_variable_row.html.haml
View file @
a140976a
...
...
@@ -5,7 +5,7 @@
-
id
=
variable
&
.
id
-
key
=
variable
&
.
key
-
value
=
variable
&
.
value
-
is_protected
=
variable
&&
!
only_key_value
?
variable
.
protected
:
tru
e
-
is_protected
=
variable
&&
!
only_key_value
?
variable
.
protected
:
fals
e
-
id_input_name
=
"
#{
form_field
}
[variables_attributes][][id]"
-
destroy_input_name
=
"
#{
form_field
}
[variables_attributes][][_destroy]"
...
...
changelogs/unreleased/refactor-move-issuable-time-tracker-vue-component.yml
0 → 100644
View file @
a140976a
---
title
:
Move IssuableTimeTracker vue component
merge_request
:
16948
author
:
George Tsiolis
type
:
performance
spec/javascripts/ci_variable_list/ci_variable_list_spec.js
View file @
a140976a
...
...
@@ -126,7 +126,7 @@ describe('VariableList', () => {
// Check for the correct default in the new row
const
$protectedInput
=
$wrapper
.
find
(
'
.js-row:last-child
'
).
find
(
'
.js-ci-variable-input-protected
'
);
expect
(
$protectedInput
.
val
()).
toBe
(
'
tru
e
'
);
expect
(
$protectedInput
.
val
()).
toBe
(
'
fals
e
'
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
...
...
spec/javascripts/issuable_time_tracker_spec.js
View file @
a140976a
...
...
@@ -2,7 +2,7 @@
import
Vue
from
'
vue
'
;
import
timeTracker
from
'
~/sidebar/components/time_tracking/time_tracker
'
;
import
timeTracker
from
'
~/sidebar/components/time_tracking/time_tracker
.vue
'
;
function
initTimeTrackingComponent
(
opts
)
{
setFixtures
(
`
...
...
spec/support/features/variable_list_shared_examples.rb
View file @
a140976a
...
...
@@ -41,13 +41,13 @@ shared_examples 'variable list' do
end
end
it
'adds new
un
protected variable'
do
it
'adds new protected variable'
do
page
.
within
(
'.js-ci-variable-list-section .js-row:last-child'
)
do
find
(
'.js-ci-variable-input-key'
).
set
(
'key'
)
find
(
'.js-ci-variable-input-value'
).
set
(
'key value'
)
find
(
'.ci-variable-protected-item .js-project-feature-toggle'
).
click
expect
(
find
(
'.js-ci-variable-input-protected'
,
visible:
false
).
value
).
to
eq
(
'
fals
e'
)
expect
(
find
(
'.js-ci-variable-input-protected'
,
visible:
false
).
value
).
to
eq
(
'
tru
e'
)
end
click_button
(
'Save variables'
)
...
...
@@ -59,7 +59,7 @@ shared_examples 'variable list' do
page
.
within
(
'.js-ci-variable-list-section .js-row:nth-child(1)'
)
do
expect
(
find
(
'.js-ci-variable-input-key'
).
value
).
to
eq
(
'key'
)
expect
(
find
(
'.js-ci-variable-input-value'
,
visible:
false
).
value
).
to
eq
(
'key value'
)
expect
(
find
(
'.js-ci-variable-input-protected'
,
visible:
false
).
value
).
to
eq
(
'
fals
e'
)
expect
(
find
(
'.js-ci-variable-input-protected'
,
visible:
false
).
value
).
to
eq
(
'
tru
e'
)
end
end
...
...
@@ -143,7 +143,6 @@ shared_examples 'variable list' do
page
.
within
(
'.js-ci-variable-list-section .js-row:last-child'
)
do
find
(
'.js-ci-variable-input-key'
).
set
(
'unprotected_key'
)
find
(
'.js-ci-variable-input-value'
).
set
(
'unprotected_value'
)
find
(
'.ci-variable-protected-item .js-project-feature-toggle'
).
click
expect
(
find
(
'.js-ci-variable-input-protected'
,
visible:
false
).
value
).
to
eq
(
'false'
)
end
...
...
@@ -178,6 +177,7 @@ shared_examples 'variable list' do
page
.
within
(
'.js-ci-variable-list-section .js-row:last-child'
)
do
find
(
'.js-ci-variable-input-key'
).
set
(
'protected_key'
)
find
(
'.js-ci-variable-input-value'
).
set
(
'protected_value'
)
find
(
'.ci-variable-protected-item .js-project-feature-toggle'
).
click
expect
(
find
(
'.js-ci-variable-input-protected'
,
visible:
false
).
value
).
to
eq
(
'true'
)
end
...
...
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