Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
catalog.genesys-pgr.org
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Catalog
catalog.genesys-pgr.org
Commits
62031fc7
Commit
62031fc7
authored
Nov 06, 2018
by
Maxym Borodenko
Committed by
Matija Obreza
Nov 10, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Pasting image instead of text from Word on Mac OS
- Paste Markdown from Word
parent
55fa6a45
Pipeline
#7563
passed with stages
in 5 minutes and 26 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
locales/en/common.json
locales/en/common.json
+2
-1
src/service/RepositoryService.ts
src/service/RepositoryService.ts
+2
-2
src/ui/catalog/markdown/index.tsx
src/ui/catalog/markdown/index.tsx
+8
-4
No files found.
locales/en/common.json
View file @
62031fc7
...
...
@@ -90,7 +90,8 @@
"yes"
:
"Yes"
,
"basicMarkdown"
:
"Basic markdown supported"
,
"fullMarkdown"
:
"Full markdown supported"
,
"previewMarkdown"
:
"Preview markdown"
"previewMarkdown"
:
"Preview markdown"
,
"editMarkdown"
:
"Edit Markdown"
},
"message"
:
{
"confirmDelete"
:
"Deleting the {{what, lowercase}} record is only possible when there is no associated data."
...
...
src/service/RepositoryService.ts
View file @
62031fc7
...
...
@@ -277,8 +277,8 @@ class FileRepositoryService {
// console.log(`Fetching from ${apiUrl}`);
const
data
=
new
FormData
();
data
.
append
(
'
file
'
,
file
);
data
.
append
(
'
metadata
'
,
JSON
.
stringify
(
metadata
));
//
data.append('metadata', new Blob([ JSON.stringify(metadata) ], { type : 'application/json' }));
//
data.append('metadata', JSON.stringify(metadata));
data
.
append
(
'
metadata
'
,
new
Blob
([
JSON
.
stringify
(
metadata
)
],
{
type
:
'
application/json
'
}));
const
content
=
{
data
};
return
axiosBackend
.
request
({
...
...
src/ui/catalog/markdown/index.tsx
View file @
62031fc7
...
...
@@ -42,6 +42,11 @@ class MarkdownField extends OriginalMarkdownField {
const
{
uploadMarkdownAttachment
}
=
this
.
props
;
const
textarea
=
this
.
textarea
;
// only trigger the upload in case of a real picture
if
(
!
file
.
type
.
startsWith
(
'
image/
'
))
{
return
;
}
// console.log('Uploading file', file);
return
uploadMarkdownAttachment
(
file
)
.
then
((
r
)
=>
{
...
...
@@ -81,9 +86,9 @@ class MarkdownField extends OriginalMarkdownField {
private
dataPasted
=
async
(
e
)
=>
{
const
{
clipboardData
:
{
files
}
}
=
e
;
const
types
:
string
[]
=
e
.
clipboardData
.
types
;
// console.log('Pasted', e.clipboardData, types, files, items);
if
(
files
.
length
)
{
if
(
files
.
length
&&
(
types
.
indexOf
(
'
text/plain
'
)
===
-
1
))
{
e
.
preventDefault
();
for
(
const
f
of
files
)
{
await
this
.
addFile
(
f
);
...
...
@@ -91,7 +96,6 @@ class MarkdownField extends OriginalMarkdownField {
}
else
{
// NOOP
}
// console.log(e.clipboardData.getData('text/plain'));
}
// Bind event listeners
...
...
@@ -148,7 +152,7 @@ class MarkdownField extends OriginalMarkdownField {
<
div
style
=
{
{
paddingTop
:
'
1.5rem
'
}
}
>
<
Markdown
source
=
{
input
.
value
}
/>
</
div
>
<
h6
><
a
onClick
=
{
this
.
onChangePreviewMode
}
>
Edit Markdown
</
a
></
h6
>
<
h6
><
a
onClick
=
{
this
.
onChangePreviewMode
}
>
{
t
(
'
common:label.editMarkdown
'
)
}
</
a
></
h6
>
</
FormControl
>
}
</
div
>
...
...
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