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
c5515778
Commit
c5515778
authored
Aug 12, 2021
by
Illya Klymov
Committed by
Jacques Erasmus
Sep 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move reusable utils to helper file
These are reused in multiple places
parent
03274a7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
app/assets/javascripts/import_entities/import_groups/utils.js
...assets/javascripts/import_entities/import_groups/utils.js
+9
-0
No files found.
app/assets/javascripts/import_entities/import_groups/utils.js
View file @
c5515778
import
{
STATUSES
}
from
'
../constants
'
;
import
{
NEW_NAME_FIELD
}
from
'
./constants
'
;
import
{
NEW_NAME_FIELD
}
from
'
./constants
'
;
export
function
isNameValid
(
group
,
validationRegex
)
{
export
function
isNameValid
(
group
,
validationRegex
)
{
...
@@ -11,3 +12,11 @@ export function getInvalidNameValidationMessage(group) {
...
@@ -11,3 +12,11 @@ export function getInvalidNameValidationMessage(group) {
export
function
isInvalid
(
group
,
validationRegex
)
{
export
function
isInvalid
(
group
,
validationRegex
)
{
return
Boolean
(
!
isNameValid
(
group
,
validationRegex
)
||
getInvalidNameValidationMessage
(
group
));
return
Boolean
(
!
isNameValid
(
group
,
validationRegex
)
||
getInvalidNameValidationMessage
(
group
));
}
}
export
function
isFinished
(
group
)
{
return
group
.
progress
.
status
===
STATUSES
.
FINISHED
;
}
export
function
isAvailableForImport
(
group
)
{
return
[
STATUSES
.
NONE
,
STATUSES
.
FINISHED
].
some
((
status
)
=>
group
.
progress
.
status
===
status
);
}
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