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
0b9cd0a1
Commit
0b9cd0a1
authored
Aug 03, 2016
by
Annabel Dunstone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Populate dropdowns with current build on pageload
parent
f97939a7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
app/assets/javascripts/build.js
app/assets/javascripts/build.js
+16
-2
app/views/projects/builds/show.html.haml
app/views/projects/builds/show.html.haml
+1
-1
No files found.
app/assets/javascripts/build.js
View file @
0b9cd0a1
...
...
@@ -6,7 +6,7 @@
Build
.
state
=
null
;
function
Build
(
page_url
,
build_url
,
build_status
,
state1
)
{
function
Build
(
page_url
,
build_url
,
build_status
,
build_stage
,
build_name
,
state1
)
{
this
.
page_url
=
page_url
;
this
.
build_url
=
build_url
;
this
.
build_status
=
build_status
;
...
...
@@ -17,7 +17,12 @@
clearInterval
(
Build
.
interval
);
this
.
bp
=
Breakpoints
.
get
();
$
(
'
.js-build-sidebar
'
).
niceScroll
();
this
.
populateJobDropdown
(
build_stage
);
this
.
updateStageDropdownText
(
build_stage
);
this
.
updateJobDropdownText
(
build_name
);
this
.
hideSidebar
();
$
(
document
).
off
(
'
click
'
,
'
.js-sidebar-build-toggle
'
).
on
(
'
click
'
,
'
.js-sidebar-build-toggle
'
,
this
.
toggleSidebar
);
$
(
window
).
off
(
'
resize.build
'
).
on
(
'
resize.build
'
,
this
.
hideSidebar
);
$
(
document
).
on
(
'
click
'
,
'
.stage-item
'
,
this
.
updateDropdown
);
...
...
@@ -139,10 +144,19 @@
$
(
'
.build-job[data-stage="
'
+
stage
+
'
"]
'
).
show
();
};
Build
.
prototype
.
updateStageDropdownText
=
function
(
stage
)
{
$
(
'
.stage-selection
'
).
text
(
stage
);
this
.
updateJobDropdownText
(
'
-
'
);
};
Build
.
prototype
.
updateJobDropdownText
=
function
(
name
)
{
$
(
'
.build-selection
'
).
text
(
name
);
};
Build
.
prototype
.
updateDropdown
=
function
(
e
)
{
e
.
preventDefault
();
var
stage
=
e
.
target
.
text
;
$
(
'
.stage-selection
'
).
t
ext
(
stage
);
this
.
updateStageDropdownT
ext
(
stage
);
this
.
populateJobDropdown
(
stage
);
};
...
...
app/views/projects/builds/show.html.haml
View file @
0b9cd0a1
...
...
@@ -82,4 +82,4 @@
=
render
"sidebar"
:javascript
new
Build
(
"
#{
namespace_project_build_url
(
@project
.
namespace
,
@project
,
@build
)
}
"
,
"
#{
namespace_project_build_url
(
@project
.
namespace
,
@project
,
@build
,
:json
)
}
"
,
"
#{
@build
.
status
}
"
,
"
#{
trace_with_state
[
:state
]
}
"
)
new
Build
(
"
#{
namespace_project_build_url
(
@project
.
namespace
,
@project
,
@build
)
}
"
,
"
#{
namespace_project_build_url
(
@project
.
namespace
,
@project
,
@build
,
:json
)
}
"
,
"
#{
@build
.
status
}
"
,
"
#{
@build
.
stage
}
"
,
"
#{
@build
.
name
}
"
,
"
#{
trace_with_state
[
:state
]
}
"
)
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