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
Léo-Paul Géneau
gitlab-ce
Commits
b69d7ac3
Commit
b69d7ac3
authored
Jan 11, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added dispatcher imports for some project routes
parent
f084525f
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
52 additions
and
156 deletions
+52
-156
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+12
-36
app/assets/javascripts/pages/projects/edit/index.js
app/assets/javascripts/pages/projects/edit/index.js
+6
-0
app/assets/javascripts/pages/projects/index.js
app/assets/javascripts/pages/projects/index.js
+7
-0
app/assets/javascripts/pages/projects/new/index.js
app/assets/javascripts/pages/projects/new/index.js
+7
-0
app/assets/javascripts/pages/projects/project.js
app/assets/javascripts/pages/projects/project.js
+2
-2
app/assets/javascripts/pages/projects/shared/permissions/components/project_feature_setting.vue
...shared/permissions/components/project_feature_setting.vue
+1
-1
app/assets/javascripts/pages/projects/shared/permissions/components/project_setting_row.vue
...cts/shared/permissions/components/project_setting_row.vue
+0
-0
app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue
...projects/shared/permissions/components/settings_panel.vue
+1
-1
app/assets/javascripts/pages/projects/shared/permissions/constants.js
...avascripts/pages/projects/shared/permissions/constants.js
+0
-0
app/assets/javascripts/pages/projects/shared/permissions/external.js
...javascripts/pages/projects/shared/permissions/external.js
+0
-0
app/assets/javascripts/pages/projects/shared/permissions/index.js
...ts/javascripts/pages/projects/shared/permissions/index.js
+0
-0
app/assets/javascripts/pages/projects/shared/project_avatar.js
...ssets/javascripts/pages/projects/shared/project_avatar.js
+0
-0
app/assets/javascripts/pages/projects/shared/project_new.js
app/assets/javascripts/pages/projects/shared/project_new.js
+1
-1
app/assets/javascripts/pages/projects/wikis/index.js
app/assets/javascripts/pages/projects/wikis/index.js
+11
-0
app/assets/javascripts/pages/projects/wikis/wikis.js
app/assets/javascripts/pages/projects/wikis/wikis.js
+2
-2
app/assets/javascripts/projects/project_new.js
app/assets/javascripts/projects/project_new.js
+0
-108
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js
...javascripts/vue_merge_request_widget/mr_widget_options.js
+1
-1
app/views/projects/new.html.haml
app/views/projects/new.html.haml
+0
-2
config/webpack.config.js
config/webpack.config.js
+0
-1
spec/javascripts/projects/project_new_spec.js
spec/javascripts/projects/project_new_spec.js
+1
-1
No files found.
app/assets/javascripts/dispatcher.js
View file @
b69d7ac3
...
...
@@ -9,11 +9,8 @@ import notificationsDropdown from './notifications_dropdown';
import
groupAvatar
from
'
./group_avatar
'
;
import
GroupLabelSubscription
from
'
./group_label_subscription
'
;
import
LineHighlighter
from
'
./line_highlighter
'
;
import
Project
from
'
./project
'
;
import
projectAvatar
from
'
./project_avatar
'
;
import
MergeRequest
from
'
./merge_request
'
;
import
Compare
from
'
./compare
'
;
import
ProjectNew
from
'
./project_new
'
;
import
Labels
from
'
./labels
'
;
import
LabelManager
from
'
./label_manager
'
;
import
Sidebar
from
'
./right_sidebar
'
;
...
...
@@ -24,20 +21,17 @@ import SecretValues from './behaviors/secret_values';
import
Group
from
'
./group
'
;
import
ProjectsList
from
'
./projects_list
'
;
import
UserCallout
from
'
./user_callout
'
;
import
ShortcutsWiki
from
'
./shortcuts_wiki
'
;
import
BlobViewer
from
'
./blob/viewer/index
'
;
import
AutoWidthDropdownSelect
from
'
./issuable/auto_width_dropdown_select
'
;
import
UsersSelect
from
'
./users_select
'
;
import
GfmAutoComplete
from
'
./gfm_auto_complete
'
;
import
Star
from
'
./star
'
;
import
TreeView
from
'
./tree
'
;
import
Wikis
from
'
./wikis
'
;
import
ZenMode
from
'
./zen_mode
'
;
import
initSettingsPanels
from
'
./settings_panels
'
;
import
PerformanceBar
from
'
./performance_bar
'
;
import
initNotes
from
'
./init_notes
'
;
import
initIssuableSidebar
from
'
./init_issuable_sidebar
'
;
import
initProjectVisibilitySelector
from
'
./project_visibility
'
;
import
NewGroupChild
from
'
./groups/new_group_child
'
;
import
{
ajaxGet
,
convertPermissionToBoolean
}
from
'
./lib/utils/common_utils
'
;
import
GlFieldErrors
from
'
./gl_field_errors
'
;
...
...
@@ -70,7 +64,7 @@ import Activities from './activities';
return
false
;
}
const
fail
=
(
)
=>
Flash
(
'
Error loading dynamic module
'
);
const
fail
=
(
e
)
=>
{
throw
e
;
Flash
(
'
Error loading dynamic module
'
);
}
const
callDefault
=
m
=>
m
.
default
();
path
=
page
.
split
(
'
:
'
);
...
...
@@ -642,57 +636,39 @@ import Activities from './activities';
.
catch
(
fail
);
break
;
case
'
projects
'
:
new
Project
();
projectAvatar
();
import
(
'
./pages/projects
'
)
.
then
(
callDefault
)
.
catch
(
fail
);
shortcut_handler
=
true
;
switch
(
path
[
1
])
{
case
'
compare
'
:
import
(
'
./pages/projects/compare
'
)
.
then
(
callDefault
)
.
catch
(
fail
);
break
;
case
'
edit
'
:
shortcut_handler
=
new
ShortcutsNavigation
();
new
ProjectNew
();
import
(
/* webpackChunkName: 'project_permissions' */
'
./projects/permissions
'
)
case
'
create
'
:
case
'
new
'
:
import
(
'
./pages/projects/new
'
)
.
then
(
callDefault
)
.
catch
(
fail
);
break
;
case
'
new
'
:
new
ProjectNew
();
initProjectVisibilitySelector
();
break
;
case
'
show
'
:
new
Star
();
new
ProjectNew
();
notificationsDropdown
();
break
;
case
'
wikis
'
:
new
Wikis
();
shortcut_handler
=
new
ShortcutsWiki
();
new
ZenMode
(
);
new
GLForm
(
$
(
'
.wiki-form
'
),
true
)
;
import
(
'
./pages/projects/wikis
'
)
.
then
(
callDefault
)
.
catch
(
fail
);
shortcut_handler
=
true
;
break
;
case
'
snippets
'
:
shortcut_handler
=
new
ShortcutsNavigation
();
if
(
path
[
2
]
===
'
show
'
)
{
new
ZenMode
();
new
LineHighlighter
();
new
BlobViewer
();
}
break
;
case
'
labels
'
:
case
'
graphs
'
:
case
'
compare
'
:
case
'
pipelines
'
:
case
'
forks
'
:
case
'
milestones
'
:
case
'
project_members
'
:
case
'
deploy_keys
'
:
case
'
builds
'
:
case
'
hooks
'
:
case
'
services
'
:
case
'
protected_branches
'
:
shortcut_handler
=
new
ShortcutsNavigation
();
}
break
;
}
...
...
app/assets/javascripts/pages/projects/edit/index.js
View file @
b69d7ac3
import
initSettingsPanels
from
'
~/settings_panels
'
;
import
setupProjectEdit
from
'
~/project_edit
'
;
import
ProjectNew
from
'
../shared/project_new
'
;
import
projectAvatar
from
'
../shared/project_avatar
'
;
import
initProjectPermissionsSettings
from
'
../shared/permissions
'
;
export
default
()
=>
{
new
ProjectNew
();
// eslint-disable-line no-new
setupProjectEdit
();
// Initialize expandable settings panels
initSettingsPanels
();
projectAvatar
();
initProjectPermissionsSettings
();
};
app/assets/javascripts/pages/projects/index.js
0 → 100644
View file @
b69d7ac3
import
Project
from
'
./project
'
;
import
ShortcutsNavigation
from
'
../../shortcuts_navigation
'
;
export
default
()
=>
{
new
Project
();
// eslint-disable-line no-new
new
ShortcutsNavigation
();
// eslint-disable-line no-new
};
app/assets/javascripts/pages/projects/new/index.js
0 → 100644
View file @
b69d7ac3
import
ProjectNew
from
'
../shared/project_new
'
;
import
initProjectVisibilitySelector
from
'
../../../project_visibility
'
;
export
default
()
=>
{
new
ProjectNew
();
// eslint-disable-line no-new
initProjectVisibilitySelector
();
};
app/assets/javascripts/project.js
→
app/assets/javascripts/p
ages/projects/p
roject.js
View file @
b69d7ac3
/* 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 */
import
Cookies
from
'
js-cookie
'
;
import
{
visitUrl
}
from
'
./lib/utils/url_utility
'
;
import
projectSelect
from
'
./project_select
'
;
import
{
visitUrl
}
from
'
.
./..
/lib/utils/url_utility
'
;
import
projectSelect
from
'
.
./..
/project_select
'
;
export
default
class
Project
{
constructor
()
{
...
...
app/assets/javascripts/p
rojects
/permissions/components/project_feature_setting.vue
→
app/assets/javascripts/p
ages/projects/shared
/permissions/components/project_feature_setting.vue
View file @
b69d7ac3
<
script
>
import
projectFeatureToggle
from
'
../../../vue_shared/components/toggle_button.vue
'
;
import
projectFeatureToggle
from
'
../../../
../../
vue_shared/components/toggle_button.vue
'
;
export
default
{
components
:
{
...
...
app/assets/javascripts/p
rojects
/permissions/components/project_setting_row.vue
→
app/assets/javascripts/p
ages/projects/shared
/permissions/components/project_setting_row.vue
View file @
b69d7ac3
File moved
app/assets/javascripts/p
rojects
/permissions/components/settings_panel.vue
→
app/assets/javascripts/p
ages/projects/shared
/permissions/components/settings_panel.vue
View file @
b69d7ac3
<
script
>
import
projectFeatureSetting
from
'
./project_feature_setting.vue
'
;
import
projectFeatureToggle
from
'
../../../vue_shared/components/toggle_button.vue
'
;
import
projectFeatureToggle
from
'
../../../
../../
vue_shared/components/toggle_button.vue
'
;
import
projectSettingRow
from
'
./project_setting_row.vue
'
;
import
{
visibilityOptions
,
visibilityLevelDescriptions
}
from
'
../constants
'
;
import
{
toggleHiddenClassBySelector
}
from
'
../external
'
;
...
...
app/assets/javascripts/p
rojects
/permissions/constants.js
→
app/assets/javascripts/p
ages/projects/shared
/permissions/constants.js
View file @
b69d7ac3
File moved
app/assets/javascripts/p
rojects
/permissions/external.js
→
app/assets/javascripts/p
ages/projects/shared
/permissions/external.js
View file @
b69d7ac3
File moved
app/assets/javascripts/p
rojects
/permissions/index.js
→
app/assets/javascripts/p
ages/projects/shared
/permissions/index.js
View file @
b69d7ac3
File moved
app/assets/javascripts/project_avatar.js
→
app/assets/javascripts/p
ages/projects/shared/p
roject_avatar.js
View file @
b69d7ac3
File moved
app/assets/javascripts/project_new.js
→
app/assets/javascripts/p
ages/projects/shared/p
roject_new.js
View file @
b69d7ac3
/* eslint-disable func-names, no-var, no-underscore-dangle, prefer-template, prefer-arrow-callback*/
import
VisibilitySelect
from
'
./visibility_select
'
;
import
VisibilitySelect
from
'
.
./../..
/visibility_select
'
;
function
highlightChanges
(
$elm
)
{
$elm
.
addClass
(
'
highlight-changes
'
);
...
...
app/assets/javascripts/pages/projects/wikis/index.js
0 → 100644
View file @
b69d7ac3
import
Wikis
from
'
./wikis
'
;
import
ShortcutsWiki
from
'
../../../shortcuts_wiki
'
;
import
ZenMode
from
'
../../../zen_mode
'
;
import
GLForm
from
'
../../../gl_form
'
;
export
default
()
=>
{
new
Wikis
();
// eslint-disable-line no-new
new
ShortcutsWiki
();
// eslint-disable-line no-new
new
ZenMode
();
// eslint-disable-line no-new
new
GLForm
(
$
(
'
.wiki-form
'
),
true
);
// eslint-disable-line no-new
};
app/assets/javascripts/wikis.js
→
app/assets/javascripts/
pages/projects/wikis/
wikis.js
View file @
b69d7ac3
import
bp
from
'
./breakpoints
'
;
import
{
slugify
}
from
'
./lib/utils/text_utility
'
;
import
bp
from
'
.
./../..
/breakpoints
'
;
import
{
slugify
}
from
'
.
./../..
/lib/utils/text_utility
'
;
export
default
class
Wikis
{
constructor
()
{
...
...
app/assets/javascripts/projects/project_new.js
deleted
100644 → 0
View file @
f084525f
let
hasUserDefinedProjectPath
=
false
;
const
deriveProjectPathFromUrl
=
(
$projectImportUrl
)
=>
{
const
$currentProjectPath
=
$projectImportUrl
.
parents
(
'
.toggle-import-form
'
).
find
(
'
#project_path
'
);
if
(
hasUserDefinedProjectPath
)
{
return
;
}
let
importUrl
=
$projectImportUrl
.
val
().
trim
();
if
(
importUrl
.
length
===
0
)
{
return
;
}
/*
\/?: remove trailing slash
(\.git\/?)?: remove trailing .git (with optional trailing slash)
(\?.*)?: remove query string
(#.*)?: remove fragment identifier
*/
importUrl
=
importUrl
.
replace
(
/
\/?(\.
git
\/?)?(\?
.*
)?(
#.*
)?
$/
,
''
);
// extract everything after the last slash
const
pathMatch
=
/
\/([^/]
+
)
$/
.
exec
(
importUrl
);
if
(
pathMatch
)
{
$currentProjectPath
.
val
(
pathMatch
[
1
]);
}
};
const
bindEvents
=
()
=>
{
const
$newProjectForm
=
$
(
'
#new_project
'
);
const
$projectImportUrl
=
$
(
'
#project_import_url
'
);
const
$projectPath
=
$
(
'
#project_path
'
);
const
$useTemplateBtn
=
$
(
'
.template-button > input
'
);
const
$projectFieldsForm
=
$
(
'
.project-fields-form
'
);
const
$selectedTemplateText
=
$
(
'
.selected-template
'
);
const
$changeTemplateBtn
=
$
(
'
.change-template
'
);
const
$selectedIcon
=
$
(
'
.selected-icon svg
'
);
const
$templateProjectNameInput
=
$
(
'
#template-project-name #project_path
'
);
if
(
$newProjectForm
.
length
!==
1
)
{
return
;
}
$
(
'
.how_to_import_link
'
).
on
(
'
click
'
,
(
e
)
=>
{
e
.
preventDefault
();
$
(
e
.
currentTarget
).
next
(
'
.modal
'
).
show
();
});
$
(
'
.modal-header .close
'
).
on
(
'
click
'
,
()
=>
{
$
(
'
.modal
'
).
hide
();
});
$
(
'
.btn_import_gitlab_project
'
).
on
(
'
click
'
,
()
=>
{
const
importHref
=
$
(
'
a.btn_import_gitlab_project
'
).
attr
(
'
href
'
);
$
(
'
.btn_import_gitlab_project
'
).
attr
(
'
href
'
,
`
${
importHref
}
?namespace_id=
${
$
(
'
#project_namespace_id
'
).
val
()}
&path=
${
$projectPath
.
val
()}
`
);
});
function
chooseTemplate
()
{
$
(
'
.template-option
'
).
hide
();
$projectFieldsForm
.
addClass
(
'
selected
'
);
$selectedIcon
.
removeClass
(
'
active
'
);
const
value
=
$
(
this
).
val
();
const
templates
=
{
rails
:
{
text
:
'
Ruby on Rails
'
,
icon
:
'
.selected-icon .icon-rails
'
,
},
express
:
{
text
:
'
NodeJS Express
'
,
icon
:
'
.selected-icon .icon-node-express
'
,
},
spring
:
{
text
:
'
Spring
'
,
icon
:
'
.selected-icon .icon-java-spring
'
,
},
};
const
selectedTemplate
=
templates
[
value
];
$selectedTemplateText
.
text
(
selectedTemplate
.
text
);
$
(
selectedTemplate
.
icon
).
addClass
(
'
active
'
);
$templateProjectNameInput
.
focus
();
}
$useTemplateBtn
.
on
(
'
change
'
,
chooseTemplate
);
$changeTemplateBtn
.
on
(
'
click
'
,
()
=>
{
$
(
'
.template-option
'
).
show
();
$projectFieldsForm
.
removeClass
(
'
selected
'
);
$useTemplateBtn
.
prop
(
'
checked
'
,
false
);
});
$newProjectForm
.
on
(
'
submit
'
,
()
=>
{
$projectPath
.
val
(
$projectPath
.
val
().
trim
());
});
$projectPath
.
on
(
'
keyup
'
,
()
=>
{
hasUserDefinedProjectPath
=
$projectPath
.
val
().
trim
().
length
>
0
;
});
$projectImportUrl
.
keyup
(()
=>
deriveProjectPathFromUrl
(
$projectImportUrl
));
};
document
.
addEventListener
(
'
DOMContentLoaded
'
,
bindEvents
);
export
default
{
bindEvents
,
deriveProjectPathFromUrl
,
};
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js
View file @
b69d7ac3
import
Project
from
'
~/project
'
;
import
Project
from
'
~/p
ages/projects/p
roject
'
;
import
SmartInterval
from
'
~/smart_interval
'
;
import
Flash
from
'
../flash
'
;
import
{
...
...
app/views/projects/new.html.haml
View file @
b69d7ac3
...
...
@@ -4,8 +4,6 @@
-
page_title
'New Project'
-
header_title
"Projects"
,
dashboard_projects_path
-
visibility_level
=
params
.
dig
(
:project
,
:visibility_level
)
||
default_project_visibility
-
content_for
:page_specific_javascripts
do
=
webpack_bundle_tag
'project_new'
.project-edit-container
.project-edit-errors
...
...
config/webpack.config.js
View file @
b69d7ac3
...
...
@@ -66,7 +66,6 @@ var config = {
pipelines_times
:
'
./pipelines/pipelines_times.js
'
,
profile
:
'
./profile/profile_bundle.js
'
,
project_import_gl
:
'
./projects/project_import_gitlab_project.js
'
,
project_new
:
'
./projects/project_new.js
'
,
prometheus_metrics
:
'
./prometheus_metrics
'
,
protected_branches
:
'
./protected_branches
'
,
protected_tags
:
'
./protected_tags
'
,
...
...
spec/javascripts/projects/project_new_spec.js
View file @
b69d7ac3
import
projectNew
from
'
~/p
rojects
/project_new
'
;
import
projectNew
from
'
~/p
ages/projects/shared
/project_new
'
;
describe
(
'
New Project
'
,
()
=>
{
let
$projectImportUrl
;
...
...
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