Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HUB Terra
SMS
Frontend
Commits
369d1dc5
Commit
369d1dc5
authored
2 years ago
by
Tobias Kuhnert
Browse files
Options
Downloads
Patches
Plain Diff
updated - added missing feature/removed unused code
parent
17c9a6ca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!296
Merge develop for staging release
,
!225
Draft: Resolve "[Refactoring] Improve vuex store usage"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pages/configurations/_configurationId/platforms-and-devices/mount.vue
+47
-7
47 additions, 7 deletions
...urations/_configurationId/platforms-and-devices/mount.vue
with
47 additions
and
7 deletions
pages/configurations/_configurationId/platforms-and-devices/mount.vue
+
47
−
7
View file @
369d1dc5
<
template
>
<div>
<ProgressIndicator
v-model=
"isInProgress"
:dark=
"isSaving"
/>
<v-card-actions>
<v-spacer
/>
<v-btn
...
...
@@ -338,9 +342,10 @@ import { PlatformMountAction } from '@/models/PlatformMountAction'
import
HintCard
from
'
@/components/HintCard.vue
'
import
{
mount
}
from
'
@vue/test-utils
'
import
{
dateToDateTimeStringHHMM
}
from
'
@/utils/dateHelper
'
import
ProgressIndicator
from
'
@/components/ProgressIndicator.vue
'
@
Component
({
components
:
{
HintCard
,
PlatformMountListItem
,
ConfigurationsPlatformDeviceMountForm
,
DevicesMountListItem
,
DevicesListItem
,
BaseList
,
DateTimePicker
,
ConfigurationsTreeView
},
components
:
{
ProgressIndicator
,
HintCard
,
PlatformMountListItem
,
ConfigurationsPlatformDeviceMountForm
,
DevicesMountListItem
,
DevicesListItem
,
BaseList
,
DateTimePicker
,
ConfigurationsTreeView
},
middleware
:[
'
auth
'
],
filters
:{
dateToDateTimeStringHHMM
},
computed
:{
...
...
@@ -358,7 +363,9 @@ import { dateToDateTimeStringHHMM } from '@/utils/dateHelper'
}
})
export
default
class
ConfigurationMountPlatformsAndDevicesPage
extends
Vue
{
private
loading
=
false
private
isSaving
=
false
private
isLoading
=
false
private
tab
=
null
private
step
=
1
...
...
@@ -371,7 +378,14 @@ export default class ConfigurationMountPlatformsAndDevicesPage extends Vue {
private
deviceToMount
=
null
async
created
(){
await
this
.
loadAllContacts
()
try
{
this
.
isLoading
=
true
await
this
.
loadAllContacts
()
}
catch
(
e
)
{
this
.
$store
.
commit
(
'
snackbar/setError
'
,
'
Failed to fetch contacts
'
)
}
finally
{
this
.
isLoading
=
false
}
}
get
configurationId
():
string
{
...
...
@@ -396,6 +410,10 @@ export default class ConfigurationMountPlatformsAndDevicesPage extends Vue {
return
null
}
get
isInProgress
():
boolean
{
return
this
.
isLoading
||
this
.
isSaving
}
clearBasicSearchPlatforms
(){
this
.
searchTextPlatforms
=
null
}
...
...
@@ -404,10 +422,24 @@ export default class ConfigurationMountPlatformsAndDevicesPage extends Vue {
}
async
searchDevicesForMount
(){
try
{
this
.
isLoading
=
true
await
this
.
searchDevices
({
searchText
:
this
.
searchTextDevices
})
}
catch
(
e
)
{
this
.
$store
.
commit
(
'
snackbar/setError
'
,
'
Loading of devices failed
'
)
}
finally
{
this
.
isLoading
=
false
}
}
async
searchPlatformsForMount
(){
try
{
this
.
isLoading
=
true
await
this
.
searchPlatforms
({
searchText
:
this
.
searchTextPlatforms
})
}
catch
(
e
)
{
this
.
$store
.
commit
(
'
snackbar/setError
'
,
'
Loading of platforms failed
'
)
}
finally
{
this
.
isLoading
=
false
}
}
mount
(){
...
...
@@ -422,13 +454,15 @@ export default class ConfigurationMountPlatformsAndDevicesPage extends Vue {
mountDevice
(
device
,
mountInfo
){
try
{
let
parentPlatform
=
null
;
if
(
this
.
selectedNode
&&
!
this
.
selectedNode
.
canHaveChildren
()){
this
.
$store
.
commit
(
'
snackbar/setError
'
,
'
Selected node-type cannot have children
'
)
return
}
this
.
isSaving
=
true
let
parentPlatform
=
null
;
if
(
this
.
selectedNode
&&
this
.
selectedNode
.
canHaveChildren
())
{
parentPlatform
=
(
this
.
selectedNode
as
PlatformNode
).
unpack
().
platform
}
...
...
@@ -454,19 +488,23 @@ export default class ConfigurationMountPlatformsAndDevicesPage extends Vue {
this
.
$router
.
push
(
'
/configurations/
'
+
this
.
configurationId
+
'
/platforms-and-devices
'
)
}
catch
(
e
)
{
this
.
$store
.
commit
(
'
snackbar/setError
'
,
'
Failed to add device mount action
'
)
}
finally
{
this
.
isSaving
=
false
}
}
async
mountPlatform
(
platform
,
mountInfo
){
try
{
let
parentPlatform
=
null
;
if
(
this
.
selectedNode
&&
!
this
.
selectedNode
.
canHaveChildren
()){
this
.
$store
.
commit
(
'
snackbar/setError
'
,
'
Selected node-type cannot have children
'
)
return
}
let
parentPlatform
=
null
;
this
.
isSaving
=
true
if
(
this
.
selectedNode
&&
this
.
selectedNode
.
canHaveChildren
())
{
parentPlatform
=
(
this
.
selectedNode
as
PlatformNode
).
unpack
().
platform
}
...
...
@@ -492,6 +530,8 @@ export default class ConfigurationMountPlatformsAndDevicesPage extends Vue {
this
.
$router
.
push
(
'
/configurations/
'
+
this
.
configurationId
+
'
/platforms-and-devices
'
)
}
catch
(
e
)
{
this
.
$store
.
commit
(
'
snackbar/setError
'
,
'
Failed to add platform mount action
'
)
}
finally
{
this
.
isSaving
=
false
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment