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
478a30ef
Commit
478a30ef
authored
Aug 27, 2018
by
Ben Wheeler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pass project title to GUI, and disable submit when editing title
parent
3c6530fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
src/lib/render.jsx
src/lib/render.jsx
+1
-1
src/views/preview/presentation.jsx
src/views/preview/presentation.jsx
+12
-1
src/views/preview/preview.jsx
src/views/preview/preview.jsx
+7
-1
No files found.
src/lib/render.jsx
View file @
478a30ef
...
...
@@ -37,7 +37,7 @@ const render = (jsx, element, reducers, initialState, enhancer) => {
}
const
allReducers
=
reducer
(
reducers
);
const
composeEnhancers
=
window
.
__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
||
redux
.
compose
;
const
enhancers
=
enhancer
?
composeEnhancers
(
...
...
src/views/preview/presentation.jsx
View file @
478a30ef
...
...
@@ -27,6 +27,16 @@ const ExtensionChip = require('./extension-chip.jsx');
const
projectShape
=
require
(
'
./projectshape.jsx
'
).
projectShape
;
require
(
'
./preview.scss
'
);
// disable enter key submission on formsy input fields; otherwise formsy thinks
// we meant to trigger the "See inside" button. Instead, treat these keypresses
// as a blur, which will trigger a save.
const
onKeyPress
=
e
=>
{
if
(
e
.
target
.
type
===
'
text
'
&&
e
.
which
===
13
/* Enter */
)
{
e
.
preventDefault
();
e
.
target
.
blur
();
}
};
const
PreviewPresentation
=
({
assetHost
,
backpackOptions
,
...
...
@@ -70,7 +80,7 @@ const PreviewPresentation = ({
<
ShareBanner
shared=
{
isShared
}
/>
{
projectInfo
&&
projectInfo
.
author
&&
projectInfo
.
author
.
id
&&
(
<
Formsy
>
<
Formsy
onKeyPress=
{
onKeyPress
}
>
<
div
className=
"inner"
>
<
FlexRow
className=
"preview-row"
>
<
FlexRow
className=
"project-header"
>
...
...
@@ -135,6 +145,7 @@ const PreviewPresentation = ({
previewInfoVisible=
"false"
projectHost=
{
projectHost
}
projectId=
{
projectId
}
projectTitle=
{
projectInfo
.
title
}
/>
</
div
>
<
FlexRow
className=
"project-notes"
>
...
...
src/views/preview/preview.jsx
View file @
478a30ef
...
...
@@ -42,6 +42,7 @@ class Preview extends React.Component {
'
handleAddToStudioClick
'
,
'
handleAddToStudioClose
'
,
'
handleSeeInside
'
,
'
handleUpdateProjectTitle
'
,
'
handleUpdate
'
,
'
initCounts
'
,
'
isShared
'
,
...
...
@@ -277,6 +278,11 @@ class Preview extends React.Component {
this
.
props
.
user
.
token
);
}
handleUpdateProjectTitle
(
title
)
{
this
.
handleUpdate
({
title
:
title
});
}
initCounts
(
favorites
,
loves
)
{
this
.
setState
({
favoriteCount
:
favorites
,
...
...
@@ -456,7 +462,6 @@ const consolidateStudiosInfo = (curatedStudios, projectStudios, currentStudioIds
};
const
mapStateToProps
=
state
=>
({
projectInfo
:
state
.
preview
.
projectInfo
,
comments
:
state
.
preview
.
comments
,
faved
:
state
.
preview
.
faved
,
loved
:
state
.
preview
.
loved
,
...
...
@@ -465,6 +470,7 @@ const mapStateToProps = state => ({
remixes
:
state
.
preview
.
remixes
,
replies
:
state
.
preview
.
replies
,
sessionStatus
:
state
.
session
.
status
,
projectInfo
:
state
.
preview
.
projectInfo
,
projectStudios
:
state
.
preview
.
projectStudios
,
studios
:
consolidateStudiosInfo
(
state
.
preview
.
curatedStudios
,
state
.
preview
.
projectStudios
,
state
.
preview
.
currentStudioIds
,
...
...
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