Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Motion Bank
MB.js
Quasar Components MoSys
Commits
fa1a09da
Commit
fa1a09da
authored
Oct 09, 2020
by
anton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove SourceDocuments.vue
parent
eab6a272
Pipeline
#85316
passed with stage
in 1 minute and 6 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
110 deletions
+0
-110
partials/sources/SourceDocuments.vue
partials/sources/SourceDocuments.vue
+0
-110
No files found.
partials/sources/SourceDocuments.vue
deleted
100644 → 0
View file @
eab6a272
<
template
lang=
"pug"
>
q-list.default-source-container
template(v-for="(file, i) in images")
q-item.custom-hover
q-item-side
q-icon(
draggable="true",
@dragstart.native="event => {handleItemDragStart(event, file)}",
:name="typeToIconName(getSimpleType(file.metaData['content-type']))", style="font-size: 1.8rem")
q-item-main
{{
file
.
name
}}
q-item-separator
</
template
>
<
script
>
import
{
mapGetters
}
from
'
vuex
'
const
typeToIconName
=
{
'
image
'
:
'
photo
'
}
export
default
{
data
()
{
return
{
files
:
[]
}
},
async
mounted
()
{
this
.
files
=
await
this
.
$store
.
dispatch
(
'
files/list
'
,
this
.
bucketName
)
},
computed
:
{
...
mapGetters
({
user
:
'
auth/getUserState
'
}),
bucketName
()
{
return
`user-
${
this
.
user
.
uuid
}
`
},
images
()
{
return
this
.
files
.
filter
(
file
=>
this
.
getSimpleType
(
file
.
metaData
[
'
content-type
'
])
===
'
image
'
)
},
types
()
{
const
_this
=
this
return
this
.
files
.
reduce
((
types
,
file
)
=>
{
const
mimetype
=
file
.
metaData
&&
file
.
metaData
[
'
content-type
'
]
?
file
.
metaData
[
'
content-type
'
]
:
undefined
if
(
mimetype
)
{
const
type
=
_this
.
getSimpleType
(
mimetype
)
if
(
types
.
indexOf
(
type
)
===
-
1
)
types
.
push
(
type
)
}
return
types
},
[])
}
},
methods
:
{
typeToIconName
(
type
)
{
let
iconName
=
typeToIconName
[
type
.
toLowerCase
()]
if
(
!
iconName
)
{
iconName
=
'
broken image
'
}
return
iconName
},
getSimpleType
(
mimetype
,
capitalize
=
false
)
{
let
type
=
mimetype
if
(
mimetype
.
indexOf
(
'
/
'
)
!==
-
1
)
type
=
mimetype
.
split
(
'
/
'
)[
0
]
if
(
capitalize
)
{
type
=
type
.
substr
(
0
,
1
).
toUpperCase
()
+
type
.
substr
(
1
)
}
return
type
},
handleItemDragStart
(
event
,
item
)
{
const
resourceCell
=
{
source
:
{
value
:
{
content
:
`
${
process
.
env
.
STORAGE_HOST
}
/files/
${
this
.
bucketName
}
/
${
item
.
name
}
`
,
type
:
this
.
getSimpleType
(
item
.
metaData
[
'
content-type
'
],
true
)
}
},
configuration
:
{
value
:
{},
component
:
'
CellImage
'
}
}
event
.
dataTransfer
.
setData
(
'
text/plain
'
,
JSON
.
stringify
(
resourceCell
))
}
}
}
</
script
>
<
style
scoped
lang=
"stylus"
>
.q-list-header
padding-left 0
.q-input
padding-left 1em
padding-right 1em
.q-input:before
.q-input:after
display none
.q-input
padding-left 0
.custom-hover
cursor pointer
&:hover
background-color #eee
</
style
>
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