Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vospace-ui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VOSpace INAF
vospace-ui
Commits
56ab5075
Commit
56ab5075
authored
2 years ago
by
Nicola Fulvio Calabria
Browse files
Options
Downloads
Patches
Plain Diff
Added Create New Collection modal and button
parent
672d0de5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vospace-ui-frontend/src/components/Collections.vue
+7
-1
7 additions, 1 deletion
vospace-ui-frontend/src/components/Collections.vue
vospace-ui-frontend/src/components/modal/CreateCollectionModal.vue
+62
-0
62 additions, 0 deletions
...i-frontend/src/components/modal/CreateCollectionModal.vue
with
69 additions
and
1 deletion
vospace-ui-frontend/src/components/Collections.vue
+
7
−
1
View file @
56ab5075
...
@@ -7,6 +7,9 @@
...
@@ -7,6 +7,9 @@
<div>
<div>
<b-button
variant=
"primary"
class=
"float-right"
@
click=
"loadCollections"
>
Reload
</b-button>
<b-button
variant=
"primary"
class=
"float-right"
@
click=
"loadCollections"
>
Reload
</b-button>
<h3>
Collections
</h3>
<h3>
Collections
</h3>
<div
class=
"mb-3"
>
<b-button
variant=
"success"
class=
"mr-2"
v-b-modal.create-collection-modal
>
New collection
</b-button>
</div>
<div
v-if=
"jobs.length > 0"
class=
"mb-3"
>
<div
v-if=
"jobs.length > 0"
class=
"mb-3"
>
<table
class=
"table b-table table-striped table-hover"
>
<table
class=
"table b-table table-striped table-hover"
>
<thead>
<thead>
...
@@ -35,15 +38,18 @@
...
@@ -35,15 +38,18 @@
</div>
</div>
</div>
</div>
<FAQModal/>
<FAQModal/>
<CreateCollectionModal
/>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
FAQModal
from
'
./modal/FAQModal.vue
'
import
FAQModal
from
'
./modal/FAQModal.vue
'
import
CreateCollectionModal
from
'
./modal/CreateCollectionModal.vue
'
export
default
{
export
default
{
components
:
{
components
:
{
FAQModal
FAQModal
,
CreateCollectionModal
},
},
computed
:
{
computed
:
{
jobs
()
{
return
this
.
$store
.
state
.
jobs
},
jobs
()
{
return
this
.
$store
.
state
.
jobs
},
...
...
This diff is collapsed.
Click to expand it.
vospace-ui-frontend/src/components/modal/CreateCollectionModal.vue
0 → 100644
+
62
−
0
View file @
56ab5075
<!--
This file is part of vospace-ui
Copyright (C) 2021 Istituto Nazionale di Astrofisica
SPDX-License-Identifier: GPL-3.0-or-later
-->
<
template
>
<b-modal
id=
"create-collection-modal"
title=
"Create collection"
okTitle=
"Create"
@
show=
"reset"
@
shown=
"afterShow"
@
ok.prevent=
"createCollection"
>
<b-form>
<label
class=
"w-30"
for=
"new-collection-name-input"
>
Collection name:
</label>
<b-form-input
v-model.trim=
"newCollectionName"
id=
"new-collection-name-input"
ref=
"newCollectionNameInput"
class=
"w-75"
aria-describedby=
"new-collection-name-input-feedback"
:state=
"newCollectionNameState"
v-on:input=
"resetError"
@
keydown.native.enter.prevent=
"createCollection"
>
</b-form-input>
<b-form-invalid-feedback
id=
"new-collection-name-input-feedback"
class=
"text-right"
>
{{
newCollectionNameError
}}
</b-form-invalid-feedback>
</b-form>
</b-modal>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
newCollectionName
:
null
,
newCollectionNameError
:
null
}
},
computed
:
{
newCollectionNameState
()
{
if
(
this
.
newCollectionNameError
)
{
return
false
;
}
return
null
;
}
},
methods
:
{
afterShow
:
function
()
{
this
.
$refs
.
newCollectionNameInput
.
focus
();
},
reset
()
{
this
.
newCollectionName
=
null
;
this
.
resetError
();
},
resetError
()
{
this
.
newCollectionNameError
=
null
;
},
createCollection
()
{
if
(
!
this
.
newCollectionName
)
{
this
.
newCollectionNameError
=
"
Collection name is required
"
;
}
else
if
(
/
[
<>?":
\\/
`|'*
]
/
.
test
(
this
.
newCollectionName
))
{
this
.
newCollectionNameError
=
"
Collection name contains an illegal character. Following characters are not allowed: < > ?
\"
:
\\
/ | ' * `
"
;
}
else
{
this
.
$store
.
dispatch
(
'
createCollection
'
,
this
.
newCollectionName
)
.
then
(()
=>
{
this
.
$bvModal
.
hide
(
'
create-collection-modal
'
);
})
.
catch
(
res
=>
{
this
.
newCollectionNameError
=
res
.
message
;
});
}
}
}
}
</
script
>
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