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
8bd98e65
Commit
8bd98e65
authored
Mar 23, 2018
by
Winnie Hellmann
Committed by
Filipa Lacerda
Mar 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename modal.vue to deprecated_modal.vue (EE port)
parent
22b1af59
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
373 additions
and
321 deletions
+373
-321
app/assets/javascripts/groups/components/app.vue
app/assets/javascripts/groups/components/app.vue
+54
-34
app/assets/javascripts/ide/components/new_dropdown/modal.vue
app/assets/javascripts/ide/components/new_dropdown/modal.vue
+59
-59
app/assets/javascripts/ide/components/repo_commit_section.vue
...assets/javascripts/ide/components/repo_commit_section.vue
+12
-14
app/assets/javascripts/pages/admin/projects/index/components/delete_project_modal.vue
.../admin/projects/index/components/delete_project_modal.vue
+4
-4
app/assets/javascripts/pages/admin/users/components/delete_user_modal.vue
...cripts/pages/admin/users/components/delete_user_modal.vue
+4
-4
app/assets/javascripts/pages/milestones/shared/components/delete_milestone_modal.vue
...s/milestones/shared/components/delete_milestone_modal.vue
+4
-4
app/assets/javascripts/pipelines/components/pipelines_table.vue
...sets/javascripts/pipelines/components/pipelines_table.vue
+4
-4
app/assets/javascripts/profile/account/components/delete_account_modal.vue
...ripts/profile/account/components/delete_account_modal.vue
+4
-4
app/assets/javascripts/vue_shared/components/deprecated_modal.vue
...ts/javascripts/vue_shared/components/deprecated_modal.vue
+1
-1
app/assets/javascripts/vue_shared/components/recaptcha_modal.vue
...ets/javascripts/vue_shared/components/recaptcha_modal.vue
+4
-4
changelogs/unreleased/winh-deprecate-old-modal.yml
changelogs/unreleased/winh-deprecate-old-modal.yml
+5
-0
ee/app/assets/javascripts/boards/components/board_form.vue
ee/app/assets/javascripts/boards/components/board_form.vue
+17
-13
ee/app/assets/javascripts/geo_nodes/components/app.vue
ee/app/assets/javascripts/geo_nodes/components/app.vue
+198
-173
spec/javascripts/vue_shared/components/deprecated_modal_spec.js
...avascripts/vue_shared/components/deprecated_modal_spec.js
+3
-3
No files found.
app/assets/javascripts/groups/components/app.vue
View file @
8bd98e65
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
import
$
from
'
jquery
'
;
import
$
from
'
jquery
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
loadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
import
loadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
import
modal
from
'
~/vue_shared/components/
modal.vue
'
;
import
DeprecatedModal
from
'
~/vue_shared/components/deprecated_
modal.vue
'
;
import
{
getParameterByName
}
from
'
~/lib/utils/common_utils
'
;
import
{
getParameterByName
}
from
'
~/lib/utils/common_utils
'
;
import
{
mergeUrlParams
}
from
'
~/lib/utils/url_utility
'
;
import
{
mergeUrlParams
}
from
'
~/lib/utils/url_utility
'
;
...
@@ -15,7 +15,7 @@ import groupsComponent from './groups.vue';
...
@@ -15,7 +15,7 @@ import groupsComponent from './groups.vue';
export
default
{
export
default
{
components
:
{
components
:
{
loadingIcon
,
loadingIcon
,
m
odal
,
DeprecatedM
odal
,
groupsComponent
,
groupsComponent
,
},
},
props
:
{
props
:
{
...
@@ -52,8 +52,9 @@ export default {
...
@@ -52,8 +52,9 @@ export default {
},
},
},
},
created
()
{
created
()
{
this
.
searchEmptyMessage
=
this
.
hideProjects
?
this
.
searchEmptyMessage
=
this
.
hideProjects
COMMON_STR
.
GROUP_SEARCH_EMPTY
:
COMMON_STR
.
GROUP_PROJECT_SEARCH_EMPTY
;
?
COMMON_STR
.
GROUP_SEARCH_EMPTY
:
COMMON_STR
.
GROUP_PROJECT_SEARCH_EMPTY
;
eventHub
.
$on
(
'
fetchPage
'
,
this
.
fetchPage
);
eventHub
.
$on
(
'
fetchPage
'
,
this
.
fetchPage
);
eventHub
.
$on
(
'
toggleChildren
'
,
this
.
toggleChildren
);
eventHub
.
$on
(
'
toggleChildren
'
,
this
.
toggleChildren
);
...
@@ -72,22 +73,30 @@ export default {
...
@@ -72,22 +73,30 @@ export default {
eventHub
.
$off
(
'
updateGroups
'
,
this
.
updateGroups
);
eventHub
.
$off
(
'
updateGroups
'
,
this
.
updateGroups
);
},
},
methods
:
{
methods
:
{
fetchGroups
({
parentId
,
page
,
filterGroupsBy
,
sortBy
,
archived
,
updatePagination
})
{
fetchGroups
({
return
this
.
service
.
getGroups
(
parentId
,
page
,
filterGroupsBy
,
sortBy
,
archived
)
parentId
,
.
then
((
res
)
=>
{
page
,
if
(
updatePagination
)
{
filterGroupsBy
,
this
.
updatePagination
(
res
.
headers
);
sortBy
,
}
archived
,
updatePagination
,
})
{
return
this
.
service
.
getGroups
(
parentId
,
page
,
filterGroupsBy
,
sortBy
,
archived
)
.
then
(
res
=>
{
if
(
updatePagination
)
{
this
.
updatePagination
(
res
.
headers
);
}
return
res
;
return
res
;
})
})
.
then
(
res
=>
res
.
json
())
.
then
(
res
=>
res
.
json
())
.
catch
(()
=>
{
.
catch
(()
=>
{
this
.
isLoading
=
false
;
this
.
isLoading
=
false
;
$
.
scrollTo
(
0
);
$
.
scrollTo
(
0
);
Flash
(
COMMON_STR
.
FAILURE
);
Flash
(
COMMON_STR
.
FAILURE
);
});
});
},
},
fetchAllGroups
()
{
fetchAllGroups
()
{
const
page
=
getParameterByName
(
'
page
'
)
||
null
;
const
page
=
getParameterByName
(
'
page
'
)
||
null
;
...
@@ -103,7 +112,7 @@ export default {
...
@@ -103,7 +112,7 @@ export default {
sortBy
,
sortBy
,
archived
,
archived
,
updatePagination
:
true
,
updatePagination
:
true
,
}).
then
(
(
res
)
=>
{
}).
then
(
res
=>
{
this
.
isLoading
=
false
;
this
.
isLoading
=
false
;
this
.
updateGroups
(
res
,
Boolean
(
filterGroupsBy
));
this
.
updateGroups
(
res
,
Boolean
(
filterGroupsBy
));
});
});
...
@@ -118,14 +127,18 @@ export default {
...
@@ -118,14 +127,18 @@ export default {
sortBy
,
sortBy
,
archived
,
archived
,
updatePagination
:
true
,
updatePagination
:
true
,
}).
then
(
(
res
)
=>
{
}).
then
(
res
=>
{
this
.
isLoading
=
false
;
this
.
isLoading
=
false
;
$
.
scrollTo
(
0
);
$
.
scrollTo
(
0
);
const
currentPath
=
mergeUrlParams
({
page
},
window
.
location
.
href
);
const
currentPath
=
mergeUrlParams
({
page
},
window
.
location
.
href
);
window
.
history
.
replaceState
({
window
.
history
.
replaceState
(
page
:
currentPath
,
{
},
document
.
title
,
currentPath
);
page
:
currentPath
,
},
document
.
title
,
currentPath
,
);
this
.
updateGroups
(
res
);
this
.
updateGroups
(
res
);
});
});
...
@@ -138,11 +151,13 @@ export default {
...
@@ -138,11 +151,13 @@ export default {
// eslint-disable-next-line promise/catch-or-return
// eslint-disable-next-line promise/catch-or-return
this
.
fetchGroups
({
this
.
fetchGroups
({
parentId
:
parentGroup
.
id
,
parentId
:
parentGroup
.
id
,
}).
then
((
res
)
=>
{
})
this
.
store
.
setGroupChildren
(
parentGroup
,
res
);
.
then
(
res
=>
{
}).
catch
(()
=>
{
this
.
store
.
setGroupChildren
(
parentGroup
,
res
);
parentGroup
.
isChildrenLoading
=
false
;
})
});
.
catch
(()
=>
{
parentGroup
.
isChildrenLoading
=
false
;
});
}
else
{
}
else
{
parentGroup
.
isOpen
=
true
;
parentGroup
.
isOpen
=
true
;
}
}
...
@@ -154,7 +169,11 @@ export default {
...
@@ -154,7 +169,11 @@ export default {
this
.
targetGroup
=
group
;
this
.
targetGroup
=
group
;
this
.
targetParentGroup
=
parentGroup
;
this
.
targetParentGroup
=
parentGroup
;
this
.
showModal
=
true
;
this
.
showModal
=
true
;
this
.
groupLeaveConfirmationMessage
=
s__
(
`GroupsTree|Are you sure you want to leave the "
${
group
.
fullName
}
" group?`
);
this
.
groupLeaveConfirmationMessage
=
s__
(
`GroupsTree|Are you sure you want to leave the "
${
group
.
fullName
}
" group?`
,
);
},
},
hideLeaveGroupModal
()
{
hideLeaveGroupModal
()
{
this
.
showModal
=
false
;
this
.
showModal
=
false
;
...
@@ -162,14 +181,15 @@ export default {
...
@@ -162,14 +181,15 @@ export default {
leaveGroup
()
{
leaveGroup
()
{
this
.
showModal
=
false
;
this
.
showModal
=
false
;
this
.
targetGroup
.
isBeingRemoved
=
true
;
this
.
targetGroup
.
isBeingRemoved
=
true
;
this
.
service
.
leaveGroup
(
this
.
targetGroup
.
leavePath
)
this
.
service
.
leaveGroup
(
this
.
targetGroup
.
leavePath
)
.
then
(
res
=>
res
.
json
())
.
then
(
res
=>
res
.
json
())
.
then
(
(
res
)
=>
{
.
then
(
res
=>
{
$
.
scrollTo
(
0
);
$
.
scrollTo
(
0
);
this
.
store
.
removeGroup
(
this
.
targetGroup
,
this
.
targetParentGroup
);
this
.
store
.
removeGroup
(
this
.
targetGroup
,
this
.
targetParentGroup
);
Flash
(
res
.
notice
,
'
notice
'
);
Flash
(
res
.
notice
,
'
notice
'
);
})
})
.
catch
(
(
err
)
=>
{
.
catch
(
err
=>
{
let
message
=
COMMON_STR
.
FAILURE
;
let
message
=
COMMON_STR
.
FAILURE
;
if
(
err
.
status
===
403
)
{
if
(
err
.
status
===
403
)
{
message
=
COMMON_STR
.
LEAVE_FORBIDDEN
;
message
=
COMMON_STR
.
LEAVE_FORBIDDEN
;
...
@@ -208,8 +228,8 @@ export default {
...
@@ -208,8 +228,8 @@ export default {
:search-empty-message=
"searchEmptyMessage"
:search-empty-message=
"searchEmptyMessage"
:page-info=
"pageInfo"
:page-info=
"pageInfo"
/>
/>
<modal
<
deprecated-
modal
v-
if
=
"showModal"
v-
show
=
"showModal"
kind=
"warning"
kind=
"warning"
:primary-button-label=
"__('Leave')"
:primary-button-label=
"__('Leave')"
:title=
"__('Are you sure?')"
:title=
"__('Are you sure?')"
...
...
app/assets/javascripts/ide/components/new_dropdown/modal.vue
View file @
8bd98e65
<
script
>
<
script
>
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
import
modal
from
'
~/vue_shared/components/
modal.vue
'
;
import
DeprecatedModal
from
'
~/vue_shared/components/deprecated_
modal.vue
'
;
export
default
{
export
default
{
components
:
{
components
:
{
modal
,
DeprecatedModal
,
},
props
:
{
branchId
:
{
type
:
String
,
required
:
true
,
},
},
props
:
{
type
:
{
branchId
:
{
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
type
:
{
type
:
String
,
required
:
true
,
},
path
:
{
type
:
String
,
required
:
true
,
},
},
},
data
()
{
path
:
{
return
{
type
:
String
,
entryName
:
this
.
path
!==
''
?
`
${
this
.
path
}
/`
:
''
,
required
:
true
,
};
},
},
computed
:
{
},
modalTitle
()
{
data
()
{
if
(
this
.
type
===
'
tree
'
)
{
return
{
return
__
(
'
Create new directory
'
);
entryName
:
this
.
path
!==
''
?
`
${
this
.
path
}
/`
:
''
,
}
};
},
computed
:
{
modalTitle
()
{
if
(
this
.
type
===
'
tree
'
)
{
return
__
(
'
Create new directory
'
);
}
return
__
(
'
Create new file
'
);
return
__
(
'
Create new file
'
);
},
},
buttonLabel
()
{
buttonLabel
()
{
if
(
this
.
type
===
'
tree
'
)
{
if
(
this
.
type
===
'
tree
'
)
{
return
__
(
'
Create directory
'
);
return
__
(
'
Create directory
'
);
}
}
return
__
(
'
Create file
'
);
},
formLabelName
()
{
if
(
this
.
type
===
'
tree
'
)
{
return
__
(
'
Directory name
'
);
}
return
__
(
'
File name
'
);
return
__
(
'
Create file
'
);
},
},
},
mounted
()
{
formLabelName
()
{
this
.
$refs
.
fieldName
.
focus
();
if
(
this
.
type
===
'
tree
'
)
{
return
__
(
'
Directory name
'
);
}
return
__
(
'
File name
'
);
},
},
methods
:
{
},
createEntryInStore
()
{
mounted
()
{
this
.
$emit
(
'
create
'
,
{
this
.
$refs
.
fieldName
.
focus
();
branchId
:
this
.
branchId
,
},
name
:
this
.
entryName
,
methods
:
{
type
:
this
.
type
,
createEntryInStore
()
{
});
this
.
$emit
(
'
create
'
,
{
branchId
:
this
.
branchId
,
name
:
this
.
entryName
,
type
:
this
.
type
,
});
this
.
hideModal
();
this
.
hideModal
();
},
},
hideModal
()
{
hideModal
()
{
this
.
$emit
(
'
hide
'
);
this
.
$emit
(
'
hide
'
);
},
},
},
};
},
};
</
script
>
</
script
>
<
template
>
<
template
>
<modal
<
deprecated-
modal
:title=
"modalTitle"
:title=
"modalTitle"
:primary-button-label=
"buttonLabel"
:primary-button-label=
"buttonLabel"
kind=
"success"
kind=
"success"
...
@@ -95,5 +95,5 @@
...
@@ -95,5 +95,5 @@
</div>
</div>
</fieldset>
</fieldset>
</form>
</form>
</modal>
</
deprecated-
modal>
</
template
>
</
template
>
app/assets/javascripts/ide/components/repo_commit_section.vue
View file @
8bd98e65
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
{
mapState
,
mapActions
,
mapGetters
}
from
'
vuex
'
;
import
{
mapState
,
mapActions
,
mapGetters
}
from
'
vuex
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
modal
from
'
~/vue_shared/components/
modal.vue
'
;
import
DeprecatedModal
from
'
~/vue_shared/components/deprecated_
modal.vue
'
;
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
import
commitFilesList
from
'
./commit_sidebar/list.vue
'
;
import
commitFilesList
from
'
./commit_sidebar/list.vue
'
;
import
*
as
consts
from
'
../stores/modules/commit/constants
'
;
import
*
as
consts
from
'
../stores/modules/commit/constants
'
;
...
@@ -10,7 +10,7 @@ import Actions from './commit_sidebar/actions.vue';
...
@@ -10,7 +10,7 @@ import Actions from './commit_sidebar/actions.vue';
export
default
{
export
default
{
components
:
{
components
:
{
m
odal
,
DeprecatedM
odal
,
icon
,
icon
,
commitFilesList
,
commitFilesList
,
Actions
,
Actions
,
...
@@ -37,23 +37,20 @@ export default {
...
@@ -37,23 +37,20 @@ export default {
'
lastCommitMsg
'
,
'
lastCommitMsg
'
,
'
changedFiles
'
,
'
changedFiles
'
,
]),
]),
...
mapState
(
'
commit
'
,
[
...
mapState
(
'
commit
'
,
[
'
commitMessage
'
,
'
submitCommitLoading
'
]),
'
commitMessage
'
,
'
submitCommitLoading
'
,
]),
...
mapGetters
(
'
commit
'
,
[
...
mapGetters
(
'
commit
'
,
[
'
commitButtonDisabled
'
,
'
commitButtonDisabled
'
,
'
discardDraftButtonDisabled
'
,
'
discardDraftButtonDisabled
'
,
'
branchName
'
,
'
branchName
'
,
]),
]),
statusSvg
()
{
statusSvg
()
{
return
this
.
lastCommitMsg
?
this
.
committedStateSvgPath
:
this
.
noChangesStateSvgPath
;
return
this
.
lastCommitMsg
?
this
.
committedStateSvgPath
:
this
.
noChangesStateSvgPath
;
},
},
},
},
methods
:
{
methods
:
{
...
mapActions
([
...
mapActions
([
'
setPanelCollapsedStatus
'
]),
'
setPanelCollapsedStatus
'
,
]),
...
mapActions
(
'
commit
'
,
[
...
mapActions
(
'
commit
'
,
[
'
updateCommitMessage
'
,
'
updateCommitMessage
'
,
'
discardDraft
'
,
'
discardDraft
'
,
...
@@ -67,8 +64,9 @@ export default {
...
@@ -67,8 +64,9 @@ export default {
});
});
},
},
forceCreateNewBranch
()
{
forceCreateNewBranch
()
{
return
this
.
updateCommitAction
(
consts
.
COMMIT_TO_NEW_BRANCH
)
return
this
.
updateCommitAction
(
consts
.
COMMIT_TO_NEW_BRANCH
).
then
(()
=>
.
then
(()
=>
this
.
commitChanges
());
this
.
commitChanges
(),
);
},
},
},
},
};
};
...
@@ -81,7 +79,7 @@ export default {
...
@@ -81,7 +79,7 @@ export default {
'multi-file-commit-empty-state-container': !changedFiles.length
'multi-file-commit-empty-state-container': !changedFiles.length
}"
}"
>
>
<modal
<
deprecated-
modal
id=
"ide-create-branch-modal"
id=
"ide-create-branch-modal"
:primary-button-label=
"__('Create new branch')"
:primary-button-label=
"__('Create new branch')"
kind=
"success"
kind=
"success"
...
@@ -92,7 +90,7 @@ export default {
...
@@ -92,7 +90,7 @@ export default {
{{
__
(
`This branch has changed since you started editing.
{{
__
(
`This branch has changed since you started editing.
Would you like to create a new branch?`
)
}}
Would you like to create a new branch?`
)
}}
</
template
>
</
template
>
</modal>
</
deprecated-
modal>
<commit-files-list
<commit-files-list
title=
"Staged"
title=
"Staged"
:file-list=
"changedFiles"
:file-list=
"changedFiles"
...
...
app/assets/javascripts/pages/admin/projects/index/components/delete_project_modal.vue
View file @
8bd98e65
<
script
>
<
script
>
import
_
from
'
underscore
'
;
import
_
from
'
underscore
'
;
import
modal
from
'
~/vue_shared/components/
modal.vue
'
;
import
DeprecatedModal
from
'
~/vue_shared/components/deprecated_
modal.vue
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
export
default
{
export
default
{
components
:
{
components
:
{
m
odal
,
DeprecatedM
odal
,
},
},
props
:
{
props
:
{
deleteProjectUrl
:
{
deleteProjectUrl
:
{
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
</
script
>
</
script
>
<
template
>
<
template
>
<modal
<
deprecated-
modal
id=
"delete-project-modal"
id=
"delete-project-modal"
:title=
"title"
:title=
"title"
:text=
"text"
:text=
"text"
...
@@ -121,5 +121,5 @@
...
@@ -121,5 +121,5 @@
/>
/>
</form>
</form>
</
template
>
</
template
>
</modal>
</
deprecated-
modal>
</template>
</template>
app/assets/javascripts/pages/admin/users/components/delete_user_modal.vue
View file @
8bd98e65
<
script
>
<
script
>
import
_
from
'
underscore
'
;
import
_
from
'
underscore
'
;
import
modal
from
'
~/vue_shared/components/
modal.vue
'
;
import
DeprecatedModal
from
'
~/vue_shared/components/deprecated_
modal.vue
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
export
default
{
export
default
{
components
:
{
components
:
{
m
odal
,
DeprecatedM
odal
,
},
},
props
:
{
props
:
{
deleteUserUrl
:
{
deleteUserUrl
:
{
...
@@ -113,7 +113,7 @@
...
@@ -113,7 +113,7 @@
</
script
>
</
script
>
<
template
>
<
template
>
<modal
<
deprecated-
modal
id=
"delete-user-modal"
id=
"delete-user-modal"
:title=
"title"
:title=
"title"
:text=
"text"
:text=
"text"
...
@@ -170,5 +170,5 @@
...
@@ -170,5 +170,5 @@
{{
secondaryButtonLabel
}}
{{
secondaryButtonLabel
}}
</button>
</button>
</
template
>
</
template
>
</modal>
</
deprecated-
modal>
</template>
</template>
app/assets/javascripts/pages/milestones/shared/components/delete_milestone_modal.vue
View file @
8bd98e65
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
Flash
from
'
~/flash
'
;
import
Flash
from
'
~/flash
'
;
import
modal
from
'
~/vue_shared/components/
modal.vue
'
;
import
DeprecatedModal
from
'
~/vue_shared/components/deprecated_
modal.vue
'
;
import
{
n__
,
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
n__
,
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
redirectTo
}
from
'
~/lib/utils/url_utility
'
;
import
{
redirectTo
}
from
'
~/lib/utils/url_utility
'
;
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
export
default
{
export
default
{
components
:
{
components
:
{
m
odal
,
DeprecatedM
odal
,
},
},
props
:
{
props
:
{
issueCount
:
{
issueCount
:
{
...
@@ -92,7 +92,7 @@ Once deleted, it cannot be undone or recovered.`),
...
@@ -92,7 +92,7 @@ Once deleted, it cannot be undone or recovered.`),
</
script
>
</
script
>
<
template
>
<
template
>
<modal
<
deprecated-
modal
id=
"delete-milestone-modal"
id=
"delete-milestone-modal"
:title=
"title"
:title=
"title"
:text=
"text"
:text=
"text"
...
@@ -106,5 +106,5 @@ Once deleted, it cannot be undone or recovered.`),
...
@@ -106,5 +106,5 @@ Once deleted, it cannot be undone or recovered.`),
<p
v-html=
"props.text"
></p>
<p
v-html=
"props.text"
></p>
</
template
>
</
template
>
</modal>
</
deprecated-
modal>
</template>
</template>
app/assets/javascripts/pipelines/components/pipelines_table.vue
View file @
8bd98e65
<
script
>
<
script
>
import
modal
from
'
~/vue_shared/components/
modal.vue
'
;
import
DeprecatedModal
from
'
~/vue_shared/components/deprecated_
modal.vue
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
pipelinesTableRowComponent
from
'
./pipelines_table_row.vue
'
;
import
pipelinesTableRowComponent
from
'
./pipelines_table_row.vue
'
;
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
export
default
{
export
default
{
components
:
{
components
:
{
pipelinesTableRowComponent
,
pipelinesTableRowComponent
,
m
odal
,
DeprecatedM
odal
,
},
},
props
:
{
props
:
{
pipelines
:
{
pipelines
:
{
...
@@ -120,7 +120,7 @@
...
@@ -120,7 +120,7 @@
:auto-devops-help-path=
"autoDevopsHelpPath"
:auto-devops-help-path=
"autoDevopsHelpPath"
:view-type=
"viewType"
:view-type=
"viewType"
/>
/>
<modal
<
deprecated-
modal
id=
"confirmation-modal"
id=
"confirmation-modal"
:title=
"modalTitle"
:title=
"modalTitle"
:text=
"modalText"
:text=
"modalText"
...
@@ -134,6 +134,6 @@
...
@@ -134,6 +134,6 @@
>
>
<p
v-html=
"props.text"
></p>
<p
v-html=
"props.text"
></p>
</
template
>
</
template
>
</modal>
</
deprecated-
modal>
</div>
</div>
</template>
</template>
app/assets/javascripts/profile/account/components/delete_account_modal.vue
View file @
8bd98e65
<
script
>
<
script
>
import
modal
from
'
~/vue_shared/components/
modal.vue
'
;
import
DeprecatedModal
from
'
~/vue_shared/components/deprecated_
modal.vue
'
;
import
{
__
,
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
__
,
s__
,
sprintf
}
from
'
~/locale
'
;
import
csrf
from
'
~/lib/utils/csrf
'
;
import
csrf
from
'
~/lib/utils/csrf
'
;
export
default
{
export
default
{
components
:
{
components
:
{
m
odal
,
DeprecatedM
odal
,
},
},
props
:
{
props
:
{
actionUrl
:
{
actionUrl
:
{
...
@@ -76,7 +76,7 @@ Once you confirm %{deleteAccount}, it cannot be undone or recovered.`),
...
@@ -76,7 +76,7 @@ Once you confirm %{deleteAccount}, it cannot be undone or recovered.`),
</
script
>
</
script
>
<
template
>
<
template
>
<modal
<
deprecated-
modal
id=
"delete-account-modal"
id=
"delete-account-modal"
:title=
"s__('Profiles|Delete your account?')"
:title=
"s__('Profiles|Delete your account?')"
:text=
"text"
:text=
"text"
...
@@ -131,5 +131,5 @@ Once you confirm %{deleteAccount}, it cannot be undone or recovered.`),
...
@@ -131,5 +131,5 @@ Once you confirm %{deleteAccount}, it cannot be undone or recovered.`),
</form>
</form>
</
template
>
</
template
>
</modal>
</
deprecated-
modal>
</template>
</template>
app/assets/javascripts/vue_shared/components/modal.vue
→
app/assets/javascripts/vue_shared/components/
deprecated_
modal.vue
View file @
8bd98e65
<
script
>
<
script
>
/* eslint-disable vue/require-default-prop */
/* eslint-disable vue/require-default-prop */
export
default
{
export
default
{
name
:
'
Modal
'
,
name
:
'
DeprecatedModal
'
,
// use GlModal instead
props
:
{
props
:
{
id
:
{
id
:
{
...
...
app/assets/javascripts/vue_shared/components/recaptcha_modal.vue
View file @
8bd98e65
<
script
>
<
script
>
import
modal
from
'
./
modal.vue
'
;
import
DeprecatedModal
from
'
./deprecated_
modal.vue
'
;
export
default
{
export
default
{
name
:
'
RecaptchaModal
'
,
name
:
'
RecaptchaModal
'
,
components
:
{
components
:
{
m
odal
,
DeprecatedM
odal
,
},
},
props
:
{
props
:
{
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
</
script
>
</
script
>
<
template
>
<
template
>
<modal
<
deprecated-
modal
kind=
"warning"
kind=
"warning"
class=
"recaptcha-modal js-recaptcha-modal"
class=
"recaptcha-modal js-recaptcha-modal"
:hide-footer=
"true"
:hide-footer=
"true"
...
@@ -82,5 +82,5 @@
...
@@ -82,5 +82,5 @@
>
>
</div>
</div>
</div>
</div>
</modal>
</
deprecated-
modal>
</
template
>
</
template
>
changelogs/unreleased/winh-deprecate-old-modal.yml
0 → 100644
View file @
8bd98e65
---
title
:
Rename modal.vue to deprecated_modal.vue
merge_request
:
17438
author
:
type
:
other
ee/app/assets/javascripts/boards/components/board_form.vue
View file @
8bd98e65
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
/* global BoardService */
/* global BoardService */
import
Flash
from
'
~/flash
'
;
import
Flash
from
'
~/flash
'
;
import
modal
from
'
~/vue_shared/components/
modal.vue
'
;
import
DeprecatedModal
from
'
~/vue_shared/components/deprecated_
modal.vue
'
;
import
BoardLabelsSelect
from
'
~/vue_shared/components/sidebar/labels_select/base.vue
'
;
import
BoardLabelsSelect
from
'
~/vue_shared/components/sidebar/labels_select/base.vue
'
;
import
{
visitUrl
}
from
'
~/lib/utils/url_utility
'
;
import
{
visitUrl
}
from
'
~/lib/utils/url_utility
'
;
import
BoardMilestoneSelect
from
'
./milestone_select.vue
'
;
import
BoardMilestoneSelect
from
'
./milestone_select.vue
'
;
...
@@ -30,7 +30,7 @@ export default {
...
@@ -30,7 +30,7 @@ export default {
BoardLabelsSelect
,
BoardLabelsSelect
,
BoardMilestoneSelect
,
BoardMilestoneSelect
,
BoardWeightSelect
,
BoardWeightSelect
,
m
odal
,
DeprecatedM
odal
,
},
},
props
:
{
props
:
{
canAdminBoard
:
{
canAdminBoard
:
{
...
@@ -148,12 +148,14 @@ export default {
...
@@ -148,12 +148,14 @@ export default {
if
(
label
.
isAny
)
{
if
(
label
.
isAny
)
{
this
.
board
.
labels
=
[];
this
.
board
.
labels
=
[];
}
else
if
(
!
this
.
board
.
labels
.
find
(
l
=>
l
.
id
===
label
.
id
))
{
}
else
if
(
!
this
.
board
.
labels
.
find
(
l
=>
l
.
id
===
label
.
id
))
{
this
.
board
.
labels
.
push
(
new
ListLabel
({
this
.
board
.
labels
.
push
(
id
:
label
.
id
,
new
ListLabel
({
title
:
label
.
title
,
id
:
label
.
id
,
color
:
label
.
color
[
0
],
title
:
label
.
title
,
textColor
:
label
.
text_color
,
color
:
label
.
color
[
0
],
}));
textColor
:
label
.
text_color
,
}),
);
}
else
{
}
else
{
let
labels
=
this
.
board
.
labels
;
let
labels
=
this
.
board
.
labels
;
labels
=
labels
.
filter
(
selected
=>
selected
.
id
!==
label
.
id
);
labels
=
labels
.
filter
(
selected
=>
selected
.
id
!==
label
.
id
);
...
@@ -164,7 +166,8 @@ export default {
...
@@ -164,7 +166,8 @@ export default {
if
(
this
.
board
.
name
.
length
===
0
)
return
;
if
(
this
.
board
.
name
.
length
===
0
)
return
;
this
.
isLoading
=
true
;
this
.
isLoading
=
true
;
if
(
this
.
isDeleteForm
)
{
if
(
this
.
isDeleteForm
)
{
gl
.
boardService
.
deleteBoard
(
this
.
currentBoard
)
gl
.
boardService
.
deleteBoard
(
this
.
currentBoard
)
.
then
(()
=>
{
.
then
(()
=>
{
visitUrl
(
Store
.
rootPath
);
visitUrl
(
Store
.
rootPath
);
})
})
...
@@ -173,9 +176,10 @@ export default {
...
@@ -173,9 +176,10 @@ export default {
this
.
isLoading
=
false
;
this
.
isLoading
=
false
;
});
});
}
else
{
}
else
{
gl
.
boardService
.
createBoard
(
this
.
board
)
gl
.
boardService
.
createBoard
(
this
.
board
)
.
then
(
resp
=>
resp
.
data
)
.
then
(
resp
=>
resp
.
data
)
.
then
(
(
data
)
=>
{
.
then
(
data
=>
{
visitUrl
(
data
.
board_path
);
visitUrl
(
data
.
board_path
);
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
...
@@ -200,7 +204,7 @@ export default {
...
@@ -200,7 +204,7 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<modal
<
deprecated-
modal
v-show=
"isVisible"
v-show=
"isVisible"
modal-dialog-class=
"board-config-modal"
modal-dialog-class=
"board-config-modal"
:hide-footer=
"readonly"
:hide-footer=
"readonly"
...
@@ -300,5 +304,5 @@ export default {
...
@@ -300,5 +304,5 @@ export default {
</div>
</div>
</form>
</form>
</
template
>
</
template
>
</modal>
</
deprecated-
modal>
</template>
</template>
ee/app/assets/javascripts/geo_nodes/components/app.vue
View file @
8bd98e65
<
script
>
<
script
>
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
Flash
from
'
~/flash
'
;
import
Flash
from
'
~/flash
'
;
import
statusCodes
from
'
~/lib/utils/http_status
'
;
import
statusCodes
from
'
~/lib/utils/http_status
'
;
import
loadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
import
loadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
import
modal
from
'
~/vue_shared/components/
modal.vue
'
;
import
DeprecatedModal
from
'
~/vue_shared/components/deprecated_
modal.vue
'
;
import
SmartInterval
from
'
~/smart_interval
'
;
import
SmartInterval
from
'
~/smart_interval
'
;
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
import
{
NODE_ACTIONS
}
from
'
../constants
'
;
import
{
NODE_ACTIONS
}
from
'
../constants
'
;
import
geoNodesList
from
'
./geo_nodes_list.vue
'
;
import
geoNodesList
from
'
./geo_nodes_list.vue
'
;
export
default
{
export
default
{
components
:
{
components
:
{
loadingIcon
,
loadingIcon
,
modal
,
DeprecatedModal
,
geoNodesList
,
geoNodesList
,
},
props
:
{
store
:
{
type
:
Object
,
required
:
true
,
},
},
props
:
{
service
:
{
store
:
{
type
:
Object
,
type
:
Object
,
required
:
true
,
required
:
true
,
},
service
:
{
type
:
Object
,
required
:
true
,
},
nodeActionsAllowed
:
{
type
:
Boolean
,
required
:
true
,
},
nodeEditAllowed
:
{
type
:
Boolean
,
required
:
true
,
},
},
},
data
()
{
nodeActionsAllowed
:
{
return
{
type
:
Boolean
,
isLoading
:
true
,
required
:
true
,
hasError
:
false
,
showModal
:
false
,
targetNode
:
null
,
targetNodeActionType
:
''
,
modalKind
:
'
warning
'
,
modalMessage
:
''
,
modalActionLabel
:
''
,
errorMessage
:
''
,
};
},
},
computed
:
{
nodeEditAllowed
:
{
nodes
()
{
type
:
Boolean
,
return
this
.
store
.
getNodes
();
required
:
true
,
},
},
},
created
()
{
},
eventHub
.
$on
(
'
pollNodeDetails
'
,
this
.
initNodeDetailsPolling
);
data
()
{
eventHub
.
$on
(
'
showNodeActionModal
'
,
this
.
showNodeActionModal
);
return
{
eventHub
.
$on
(
'
repairNode
'
,
this
.
repairNode
);
isLoading
:
true
,
hasError
:
false
,
showModal
:
false
,
targetNode
:
null
,
targetNodeActionType
:
''
,
modalKind
:
'
warning
'
,
modalMessage
:
''
,
modalActionLabel
:
''
,
errorMessage
:
''
,
};
},
computed
:
{
nodes
()
{
return
this
.
store
.
getNodes
();
},
},
mounted
()
{
},
this
.
fetchGeoNodes
();
created
()
{
eventHub
.
$on
(
'
pollNodeDetails
'
,
this
.
initNodeDetailsPolling
);
eventHub
.
$on
(
'
showNodeActionModal
'
,
this
.
showNodeActionModal
);
eventHub
.
$on
(
'
repairNode
'
,
this
.
repairNode
);
},
mounted
()
{
this
.
fetchGeoNodes
();
},
beforeDestroy
()
{
eventHub
.
$off
(
'
pollNodeDetails
'
,
this
.
initNodeDetailsPolling
);
eventHub
.
$off
(
'
showNodeActionModal
'
,
this
.
showNodeActionModal
);
eventHub
.
$off
(
'
repairNode
'
,
this
.
repairNode
);
if
(
this
.
nodePollingInterval
)
{
this
.
nodePollingInterval
.
stopTimer
();
}
},
methods
:
{
setNodeActionStatus
(
node
,
status
)
{
Object
.
assign
(
node
,
{
nodeActionActive
:
status
});
},
},
beforeDestroy
()
{
initNodeDetailsPolling
(
node
)
{
eventHub
.
$off
(
'
pollNodeDetails
'
,
this
.
initNodeDetailsPolling
);
this
.
nodePollingInterval
=
new
SmartInterval
({
eventHub
.
$off
(
'
showNodeActionModal
'
,
this
.
showNodeActionModal
);
callback
:
this
.
fetchNodeDetails
.
bind
(
this
,
node
),
eventHub
.
$off
(
'
repairNode
'
,
this
.
repairNode
);
startingInterval
:
30000
,
if
(
this
.
nodePollingInterval
)
{
maxInterval
:
120000
,
this
.
nodePollingInterval
.
stopTimer
();
hiddenInterval
:
240000
,
}
incrementByFactorOf
:
15000
,
immediateExecution
:
true
,
});
},
},
methods
:
{
fetchGeoNodes
()
{
setNodeActionStatus
(
node
,
status
)
{
this
.
hasError
=
false
;
Object
.
assign
(
node
,
{
nodeActionActive
:
status
});
this
.
service
},
.
getGeoNodes
()
initNodeDetailsPolling
(
node
)
{
.
then
(
res
=>
res
.
data
)
this
.
nodePollingInterval
=
new
SmartInterval
(
{
.
then
(
nodes
=>
{
callback
:
this
.
fetchNodeDetails
.
bind
(
this
,
node
),
this
.
store
.
setNodes
(
nodes
);
startingInterval
:
30000
,
this
.
isLoading
=
false
;
maxInterval
:
120000
,
})
hiddenInterval
:
240000
,
.
catch
(
err
=>
{
incrementByFactorOf
:
15000
,
this
.
hasError
=
true
;
immediateExecution
:
true
,
this
.
errorMessage
=
err
;
});
});
},
},
fetchGeoNodes
()
{
fetchNodeDetails
(
node
)
{
this
.
hasError
=
false
;
const
nodeId
=
node
.
id
;
this
.
service
.
getGeoNodes
()
return
this
.
service
.
then
(
res
=>
res
.
data
)
.
getGeoNodeDetails
(
node
)
.
then
((
nodes
)
=>
{
.
then
(
res
=>
res
.
data
)
this
.
store
.
setNodes
(
nodes
);
.
then
(
nodeDetails
=>
{
this
.
isLoading
=
false
;
const
primaryNodeVersion
=
this
.
store
.
getPrimaryNodeVersion
();
})
const
updatedNodeDetails
=
Object
.
assign
(
nodeDetails
,
{
.
catch
((
err
)
=>
{
primaryVersion
:
primaryNodeVersion
.
version
,
this
.
hasError
=
true
;
primaryRevision
:
primaryNodeVersion
.
revision
,
this
.
errorMessage
=
err
;
});
});
},
this
.
store
.
setNodeDetails
(
nodeId
,
updatedNodeDetails
);
fetchNodeDetails
(
node
)
{
eventHub
.
$emit
(
const
nodeId
=
node
.
id
;
'
nodeDetailsLoaded
'
,
return
this
.
service
.
getGeoNodeDetails
(
node
)
this
.
store
.
getNodeDetails
(
nodeId
),
.
then
(
res
=>
res
.
data
)
);
.
then
((
nodeDetails
)
=>
{
})
const
primaryNodeVersion
=
this
.
store
.
getPrimaryNodeVersion
();
.
catch
(
err
=>
{
const
updatedNodeDetails
=
Object
.
assign
(
nodeDetails
,
{
if
(
err
.
response
&&
err
.
response
.
status
===
statusCodes
.
NOT_FOUND
)
{
primaryVersion
:
primaryNodeVersion
.
version
,
this
.
store
.
setNodeDetails
(
nodeId
,
{
primaryRevision
:
primaryNodeVersion
.
revision
,
geo_node_id
:
nodeId
,
health
:
err
.
message
,
health_status
:
'
Unknown
'
,
missing_oauth_application
:
false
,
sync_status_unavailable
:
true
,
storage_shards_match
:
null
,
});
});
this
.
store
.
setNodeDetails
(
nodeId
,
updatedNodeDetails
);
eventHub
.
$emit
(
eventHub
.
$emit
(
'
nodeDetailsLoaded
'
,
this
.
store
.
getNodeDetails
(
nodeId
));
'
nodeDetailsLoaded
'
,
})
this
.
store
.
getNodeDetails
(
nodeId
),
.
catch
((
err
)
=>
{
);
if
(
err
.
response
&&
err
.
response
.
status
===
statusCodes
.
NOT_FOUND
)
{
}
else
{
this
.
store
.
setNodeDetails
(
nodeId
,
{
eventHub
.
$emit
(
'
nodeDetailsLoadFailed
'
,
nodeId
,
err
);
geo_node_id
:
nodeId
,
}
health
:
err
.
message
,
});
health_status
:
'
Unknown
'
,
},
missing_oauth_application
:
false
,
repairNode
(
targetNode
)
{
sync_status_unavailable
:
true
,
this
.
setNodeActionStatus
(
targetNode
,
true
);
storage_shards_match
:
null
,
this
.
service
});
.
repairNode
(
targetNode
)
eventHub
.
$emit
(
'
nodeDetailsLoaded
'
,
this
.
store
.
getNodeDetails
(
nodeId
));
.
then
(()
=>
{
}
else
{
this
.
setNodeActionStatus
(
targetNode
,
false
);
eventHub
.
$emit
(
'
nodeDetailsLoadFailed
'
,
nodeId
,
err
);
Flash
(
}
s__
(
'
GeoNodes|Node Authentication was successfully repaired.
'
),
});
'
notice
'
,
},
);
repairNode
(
targetNode
)
{
})
this
.
setNodeActionStatus
(
targetNode
,
true
);
.
catch
(()
=>
{
this
.
service
.
repairNode
(
targetNode
)
this
.
setNodeActionStatus
(
targetNode
,
false
);
.
then
(()
=>
{
Flash
(
s__
(
'
GeoNodes|Something went wrong while repairing node
'
));
this
.
setNodeActionStatus
(
targetNode
,
false
);
});
Flash
(
s__
(
'
GeoNodes|Node Authentication was successfully repaired.
'
),
'
notice
'
);
},
})
toggleNode
(
targetNode
)
{
.
catch
(()
=>
{
this
.
setNodeActionStatus
(
targetNode
,
true
);
this
.
setNodeActionStatus
(
targetNode
,
false
);
this
.
service
Flash
(
s__
(
'
GeoNodes|Something went wrong while repairing node
'
));
.
toggleNode
(
targetNode
)
});
.
then
(
res
=>
res
.
data
)
},
.
then
(
node
=>
{
toggleNode
(
targetNode
)
{
Object
.
assign
(
targetNode
,
{
this
.
setNodeActionStatus
(
targetNode
,
true
);
enabled
:
node
.
enabled
,
this
.
service
.
toggleNode
(
targetNode
)
nodeActionActive
:
false
,
.
then
(
res
=>
res
.
data
)
.
then
((
node
)
=>
{
Object
.
assign
(
targetNode
,
{
enabled
:
node
.
enabled
,
nodeActionActive
:
false
});
})
.
catch
(()
=>
{
this
.
setNodeActionStatus
(
targetNode
,
false
);
Flash
(
s__
(
'
GeoNodes|Something went wrong while changing node status
'
));
});
},
removeNode
(
targetNode
)
{
this
.
setNodeActionStatus
(
targetNode
,
true
);
this
.
service
.
removeNode
(
targetNode
)
.
then
(()
=>
{
this
.
store
.
removeNode
(
targetNode
);
Flash
(
s__
(
'
GeoNodes|Node was successfully removed.
'
),
'
notice
'
);
})
.
catch
(()
=>
{
this
.
setNodeActionStatus
(
targetNode
,
false
);
Flash
(
s__
(
'
GeoNodes|Something went wrong while removing node
'
));
});
});
},
})
handleNodeAction
()
{
.
catch
(()
=>
{
this
.
showModal
=
false
;
this
.
setNodeActionStatus
(
targetNode
,
false
);
Flash
(
s__
(
'
GeoNodes|Something went wrong while changing node status
'
),
);
});
},
removeNode
(
targetNode
)
{
this
.
setNodeActionStatus
(
targetNode
,
true
);
this
.
service
.
removeNode
(
targetNode
)
.
then
(()
=>
{
this
.
store
.
removeNode
(
targetNode
);
Flash
(
s__
(
'
GeoNodes|Node was successfully removed.
'
),
'
notice
'
);
})
.
catch
(()
=>
{
this
.
setNodeActionStatus
(
targetNode
,
false
);
Flash
(
s__
(
'
GeoNodes|Something went wrong while removing node
'
));
});
},
handleNodeAction
()
{
this
.
showModal
=
false
;
if
(
this
.
targetNodeActionType
===
NODE_ACTIONS
.
TOGGLE
)
{
if
(
this
.
targetNodeActionType
===
NODE_ACTIONS
.
TOGGLE
)
{
this
.
toggleNode
(
this
.
targetNode
);
this
.
toggleNode
(
this
.
targetNode
);
}
else
if
(
this
.
targetNodeActionType
===
NODE_ACTIONS
.
REMOVE
)
{
}
else
if
(
this
.
targetNodeActionType
===
NODE_ACTIONS
.
REMOVE
)
{
this
.
removeNode
(
this
.
targetNode
);
this
.
removeNode
(
this
.
targetNode
);
}
}
},
},
showNodeActionModal
({
actionType
,
node
,
modalKind
=
'
warning
'
,
modalMessage
,
modalActionLabel
})
{
showNodeActionModal
({
this
.
targetNode
=
node
;
actionType
,
this
.
targetNodeActionType
=
actionType
;
node
,
this
.
modalKind
=
modalKind
;
modalKind
=
'
warning
'
,
this
.
modalMessage
=
modalMessage
;
modalMessage
,
this
.
modalActionLabel
=
modalActionLabel
;
modalActionLabel
,
})
{
this
.
targetNode
=
node
;
this
.
targetNodeActionType
=
actionType
;
this
.
modalKind
=
modalKind
;
this
.
modalMessage
=
modalMessage
;
this
.
modalActionLabel
=
modalActionLabel
;
if
(
actionType
===
NODE_ACTIONS
.
TOGGLE
&&
!
node
.
enabled
)
{
if
(
actionType
===
NODE_ACTIONS
.
TOGGLE
&&
!
node
.
enabled
)
{
this
.
toggleNode
(
this
.
targetNode
);
this
.
toggleNode
(
this
.
targetNode
);
}
else
{
}
else
{
this
.
showModal
=
true
;
this
.
showModal
=
true
;
}
}
},
},
hideNodeActionModal
()
{
hideNodeActionModal
()
{
this
.
showModal
=
false
;
this
.
showModal
=
false
;
},
},
},
};
},
};
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -214,7 +239,7 @@
...
@@ -214,7 +239,7 @@
>
>
{{
errorMessage
}}
{{
errorMessage
}}
</p>
</p>
<modal
<
deprecated-
modal
v-show=
"showModal"
v-show=
"showModal"
:title=
"__('Are you sure?')"
:title=
"__('Are you sure?')"
:kind=
"modalKind"
:kind=
"modalKind"
...
...
spec/javascripts/vue_shared/components/modal_spec.js
→
spec/javascripts/vue_shared/components/
deprecated_
modal_spec.js
View file @
8bd98e65
import
$
from
'
jquery
'
;
import
$
from
'
jquery
'
;
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
modal
from
'
~/vue_shared/components/
modal.vue
'
;
import
DeprecatedModal
from
'
~/vue_shared/components/deprecated_
modal.vue
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
const
modalComponent
=
Vue
.
extend
(
m
odal
);
const
modalComponent
=
Vue
.
extend
(
DeprecatedM
odal
);
describe
(
'
Modal
'
,
()
=>
{
describe
(
'
Deprecated
Modal
'
,
()
=>
{
let
vm
;
let
vm
;
afterEach
(()
=>
{
afterEach
(()
=>
{
...
...
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