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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
77b1def4
Commit
77b1def4
authored
Nov 17, 2017
by
Filipa Lacerda
Committed by
Phil Hughes
Nov 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exports a couple of project related code as es6 modules
parent
2dff3776
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
272 additions
and
311 deletions
+272
-311
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+9
-9
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+0
-5
app/assets/javascripts/project.js
app/assets/javascripts/project.js
+2
-2
app/assets/javascripts/project_label_subscription.js
app/assets/javascripts/project_label_subscription.js
+37
-42
app/assets/javascripts/project_new.js
app/assets/javascripts/project_new.js
+132
-140
app/assets/javascripts/project_select.js
app/assets/javascripts/project_select.js
+64
-70
app/assets/javascripts/project_show.js
app/assets/javascripts/project_show.js
+0
-11
app/assets/javascripts/project_variables.js
app/assets/javascripts/project_variables.js
+28
-32
No files found.
app/assets/javascripts/dispatcher.js
View file @
77b1def4
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-arrow-callback, wrap-iife, no-shadow, consistent-return, one-var, one-var-declaration-per-line, camelcase, default-case, no-new, quotes, no-duplicate-case, no-case-declarations, no-fallthrough, max-len */
import
{
s__
}
from
'
./locale
'
;
/* global ProjectSelect */
import
projectSelect
from
'
./project_select
'
;
import
IssuableIndex
from
'
./issuable_index
'
;
/* global Milestone */
import
IssuableForm
from
'
./issuable_form
'
;
...
...
@@ -26,8 +26,7 @@ import projectAvatar from './project_avatar';
/* global Compare */
/* global CompareAutocomplete */
/* global ProjectFindFile */
/* global ProjectNew */
/* global ProjectShow */
import
ProjectNew
from
'
./project_new
'
;
import
projectImport
from
'
./project_import
'
;
import
Labels
from
'
./labels
'
;
import
LabelManager
from
'
./label_manager
'
;
...
...
@@ -91,6 +90,8 @@ import Members from './members';
import
memberExpirationDate
from
'
./member_expiration_date
'
;
import
DueDateSelectors
from
'
./due_date_select
'
;
import
Diff
from
'
./diff
'
;
import
ProjectLabelSubscription
from
'
./project_label_subscription
'
;
import
ProjectVariables
from
'
./project_variables
'
;
(
function
()
{
var
Dispatcher
;
...
...
@@ -187,7 +188,7 @@ import Diff from './diff';
initIssuableSidebar
();
break
;
case
'
dashboard:milestones:index
'
:
new
P
rojectSelect
();
p
rojectSelect
();
break
;
case
'
projects:milestones:show
'
:
case
'
groups:milestones:show
'
:
...
...
@@ -197,7 +198,7 @@ import Diff from './diff';
break
;
case
'
dashboard:issues
'
:
case
'
dashboard:merge_requests
'
:
new
P
rojectSelect
();
p
rojectSelect
();
initLegacyFilters
();
break
;
case
'
groups:issues
'
:
...
...
@@ -206,7 +207,7 @@ import Diff from './diff';
const
filteredSearchManager
=
new
gl
.
FilteredSearchManager
(
page
===
'
groups:issues
'
?
'
issues
'
:
'
merge_requests
'
);
filteredSearchManager
.
setup
();
}
new
P
rojectSelect
();
p
rojectSelect
();
break
;
case
'
dashboard:todos:index
'
:
new
Todos
();
...
...
@@ -484,7 +485,7 @@ import Diff from './diff';
if
(
$el
.
find
(
'
.dropdown-group-label
'
).
length
)
{
new
GroupLabelSubscription
(
$el
);
}
else
{
new
gl
.
ProjectLabelSubscription
(
$el
);
new
ProjectLabelSubscription
(
$el
);
}
});
break
;
...
...
@@ -520,7 +521,7 @@ import Diff from './diff';
// Initialize expandable settings panels
initSettingsPanels
();
case
'
groups:settings:ci_cd:show
'
:
new
gl
.
ProjectVariables
();
new
ProjectVariables
();
break
;
case
'
ci:lints:create
'
:
case
'
ci:lints:show
'
:
...
...
@@ -623,7 +624,6 @@ import Diff from './diff';
case
'
show
'
:
new
Star
();
new
ProjectNew
();
new
ProjectShow
();
new
NotificationsDropdown
();
break
;
case
'
wikis
'
:
...
...
app/assets/javascripts/main.js
View file @
77b1def4
...
...
@@ -71,11 +71,6 @@ import './pager';
import
'
./preview_markdown
'
;
import
'
./project_find_file
'
;
import
'
./project_import
'
;
import
'
./project_label_subscription
'
;
import
'
./project_new
'
;
import
'
./project_select
'
;
import
'
./project_show
'
;
import
'
./project_variables
'
;
import
'
./projects_dropdown
'
;
import
'
./projects_list
'
;
import
'
./syntax_highlight
'
;
...
...
app/assets/javascripts/project.js
View file @
77b1def4
/* eslint-disable func-names, space-before-function-paren, no-var, consistent-return, no-new, prefer-arrow-callback, no-return-assign, one-var, one-var-declaration-per-line, object-shorthand, no-else-return, newline-per-chained-call, no-shadow, vars-on-top, prefer-template, max-len */
/* global ProjectSelect */
import
Cookies
from
'
js-cookie
'
;
import
projectSelect
from
'
./project_select
'
;
export
default
class
Project
{
constructor
()
{
...
...
@@ -46,7 +46,7 @@ export default class Project {
}
static
projectSelectDropdown
()
{
new
P
rojectSelect
();
p
rojectSelect
();
$
(
'
.project-item-select
'
).
on
(
'
click
'
,
e
=>
Project
.
changeProject
(
$
(
e
.
currentTarget
).
val
()));
}
...
...
app/assets/javascripts/project_label_subscription.js
View file @
77b1def4
/* eslint-disable wrap-iife, func-names, space-before-function-paren, object-shorthand, comma-dangle, one-var, one-var-declaration-per-line, no-restricted-syntax, max-len, no-param-reassign */
(
function
(
global
)
{
class
ProjectLabelSubscription
{
export
default
class
ProjectLabelSubscription
{
constructor
(
container
)
{
this
.
$container
=
$
(
container
);
this
.
$buttons
=
this
.
$container
.
find
(
'
.js-subscribe-button
'
);
...
...
@@ -22,9 +19,10 @@
$
.
ajax
({
type
:
'
POST
'
,
url
:
url
url
,
}).
done
(()
=>
{
let
newStatus
,
newAction
;
let
newStatus
;
let
newAction
;
if
(
oldStatus
===
'
unsubscribed
'
)
{
[
newStatus
,
newAction
]
=
[
'
subscribed
'
,
'
Unsubscribe
'
];
...
...
@@ -49,7 +47,4 @@
});
});
}
}
global
.
ProjectLabelSubscription
=
ProjectLabelSubscription
;
})(
window
.
gl
||
(
window
.
gl
=
{}));
}
app/assets/javascripts/project_new.js
View file @
77b1def4
/* eslint-disable func-names,
space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-unused-vars, one-var, no-underscore-dangle, prefer-template, no-else-return, prefer-arrow-callback, max-len
*/
/* eslint-disable func-names,
no-var, no-underscore-dangle, prefer-template, prefer-arrow-callback
*/
import
VisibilitySelect
from
'
./visibility_select
'
;
...
...
@@ -7,20 +7,17 @@ function highlightChanges($elm) {
setTimeout
(()
=>
$elm
.
removeClass
(
'
highlight-changes
'
),
10
);
}
(
function
()
{
this
.
ProjectNew
=
(
function
()
{
function
ProjectNew
()
{
export
default
class
ProjectNew
{
constructor
()
{
this
.
toggleSettings
=
this
.
toggleSettings
.
bind
(
this
);
this
.
$selects
=
$
(
'
.features select
'
);
this
.
$repoSelects
=
this
.
$selects
.
filter
(
'
.js-repo-select
'
);
this
.
$projectSelects
=
this
.
$selects
.
not
(
'
.js-repo-select
'
);
$
(
'
.project-edit-container
'
).
on
(
'
ajax:before
'
,
(
function
(
_this
)
{
return
function
()
{
$
(
'
.project-edit-container
'
).
on
(
'
ajax:before
'
,
()
=>
{
$
(
'
.project-edit-container
'
).
hide
();
return
$
(
'
.save-project-loader
'
).
show
();
};
})(
this
));
});
this
.
initVisibilitySelect
();
...
...
@@ -29,7 +26,7 @@ function highlightChanges($elm) {
this
.
toggleRepoVisibility
();
}
ProjectNew
.
prototype
.
initVisibilitySelect
=
function
()
{
initVisibilitySelect
()
{
const
visibilityContainer
=
document
.
querySelector
(
'
.js-visibility-select
'
);
if
(
!
visibilityContainer
)
return
;
const
visibilitySelect
=
new
VisibilitySelect
(
visibilityContainer
);
...
...
@@ -70,35 +67,32 @@ function highlightChanges($elm) {
projectVisibility
=
newProjectVisibility
;
}
});
};
ProjectNew
.
prototype
.
toggleSettings
=
function
()
{
var
self
=
this
;
}
toggleSettings
()
{
this
.
$selects
.
each
(
function
()
{
var
$select
=
$
(
this
);
var
className
=
$select
.
data
(
'
field
'
)
.
replace
(
/_/g
,
'
-
'
)
.
replace
(
'
access-level
'
,
'
feature
'
);
self
.
_showOrHide
(
$select
,
'
.
'
+
className
);
ProjectNew
.
_showOrHide
(
$select
,
'
.
'
+
className
);
});
};
}
ProjectNew
.
prototype
.
toggleSettingsOnclick
=
function
()
{
toggleSettingsOnclick
()
{
this
.
$selects
.
on
(
'
change
'
,
this
.
toggleSettings
);
};
}
ProjectNew
.
prototype
.
_showOrHide
=
function
(
checkElement
,
container
)
{
var
$container
=
$
(
container
);
static
_showOrHide
(
checkElement
,
container
)
{
const
$container
=
$
(
container
);
if
(
$
(
checkElement
).
val
()
!==
'
0
'
)
{
return
$container
.
show
();
}
else
{
}
return
$container
.
hide
();
}
};
ProjectNew
.
prototype
.
toggleRepoVisibility
=
function
()
{
toggleRepoVisibility
()
{
var
$repoAccessLevel
=
$
(
'
.js-repo-access-level select
'
);
var
$lfsEnabledOption
=
$
(
'
.js-lfs-enabled select
'
);
var
containerRegistry
=
document
.
querySelectorAll
(
'
.js-container-registry
'
)[
0
];
...
...
@@ -109,7 +103,8 @@ function highlightChanges($elm) {
.
nextAll
()
.
hide
();
$repoAccessLevel
.
off
(
'
change
'
)
$repoAccessLevel
.
off
(
'
change
'
)
.
on
(
'
change
'
,
function
()
{
var
selectedVal
=
parseInt
(
$repoAccessLevel
.
val
(),
10
);
...
...
@@ -152,8 +147,5 @@ function highlightChanges($elm) {
prevSelectedVal
=
selectedVal
;
}.
bind
(
this
));
};
return
ProjectNew
;
})();
}).
call
(
window
);
}
}
app/assets/javascripts/project_select.js
View file @
77b1def4
...
...
@@ -2,9 +2,7 @@
import
Api
from
'
./api
'
;
import
ProjectSelectComboButton
from
'
./project_select_combo_button
'
;
(
function
()
{
this
.
ProjectSelect
=
(
function
()
{
function
ProjectSelect
()
{
export
default
function
projectSelect
()
{
$
(
'
.ajax-project-select
'
).
each
(
function
(
i
,
select
)
{
var
placeholder
;
const
simpleFilter
=
$
(
select
).
data
(
'
simple-filter
'
)
||
false
;
...
...
@@ -73,8 +71,4 @@ import ProjectSelectComboButton from './project_select_combo_button';
if
(
simpleFilter
)
return
select
;
return
new
ProjectSelectComboButton
(
select
);
});
}
return
ProjectSelect
;
})();
}).
call
(
window
);
}
app/assets/javascripts/project_show.js
deleted
100644 → 0
View file @
2dff3776
/* eslint-disable func-names, space-before-function-paren, wrap-iife */
(
function
()
{
this
.
ProjectShow
=
(
function
()
{
function
ProjectShow
()
{}
return
ProjectShow
;
})();
}).
call
(
window
);
// I kept class for future
app/assets/javascripts/project_variables.js
View file @
77b1def4
(()
=>
{
const
HIDDEN_VALUE_TEXT
=
'
******
'
;
class
ProjectVariables
{
const
HIDDEN_VALUE_TEXT
=
'
******
'
;
export
default
class
ProjectVariables
{
constructor
()
{
this
.
$revealBtn
=
$
(
'
.js-btn-toggle-reveal-values
'
);
this
.
$revealBtn
.
on
(
'
click
'
,
this
.
toggleRevealState
.
bind
(
this
));
...
...
@@ -36,8 +36,4 @@
this
.
$revealBtn
.
text
(
newAction
);
}
}
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
ProjectVariables
=
ProjectVariables
;
})();
}
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