BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
15cb13ee
Commit
15cb13ee
authored
Nov 21, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '38869-milestone' into 'master'
Export code as ES6 modules See merge request gitlab-org/gitlab-ce!15503
parents
ea07773d
030de8b3
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
50 additions
and
83 deletions
+50
-83
blob_bundle.js
app/assets/javascripts/blob_edit/blob_bundle.js
+1
-2
dispatcher.js
app/assets/javascripts/dispatcher.js
+3
-4
init_legacy_filters.js
app/assets/javascripts/init_legacy_filters.js
+2
-3
issuable_bulk_update_sidebar.js
app/assets/javascripts/issuable_bulk_update_sidebar.js
+2
-3
main.js
app/assets/javascripts/main.js
+0
-6
milestone.js
app/assets/javascripts/milestone.js
+11
-16
new_branch_form.js
app/assets/javascripts/new_branch_form.js
+12
-16
new_commit_form.js
app/assets/javascripts/new_commit_form.js
+5
-9
subscription_select.js
app/assets/javascripts/subscription_select.js
+13
-22
new_branch_spec.js
spec/javascripts/new_branch_spec.js
+1
-2
No files found.
app/assets/javascripts/blob_edit/blob_bundle.js
View file @
15cb13ee
/* eslint-disable func-names, space-before-function-paren, prefer-arrow-callback, no-var, quotes, vars-on-top, no-unused-vars, no-new, max-len */
/* global EditBlob */
/* global NewCommitForm */
import
NewCommitForm
from
'../new_commit_form'
;
import
EditBlob
from
'./edit_blob'
;
import
BlobFileDropzone
from
'../blob/blob_file_dropzone'
;
...
...
app/assets/javascripts/dispatcher.js
View file @
15cb13ee
...
...
@@ -2,11 +2,11 @@
import
{
s__
}
from
'./locale'
;
import
projectSelect
from
'./project_select'
;
import
IssuableIndex
from
'./issuable_index'
;
/* global Milestone */
import
Milestone
from
'./milestone'
;
import
IssuableForm
from
'./issuable_form'
;
import
LabelsSelect
from
'./labels_select'
;
/* global MilestoneSelect */
/* global NewBranchForm */
import
NewBranchForm
from
'./new_branch_form'
;
/* global NotificationsForm */
/* global NotificationsDropdown */
import
groupAvatar
from
'./group_avatar'
;
...
...
@@ -18,8 +18,7 @@ import groupsSelect from './groups_select';
/* global Search */
/* global Admin */
import
NamespaceSelect
from
'./namespace_select'
;
/* global NewCommitForm */
/* global NewBranchForm */
import
NewCommitForm
from
'./new_commit_form'
;
import
Project
from
'./project'
;
import
projectAvatar
from
'./project_avatar'
;
/* global MergeRequest */
...
...
app/assets/javascripts/init_legacy_filters.js
View file @
15cb13ee
/* eslint-disable no-new */
import
LabelsSelect
from
'./labels_select'
;
/* global MilestoneSelect */
/* global SubscriptionSelect */
import
subscriptionSelect
from
'./subscription_select'
;
import
UsersSelect
from
'./users_select'
;
import
issueStatusSelect
from
'./issue_status_select'
;
...
...
@@ -11,5 +10,5 @@ export default () => {
new
LabelsSelect
();
new
MilestoneSelect
();
issueStatusSelect
();
new
S
ubscriptionSelect
();
s
ubscriptionSelect
();
};
app/assets/javascripts/issuable_bulk_update_sidebar.js
View file @
15cb13ee
/* eslint-disable class-methods-use-this, no-new */
/* global MilestoneSelect */
/* global SubscriptionSelect */
import
IssuableBulkUpdateActions
from
'./issuable_bulk_update_actions'
;
import
'./milestone_select'
;
import
issueStatusSelect
from
'./issue_status_select'
;
import
'./subscription_select'
;
import
subscriptionSelect
from
'./subscription_select'
;
import
LabelsSelect
from
'./labels_select'
;
const
HIDDEN_CLASS
=
'hidden'
;
...
...
@@ -48,7 +47,7 @@ export default class IssuableBulkUpdateSidebar {
new
LabelsSelect
();
new
MilestoneSelect
();
issueStatusSelect
();
new
S
ubscriptionSelect
();
s
ubscriptionSelect
();
}
setupBulkUpdateActions
()
{
...
...
app/assets/javascripts/main.js
View file @
15cb13ee
...
...
@@ -58,11 +58,7 @@ import './line_highlighter';
import
initLogoAnimation
from
'./logo'
;
import
'./merge_request'
;
import
'./merge_request_tabs'
;
import
'./milestone'
;
import
'./milestone_select'
;
import
'./namespace_select'
;
import
'./new_branch_form'
;
import
'./new_commit_form'
;
import
'./notes'
;
import
'./notifications_dropdown'
;
import
'./notifications_form'
;
...
...
@@ -78,8 +74,6 @@ import './render_gfm';
import
'./right_sidebar'
;
import
'./search'
;
import
'./search_autocomplete'
;
import
'./smart_interval'
;
import
'./subscription_select'
;
import
initBreadcrumbs
from
'./breadcrumb'
;
import
'./dispatcher'
;
...
...
app/assets/javascripts/milestone.js
View file @
15cb13ee
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-use-before-define, camelcase, quotes, object-shorthand, no-shadow, no-unused-vars, comma-dangle, no-var, prefer-template, no-underscore-dangle, consistent-return, one-var, one-var-declaration-per-line, default-case, prefer-arrow-callback, max-len */
/* global Sortable */
import
Flash
from
'./flash'
;
(
function
()
{
this
.
Milestone
=
(
function
()
{
function
Milestone
()
{
export
default
class
Milestone
{
constructor
()
{
this
.
bindTabsSwitching
();
// Load merge request tab if it is active
...
...
@@ -15,24 +13,24 @@ import Flash from './flash';
this
.
loadInitialTab
();
}
Milestone
.
prototype
.
bindTabsSwitching
=
function
()
{
bindTabsSwitching
()
{
return
$
(
'a[data-toggle="tab"]'
).
on
(
'show.bs.tab'
,
(
e
)
=>
{
const
$target
=
$
(
e
.
target
);
location
.
hash
=
$target
.
attr
(
'href'
);
this
.
loadTab
(
$target
);
});
};
Milestone
.
prototype
.
loadInitialTab
=
function
()
{
}
// eslint-disable-next-line class-methods-use-this
loadInitialTab
()
{
const
$target
=
$
(
`.js-milestone-tabs a[href="
${
location
.
hash
}
"]`
);
if
(
$target
.
length
)
{
$target
.
tab
(
'show'
);
}
};
Milestone
.
prototype
.
loadTab
=
function
(
$target
)
{
}
// eslint-disable-next-line class-methods-use-this
loadTab
(
$target
)
{
const
endpoint
=
$target
.
data
(
'endpoint'
);
const
tabElId
=
$target
.
attr
(
'href'
);
...
...
@@ -47,8 +45,5 @@ import Flash from './flash';
$target
.
addClass
(
'is-loaded'
);
});
}
};
return
Milestone
;
})();
}).
call
(
window
);
}
}
app/assets/javascripts/new_branch_form.js
View file @
15cb13ee
/* eslint-disable func-names, space-before-function-paren, no-var, one-var, prefer-rest-params, max-len, vars-on-top, wrap-iife, consistent-return, comma-dangle, one-var-declaration-per-line, quotes, no-return-assign, prefer-arrow-callback, prefer-template, no-shadow, no-else-return, max-len, object-shorthand */
import
RefSelectDropdown
from
'
~
/ref_select_dropdown'
;
import
RefSelectDropdown
from
'
.
/ref_select_dropdown'
;
(
function
()
{
this
.
NewBranchForm
=
(
function
()
{
function
NewBranchForm
(
form
,
availableRefs
)
{
export
default
class
NewBranchForm
{
constructor
(
form
,
availableRefs
)
{
this
.
validate
=
this
.
validate
.
bind
(
this
);
this
.
branchNameError
=
form
.
find
(
'.js-branch-name-error'
);
this
.
name
=
form
.
find
(
'.js-branch-name'
);
...
...
@@ -14,17 +13,17 @@ import RefSelectDropdown from '~/ref_select_dropdown';
this
.
init
();
}
NewBranchForm
.
prototype
.
addBinding
=
function
()
{
addBinding
()
{
return
this
.
name
.
on
(
'blur'
,
this
.
validate
);
};
}
NewBranchForm
.
prototype
.
init
=
function
()
{
init
()
{
if
(
this
.
name
.
length
&&
this
.
name
.
val
().
length
>
0
)
{
return
this
.
name
.
trigger
(
'blur'
);
}
};
}
NewBranchForm
.
prototype
.
setupRestrictions
=
function
()
{
setupRestrictions
()
{
var
endsWith
,
invalid
,
single
,
startsWith
;
startsWith
=
{
pattern
:
/^
(\/
|
\.)
/g
,
...
...
@@ -47,9 +46,9 @@ import RefSelectDropdown from '~/ref_select_dropdown';
conjunction
:
"or"
};
return
this
.
restrictions
=
[
startsWith
,
invalid
,
endsWith
,
single
];
};
}
NewBranchForm
.
prototype
.
validate
=
function
()
{
validate
()
{
var
errorMessage
,
errors
,
formatter
,
unique
,
validator
;
const
indexOf
=
[].
indexOf
;
...
...
@@ -90,8 +89,5 @@ import RefSelectDropdown from '~/ref_select_dropdown';
errorMessage
=
$
(
"<span/>"
).
text
(
errors
.
join
(
', '
));
return
this
.
branchNameError
.
append
(
errorMessage
);
}
};
return
NewBranchForm
;
})();
}).
call
(
window
);
}
}
app/assets/javascripts/new_commit_form.js
View file @
15cb13ee
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-return-assign, max-len */
(
function
()
{
this
.
NewCommitForm
=
(
function
()
{
function
NewCommitForm
(
form
)
{
export
default
class
NewCommitForm
{
constructor
(
form
)
{
this
.
form
=
form
;
this
.
renderDestination
=
this
.
renderDestination
.
bind
(
this
);
this
.
branchName
=
form
.
find
(
'.js-branch-name'
);
...
...
@@ -12,7 +11,7 @@
this
.
renderDestination
();
}
NewCommitForm
.
prototype
.
renderDestination
=
func
tion
()
{
renderDestina
tion
()
{
var
different
;
different
=
this
.
branchName
.
val
()
!==
this
.
originalBranch
.
val
();
if
(
different
)
{
...
...
@@ -25,8 +24,5 @@
this
.
createMergeRequest
.
prop
(
'checked'
,
false
);
}
return
this
.
wasDifferent
=
different
;
};
return
NewCommitForm
;
})();
}).
call
(
window
);
}
}
app/assets/javascripts/subscription_select.js
View file @
15cb13ee
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, quotes, object-shorthand, no-unused-vars, no-shadow, one-var, one-var-declaration-per-line, comma-dangle, max-len */
export
default
function
subscriptionSelect
()
{
$
(
'.js-subscription-event'
).
each
((
i
,
element
)
=>
{
const
fieldName
=
$
(
element
).
data
(
'field-name'
);
class
SubscriptionSelect
{
constructor
()
{
$
(
'.js-subscription-event'
).
each
(
function
(
i
,
el
)
{
var
fieldName
;
fieldName
=
$
(
el
).
data
(
"field-name"
);
return
$
(
el
).
glDropdown
({
return
$
(
element
).
glDropdown
({
selectable
:
true
,
fieldName
:
fieldName
,
toggleLabel
:
(
function
(
_this
)
{
return
function
(
selected
,
el
,
instance
)
{
var
$item
,
label
;
label
=
'Subscription'
;
$item
=
instance
.
dropdown
.
find
(
'.is-active'
);
fieldName
,
toggleLabel
(
selected
,
el
,
instance
)
{
let
label
=
'Subscription'
;
const
$item
=
instance
.
dropdown
.
find
(
'.is-active'
);
if
(
$item
.
length
)
{
label
=
$item
.
text
();
}
return
label
;
};
})(
this
),
clicked
:
function
(
options
)
{
},
clicked
(
options
)
{
return
options
.
e
.
preventDefault
();
},
id
:
function
(
obj
,
el
)
{
return
$
(
el
).
data
(
"id"
);
}
id
(
obj
,
el
)
{
return
$
(
el
).
data
(
'id'
);
},
});
});
}
}
window
.
SubscriptionSelect
=
SubscriptionSelect
;
spec/javascripts/new_branch_spec.js
View file @
15cb13ee
/* eslint-disable space-before-function-paren, one-var, no-var, one-var-declaration-per-line, no-return-assign, quotes, max-len */
/* global NewBranchForm */
import
'~/new_branch_form'
;
import
NewBranchForm
from
'~/new_branch_form'
;
(
function
()
{
describe
(
'Branch'
,
function
()
{
...
...
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