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
b64abada
Commit
b64abada
authored
Nov 08, 2020
by
Jacques Erasmus
Committed by
David O'Regan
Nov 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update image upload path
Update the upload path to the new one
parent
e87df54d
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
18 additions
and
10 deletions
+18
-10
app/assets/javascripts/static_site_editor/components/edit_area.vue
...s/javascripts/static_site_editor/components/edit_area.vue
+1
-4
app/assets/javascripts/static_site_editor/constants.js
app/assets/javascripts/static_site_editor/constants.js
+0
-2
app/assets/javascripts/static_site_editor/graphql/queries/app_data.query.graphql
...static_site_editor/graphql/queries/app_data.query.graphql
+1
-0
app/assets/javascripts/static_site_editor/graphql/typedefs.graphql
...s/javascripts/static_site_editor/graphql/typedefs.graphql
+1
-0
app/assets/javascripts/static_site_editor/index.js
app/assets/javascripts/static_site_editor/index.js
+1
-1
app/assets/javascripts/static_site_editor/pages/home.vue
app/assets/javascripts/static_site_editor/pages/home.vue
+1
-0
app/assets/javascripts/vue_shared/components/rich_content_editor/modals/add_image/add_image_modal.vue
.../rich_content_editor/modals/add_image/add_image_modal.vue
+2
-2
app/assets/javascripts/vue_shared/components/rich_content_editor/rich_content_editor.vue
...ed/components/rich_content_editor/rich_content_editor.vue
+0
-1
changelogs/unreleased/218529-change-image-upload-path.yml
changelogs/unreleased/218529-change-image-upload-path.yml
+5
-0
spec/frontend/static_site_editor/components/edit_area_spec.js
.../frontend/static_site_editor/components/edit_area_spec.js
+2
-0
spec/frontend/static_site_editor/mock_data.js
spec/frontend/static_site_editor/mock_data.js
+2
-0
spec/frontend/static_site_editor/pages/home_spec.js
spec/frontend/static_site_editor/pages/home_spec.js
+2
-0
No files found.
app/assets/javascripts/static_site_editor/components/edit_area.vue
View file @
b64abada
...
@@ -6,7 +6,6 @@ import EditDrawer from './edit_drawer.vue';
...
@@ -6,7 +6,6 @@ import EditDrawer from './edit_drawer.vue';
import
UnsavedChangesConfirmDialog
from
'
./unsaved_changes_confirm_dialog.vue
'
;
import
UnsavedChangesConfirmDialog
from
'
./unsaved_changes_confirm_dialog.vue
'
;
import
parseSourceFile
from
'
~/static_site_editor/services/parse_source_file
'
;
import
parseSourceFile
from
'
~/static_site_editor/services/parse_source_file
'
;
import
{
EDITOR_TYPES
}
from
'
~/vue_shared/components/rich_content_editor/constants
'
;
import
{
EDITOR_TYPES
}
from
'
~/vue_shared/components/rich_content_editor/constants
'
;
import
{
DEFAULT_IMAGE_UPLOAD_PATH
}
from
'
../constants
'
;
import
imageRepository
from
'
../image_repository
'
;
import
imageRepository
from
'
../image_repository
'
;
import
formatter
from
'
../services/formatter
'
;
import
formatter
from
'
../services/formatter
'
;
import
templater
from
'
../services/templater
'
;
import
templater
from
'
../services/templater
'
;
...
@@ -48,9 +47,7 @@ export default {
...
@@ -48,9 +47,7 @@ export default {
},
},
imageRoot
:
{
imageRoot
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
true
,
default
:
DEFAULT_IMAGE_UPLOAD_PATH
,
validator
:
prop
=>
prop
.
endsWith
(
'
/
'
),
},
},
},
},
data
()
{
data
()
{
...
...
app/assets/javascripts/static_site_editor/constants.js
View file @
b64abada
...
@@ -20,6 +20,4 @@ export const TRACKING_ACTION_CREATE_COMMIT = 'create_commit';
...
@@ -20,6 +20,4 @@ export const TRACKING_ACTION_CREATE_COMMIT = 'create_commit';
export
const
TRACKING_ACTION_CREATE_MERGE_REQUEST
=
'
create_merge_request
'
;
export
const
TRACKING_ACTION_CREATE_MERGE_REQUEST
=
'
create_merge_request
'
;
export
const
TRACKING_ACTION_INITIALIZE_EDITOR
=
'
initialize_editor
'
;
export
const
TRACKING_ACTION_INITIALIZE_EDITOR
=
'
initialize_editor
'
;
export
const
DEFAULT_IMAGE_UPLOAD_PATH
=
'
source/images/uploads/
'
;
export
const
MR_META_LOCAL_STORAGE_KEY
=
'
sse-merge-request-meta-storage-key
'
;
export
const
MR_META_LOCAL_STORAGE_KEY
=
'
sse-merge-request-meta-storage-key
'
;
app/assets/javascripts/static_site_editor/graphql/queries/app_data.query.graphql
View file @
b64abada
...
@@ -10,5 +10,6 @@ query appData {
...
@@ -10,5 +10,6 @@ query appData {
source
source
target
target
}
}
imageUploadPath
}
}
}
}
app/assets/javascripts/static_site_editor/graphql/typedefs.graphql
View file @
b64abada
...
@@ -27,6 +27,7 @@ type AppData {
...
@@ -27,6 +27,7 @@ type AppData {
sourcePath
:
String
!
sourcePath
:
String
!
username
:
String
!
username
:
String
!
mounts
:
[
Mount
]!
mounts
:
[
Mount
]!
imageUploadPath
:
String
!
}
}
input
HasSubmittedChangesInput
{
input
HasSubmittedChangesInput
{
...
...
app/assets/javascripts/static_site_editor/index.js
View file @
b64abada
...
@@ -16,7 +16,6 @@ const initStaticSiteEditor = el => {
...
@@ -16,7 +16,6 @@ const initStaticSiteEditor = el => {
// so we are adding them here as a convenience for future use.
// so we are adding them here as a convenience for future use.
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-unused-vars
staticSiteGenerator
,
staticSiteGenerator
,
// eslint-disable-next-line no-unused-vars
imageUploadPath
,
imageUploadPath
,
mounts
,
mounts
,
}
=
el
.
dataset
;
}
=
el
.
dataset
;
...
@@ -31,6 +30,7 @@ const initStaticSiteEditor = el => {
...
@@ -31,6 +30,7 @@ const initStaticSiteEditor = el => {
returnUrl
,
returnUrl
,
sourcePath
,
sourcePath
,
username
,
username
,
imageUploadPath
,
});
});
return
new
Vue
({
return
new
Vue
({
...
...
app/assets/javascripts/static_site_editor/pages/home.vue
View file @
b64abada
...
@@ -140,6 +140,7 @@ export default {
...
@@ -140,6 +140,7 @@ export default {
:return-url=
"appData.returnUrl"
:return-url=
"appData.returnUrl"
:mounts=
"appData.mounts"
:mounts=
"appData.mounts"
:project=
"appData.project"
:project=
"appData.project"
:image-root=
"appData.imageUploadPath"
@
submit=
"onPrepareSubmit"
@
submit=
"onPrepareSubmit"
/>
/>
<edit-meta-modal
<edit-meta-modal
...
...
app/assets/javascripts/vue_shared/components/rich_content_editor/modals/add_image/add_image_modal.vue
View file @
b64abada
<
script
>
<
script
>
import
{
GlModal
,
GlFormGroup
,
GlFormInput
,
GlTabs
,
GlTab
}
from
'
@gitlab/ui
'
;
import
{
GlModal
,
GlFormGroup
,
GlFormInput
,
GlTabs
,
GlTab
}
from
'
@gitlab/ui
'
;
import
{
isSafeURL
}
from
'
~/lib/utils/url_utility
'
;
import
{
isSafeURL
,
joinPaths
}
from
'
~/lib/utils/url_utility
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
import
glFeatureFlagMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
glFeatureFlagMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
{
IMAGE_TABS
}
from
'
../../constants
'
;
import
{
IMAGE_TABS
}
from
'
../../constants
'
;
...
@@ -74,7 +74,7 @@ export default {
...
@@ -74,7 +74,7 @@ export default {
return
;
return
;
}
}
const
imageUrl
=
`
${
this
.
imageRoot
}${
file
.
name
}
`
;
const
imageUrl
=
joinPaths
(
this
.
imageRoot
,
file
.
name
)
;
this
.
$emit
(
'
addImage
'
,
{
imageUrl
,
file
,
altText
:
altText
||
file
.
name
});
this
.
$emit
(
'
addImage
'
,
{
imageUrl
,
file
,
altText
:
altText
||
file
.
name
});
},
},
...
...
app/assets/javascripts/vue_shared/components/rich_content_editor/rich_content_editor.vue
View file @
b64abada
...
@@ -53,7 +53,6 @@ export default {
...
@@ -53,7 +53,6 @@ export default {
imageRoot
:
{
imageRoot
:
{
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
validator
:
prop
=>
prop
.
endsWith
(
'
/
'
),
},
},
},
},
data
()
{
data
()
{
...
...
changelogs/unreleased/218529-change-image-upload-path.yml
0 → 100644
View file @
b64abada
---
title
:
Update image upload path (SSE)
merge_request
:
46967
author
:
type
:
changed
spec/frontend/static_site_editor/components/edit_area_spec.js
View file @
b64abada
...
@@ -17,6 +17,7 @@ import {
...
@@ -17,6 +17,7 @@ import {
returnUrl
,
returnUrl
,
mounts
,
mounts
,
project
,
project
,
imageRoot
,
}
from
'
../mock_data
'
;
}
from
'
../mock_data
'
;
jest
.
mock
(
'
~/static_site_editor/services/formatter
'
,
()
=>
jest
.
fn
(
str
=>
`
${
str
}
format-pass`
));
jest
.
mock
(
'
~/static_site_editor/services/formatter
'
,
()
=>
jest
.
fn
(
str
=>
`
${
str
}
format-pass`
));
...
@@ -35,6 +36,7 @@ describe('~/static_site_editor/components/edit_area.vue', () => {
...
@@ -35,6 +36,7 @@ describe('~/static_site_editor/components/edit_area.vue', () => {
returnUrl
,
returnUrl
,
mounts
,
mounts
,
project
,
project
,
imageRoot
,
savingChanges
,
savingChanges
,
...
propsData
,
...
propsData
,
},
},
...
...
spec/frontend/static_site_editor/mock_data.js
View file @
b64abada
...
@@ -79,3 +79,5 @@ export const mounts = [
...
@@ -79,3 +79,5 @@ export const mounts = [
target
:
''
,
target
:
''
,
},
},
];
];
export
const
imageRoot
=
'
source/images/
'
;
spec/frontend/static_site_editor/pages/home_spec.js
View file @
b64abada
...
@@ -24,6 +24,7 @@ import {
...
@@ -24,6 +24,7 @@ import {
trackingCategory
,
trackingCategory
,
images
,
images
,
mounts
,
mounts
,
imageRoot
,
}
from
'
../mock_data
'
;
}
from
'
../mock_data
'
;
const
localVue
=
createLocalVue
();
const
localVue
=
createLocalVue
();
...
@@ -43,6 +44,7 @@ describe('static_site_editor/pages/home', () => {
...
@@ -43,6 +44,7 @@ describe('static_site_editor/pages/home', () => {
username
,
username
,
sourcePath
,
sourcePath
,
mounts
,
mounts
,
imageUploadPath
:
imageRoot
,
};
};
const
hasSubmittedChangesMutationPayload
=
{
const
hasSubmittedChangesMutationPayload
=
{
data
:
{
data
:
{
...
...
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