Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
bb71bd70
Unverified
Commit
bb71bd70
authored
Oct 16, 2018
by
Paul Kaplan
Committed by
GitHub
Oct 16, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2190 from paulkaplan/move-report-to-api
Use the proper API route for reporting projects
parents
95d088f5
85f13935
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
src/redux/preview.js
src/redux/preview.js
+6
-5
src/views/preview/preview.jsx
src/views/preview/preview.jsx
+3
-3
No files found.
src/redux/preview.js
View file @
bb71bd70
...
@@ -657,7 +657,7 @@ module.exports.reportComment = (projectId, commentId, topLevelCommentId, token)
...
@@ -657,7 +657,7 @@ module.exports.reportComment = (projectId, commentId, topLevelCommentId, token)
});
});
});
});
module
.
exports
.
reportProject
=
(
id
,
jsonData
)
=>
(
dispatch
=>
{
module
.
exports
.
reportProject
=
(
id
,
jsonData
,
token
)
=>
(
dispatch
=>
{
dispatch
(
module
.
exports
.
setFetchStatus
(
'
report
'
,
module
.
exports
.
Status
.
FETCHING
));
dispatch
(
module
.
exports
.
setFetchStatus
(
'
report
'
,
module
.
exports
.
Status
.
FETCHING
));
// scratchr2 will fail if no thumbnail base64 string provided. We don't yet have
// scratchr2 will fail if no thumbnail base64 string provided. We don't yet have
// a way to get the actual project thumbnail in www/gui, so for now just submit
// a way to get the actual project thumbnail in www/gui, so for now just submit
...
@@ -667,11 +667,12 @@ module.exports.reportProject = (id, jsonData) => (dispatch => {
...
@@ -667,11 +667,12 @@ module.exports.reportProject = (id, jsonData) => (dispatch => {
'
0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=
'
'
0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=
'
});
});
api
({
api
({
host
:
''
,
uri
:
`/proxy/projects/
${
id
}
/report`
,
uri
:
`/site-api/projects/all/
${
id
}
/report/`
,
authentication
:
token
,
withCredentials
:
true
,
method
:
'
POST
'
,
method
:
'
POST
'
,
json
:
jsonData
,
useCsrf
:
true
,
useCsrf
:
true
json
:
jsonData
},
(
err
,
body
,
res
)
=>
{
},
(
err
,
body
,
res
)
=>
{
if
(
err
||
res
.
statusCode
!==
200
)
{
if
(
err
||
res
.
statusCode
!==
200
)
{
dispatch
(
module
.
exports
.
setFetchStatus
(
'
report
'
,
module
.
exports
.
Status
.
ERROR
));
dispatch
(
module
.
exports
.
setFetchStatus
(
'
report
'
,
module
.
exports
.
Status
.
ERROR
));
...
...
src/views/preview/preview.jsx
View file @
bb71bd70
...
@@ -199,7 +199,7 @@ class Preview extends React.Component {
...
@@ -199,7 +199,7 @@ class Preview extends React.Component {
this
.
setState
({
addToStudioOpen
:
false
});
this
.
setState
({
addToStudioOpen
:
false
});
}
}
handleReportSubmit
(
formData
)
{
handleReportSubmit
(
formData
)
{
this
.
props
.
reportProject
(
this
.
state
.
projectId
,
formData
);
this
.
props
.
reportProject
(
this
.
state
.
projectId
,
formData
,
this
.
props
.
user
.
token
);
}
}
handlePopState
()
{
handlePopState
()
{
const
path
=
window
.
location
.
pathname
.
toLowerCase
();
const
path
=
window
.
location
.
pathname
.
toLowerCase
();
...
@@ -612,8 +612,8 @@ const mapDispatchToProps = dispatch => ({
...
@@ -612,8 +612,8 @@ const mapDispatchToProps = dispatch => ({
setLovedStatus
:
(
loved
,
id
,
username
,
token
)
=>
{
setLovedStatus
:
(
loved
,
id
,
username
,
token
)
=>
{
dispatch
(
previewActions
.
setLovedStatus
(
loved
,
id
,
username
,
token
));
dispatch
(
previewActions
.
setLovedStatus
(
loved
,
id
,
username
,
token
));
},
},
reportProject
:
(
id
,
formData
)
=>
{
reportProject
:
(
id
,
formData
,
token
)
=>
{
dispatch
(
previewActions
.
reportProject
(
id
,
formData
));
dispatch
(
previewActions
.
reportProject
(
id
,
formData
,
token
));
},
},
setOriginalInfo
:
info
=>
{
setOriginalInfo
:
info
=>
{
dispatch
(
previewActions
.
setOriginalInfo
(
info
));
dispatch
(
previewActions
.
setOriginalInfo
(
info
));
...
...
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