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
ae3135bf
Commit
ae3135bf
authored
Aug 11, 2021
by
Eric Rosenbaum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use "host" instead of "owner"
parent
f964d6a1
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
90 additions
and
90 deletions
+90
-90
src/redux/studio-permissions.js
src/redux/studio-permissions.js
+2
-2
src/views/studio/lib/studio-member-actions.js
src/views/studio/lib/studio-member-actions.js
+5
-5
src/views/studio/modals/transfer-host-confirmation.jsx
src/views/studio/modals/transfer-host-confirmation.jsx
+17
-17
src/views/studio/modals/transfer-host-info.jsx
src/views/studio/modals/transfer-host-info.jsx
+9
-9
src/views/studio/modals/transfer-host-modal.jsx
src/views/studio/modals/transfer-host-modal.jsx
+12
-12
src/views/studio/modals/transfer-host-modal.scss
src/views/studio/modals/transfer-host-modal.scss
+11
-11
src/views/studio/modals/transfer-host-selection.jsx
src/views/studio/modals/transfer-host-selection.jsx
+8
-8
src/views/studio/modals/transfer-host-tile.jsx
src/views/studio/modals/transfer-host-tile.jsx
+5
-5
src/views/studio/studio-member-tile.jsx
src/views/studio/studio-member-tile.jsx
+21
-21
static/svgs/studio/transfer-host.svg
static/svgs/studio/transfer-host.svg
+0
-0
No files found.
src/redux/studio-permissions.js
View file @
ae3135bf
...
...
@@ -54,7 +54,7 @@ const selectCanRemoveManager = (state, managerId) =>
!
selectIsMuted
(
state
)
&&
(
selectIsAdmin
(
state
)
||
isManager
(
state
))
&&
managerId
!==
state
.
studio
.
owner
;
const
selectCanPromoteCurators
=
state
=>
!
selectIsMuted
(
state
)
&&
isManager
(
state
);
const
selectCanTransfer
Ownership
=
(
state
,
managerId
)
=>
const
selectCanTransfer
=
(
state
,
managerId
)
=>
state
.
managers
&&
state
.
managers
.
items
&&
state
.
managers
.
items
.
length
>
1
&&
// there is more than one manager
managerId
===
state
.
studio
.
owner
&&
// and the selected manager is the owner
isCreator
(
state
);
// and the current user is the owner
...
...
@@ -104,7 +104,7 @@ export {
selectCanRemoveCurator
,
selectCanRemoveManager
,
selectCanPromoteCurators
,
selectCanTransfer
Ownership
,
selectCanTransfer
,
selectCanRemoveProject
,
selectShowCommentsList
,
selectShowCommentsGloballyOffError
,
...
...
src/views/studio/lib/studio-member-actions.js
View file @
ae3135bf
...
...
@@ -187,14 +187,14 @@ const acceptInvitation = () => ((dispatch, getState) => new Promise((resolve, re
});
}));
const
transfer
Ownership
=
(
password
,
newOwnerName
,
newOwner
Id
)
=>
const
transfer
Host
=
(
password
,
newHostName
,
newHost
Id
)
=>
((
dispatch
,
getState
)
=>
new
Promise
((
resolve
,
reject
)
=>
{
const
state
=
getState
();
const
studioId
=
selectStudioId
(
state
);
const
token
=
selectToken
(
state
);
new
OwnerName
=
newOwner
Name
.
trim
();
new
HostName
=
newHost
Name
.
trim
();
api
({
uri
:
`/studios/
${
studioId
}
/transfer/
${
new
Owner
Name
}
?password=
${
password
}
`
,
uri
:
`/studios/
${
studioId
}
/transfer/
${
new
Host
Name
}
?password=
${
password
}
`
,
method
:
'
PUT
'
,
authentication
:
token
,
withCredentials
:
true
,
...
...
@@ -202,7 +202,7 @@ const transferOwnership = (password, newOwnerName, newOwnerId) =>
},
(
err
,
body
,
res
)
=>
{
const
error
=
normalizeError
(
err
,
body
,
res
);
if
(
error
)
return
reject
(
error
);
dispatch
(
setInfo
({
owner
:
new
Owner
Id
}));
dispatch
(
setInfo
({
owner
:
new
Host
Id
}));
return
resolve
();
});
}));
...
...
@@ -216,5 +216,5 @@ export {
promoteCurator
,
removeCurator
,
removeManager
,
transfer
Ownership
transfer
Host
};
src/views/studio/modals/transfer-
ownership
-confirmation.jsx
→
src/views/studio/modals/transfer-
host
-confirmation.jsx
View file @
ae3135bf
...
...
@@ -5,29 +5,29 @@ import {FormattedMessage} from 'react-intl';
import
ModalInnerContent
from
'
../../../components/modal/base/modal-inner-content.jsx
'
;
import
Transfer
OwnershipTile
from
'
./transfer-ownership
-tile.jsx
'
;
import
Transfer
HostTile
from
'
./transfer-host
-tile.jsx
'
;
import
Form
from
'
../../../components/forms/form.jsx
'
;
import
{
selectUserId
}
from
'
../../../redux/session
'
;
import
{
managers
}
from
'
../lib/redux-modules
'
;
import
{
loadManagers
}
from
'
../lib/studio-member-actions
'
;
import
'
./transfer-
ownership
-modal.scss
'
;
import
'
./transfer-
host
-modal.scss
'
;
const
Transfer
Ownership
Confirmation
=
({
const
Transfer
Host
Confirmation
=
({
handleBack
,
handleTransfer
,
items
,
userId
,
selectedId
})
=>
{
const
current
Owner
Username
=
items
.
find
(
item
=>
item
.
id
===
userId
).
username
;
const
current
Owner
Image
=
items
.
find
(
item
=>
item
.
id
===
userId
).
profile
.
images
[
'
90x90
'
];
const
new
Owner
Username
=
items
.
find
(
item
=>
item
.
id
===
selectedId
).
username
;
const
new
Owner
Image
=
items
.
find
(
item
=>
item
.
id
===
selectedId
).
profile
.
images
[
'
90x90
'
];
const
current
Host
Username
=
items
.
find
(
item
=>
item
.
id
===
userId
).
username
;
const
current
Host
Image
=
items
.
find
(
item
=>
item
.
id
===
userId
).
profile
.
images
[
'
90x90
'
];
const
new
Host
Username
=
items
.
find
(
item
=>
item
.
id
===
selectedId
).
username
;
const
new
Host
Image
=
items
.
find
(
item
=>
item
.
id
===
selectedId
).
profile
.
images
[
'
90x90
'
];
const
[
passwordInputValue
,
setPasswordInputValue
]
=
useState
(
''
);
const
handleSubmit
=
()
=>
{
handleTransfer
(
passwordInputValue
,
new
Owner
Username
,
selectedId
);
handleTransfer
(
passwordInputValue
,
new
Host
Username
,
selectedId
);
};
const
handleChangePasswordInput
=
e
=>
{
setPasswordInputValue
(
e
.
target
.
value
);
...
...
@@ -39,12 +39,12 @@ const TransferOwnershipConfirmation = ({
<
div
className=
"transfer-outcome-label"
>
<
FormattedMessage
id=
"studio.transfer.currentHost"
/>
</
div
>
<
Transfer
Ownership
Tile
<
Transfer
Host
Tile
className=
"transfer-outcome-tile"
key=
{
userId
}
id=
{
userId
}
image=
{
current
Owner
Image
}
username=
{
current
Owner
Username
}
image=
{
current
Host
Image
}
username=
{
current
Host
Username
}
isCreator=
{
false
}
/>
</
div
>
...
...
@@ -56,12 +56,12 @@ const TransferOwnershipConfirmation = ({
<
div
className=
"transfer-outcome-label"
>
<
FormattedMessage
id=
"studio.transfer.newHost"
/>
</
div
>
<
Transfer
Ownership
Tile
<
Transfer
Host
Tile
className=
"transfer-outcome-tile"
key=
{
selectedId
}
id=
{
selectedId
}
image=
{
new
Owner
Image
}
username=
{
new
Owner
Username
}
image=
{
new
Host
Image
}
username=
{
new
Host
Username
}
isCreator=
{
false
}
/>
</
div
>
...
...
@@ -92,7 +92,7 @@ const TransferOwnershipConfirmation = ({
</
a
>
</
div
>
<
div
className=
"transfer-
ownership-button-row transfer-ownership
-button-row-split"
className=
"transfer-
host-button-row transfer-host
-button-row-split"
>
<
button
className=
"button"
...
...
@@ -114,7 +114,7 @@ const TransferOwnershipConfirmation = ({
);
};
Transfer
Ownership
Confirmation
.
propTypes
=
{
Transfer
Host
Confirmation
.
propTypes
=
{
handleBack
:
PropTypes
.
func
,
handleTransfer
:
PropTypes
.
func
,
items
:
PropTypes
.
arrayOf
(
PropTypes
.
shape
({
...
...
@@ -138,4 +138,4 @@ export default connect(
{
onLoadMore
:
loadManagers
}
)(
Transfer
Ownership
Confirmation
);
)(
Transfer
Host
Confirmation
);
src/views/studio/modals/transfer-
ownership
-info.jsx
→
src/views/studio/modals/transfer-
host
-info.jsx
View file @
ae3135bf
...
...
@@ -7,16 +7,16 @@ import ModalInnerContent from '../../../components/modal/base/modal-inner-conten
import
AlertComponent
from
'
../../../components/alert/alert-component.jsx
'
;
import
errorIcon
from
'
../../../components/alert/icon-alert-error.svg
'
;
import
'
./transfer-
ownership
-modal.scss
'
;
import
'
./transfer-
host
-modal.scss
'
;
const
Transfer
Ownership
Info
=
({
const
Transfer
Host
Info
=
({
handleClose
,
handleNext
})
=>
(<
div
className=
"content"
>
<
img
src=
"/svgs/studio/transfer-
ownership
.svg"
className=
"transfer-
ownership
-image"
src=
"/svgs/studio/transfer-
host
.svg"
className=
"transfer-
host
-image"
/>
<
ModalInnerContent
className=
"inner"
...
...
@@ -26,9 +26,9 @@ const TransferOwnershipInfo = ({
<
FormattedMessage
id=
"studio.transfer.youAreAboutTo"
/>
</
h2
>
</
div
>
<
div
className=
"transfer-
ownership
-alert-wrapper"
>
<
div
className=
"transfer-
host
-alert-wrapper"
>
<
AlertComponent
className=
"alert-error transfer-
ownership
-alert"
className=
"alert-error transfer-
host
-alert"
icon=
{
errorIcon
}
id=
"studio.transfer.cannotUndo"
/>
...
...
@@ -43,7 +43,7 @@ const TransferOwnershipInfo = ({
<
li
><
FormattedMessage
id=
"studio.transfer.noLongerDelete"
/></
li
>
</
ul
>
<
div
className=
"transfer-
ownership
-button-row"
className=
"transfer-
host
-button-row"
>
<
button
className=
"button cancel-button"
...
...
@@ -61,9 +61,9 @@ const TransferOwnershipInfo = ({
</
ModalInnerContent
>
</
div
>);
Transfer
Ownership
Info
.
propTypes
=
{
Transfer
Host
Info
.
propTypes
=
{
handleClose
:
PropTypes
.
func
,
handleNext
:
PropTypes
.
func
};
export
default
Transfer
Ownership
Info
;
export
default
Transfer
Host
Info
;
src/views/studio/modals/transfer-
ownership
-modal.jsx
→
src/views/studio/modals/transfer-
host
-modal.jsx
View file @
ae3135bf
...
...
@@ -6,11 +6,11 @@ import keyMirror from 'keymirror';
import
Modal
from
'
../../../components/modal/base/modal.jsx
'
;
import
ModalTitle
from
'
../../../components/modal/base/modal-title.jsx
'
;
import
Transfer
OwnershipInfo
from
'
./transfer-ownership
-info.jsx
'
;
import
Transfer
OwnershipSelection
from
'
./transfer-ownership
-selection.jsx
'
;
import
Transfer
OwnershipConfirmation
from
'
./transfer-ownership
-confirmation.jsx
'
;
import
Transfer
HostInfo
from
'
./transfer-host
-info.jsx
'
;
import
Transfer
HostSelection
from
'
./transfer-host
-selection.jsx
'
;
import
Transfer
HostConfirmation
from
'
./transfer-host
-confirmation.jsx
'
;
import
'
./transfer-
ownership
-modal.scss
'
;
import
'
./transfer-
host
-modal.scss
'
;
const
STEPS
=
keyMirror
({
info
:
null
,
...
...
@@ -18,7 +18,7 @@ const STEPS = keyMirror({
confirmation
:
null
});
const
Transfer
Ownership
Modal
=
({
const
Transfer
Host
Modal
=
({
handleClose
,
handleTransfer
})
=>
{
...
...
@@ -26,25 +26,25 @@ const TransferOwnershipModal = ({
const
[
selectedId
,
setSelectedId
]
=
useState
(
null
);
return
(<
Modal
isOpen
className=
"transfer-
ownership
-modal"
className=
"transfer-
host
-modal"
onRequestClose=
{
handleClose
}
>
<
ModalTitle
className=
"transfer-
ownership
-title"
className=
"transfer-
host
-title"
title=
{
<
FormattedMessage
id=
"studio.transfer"
/>
}
/>
{
step
===
STEPS
.
info
&&
<
Transfer
Ownership
Info
{
step
===
STEPS
.
info
&&
<
Transfer
Host
Info
handleClose=
{
handleClose
}
handleNext=
{
()
=>
setStep
(
STEPS
.
selection
)
}
// eslint-disable-line react/jsx-no-bind
/>
}
{
step
===
STEPS
.
selection
&&
<
Transfer
Ownership
Selection
{
step
===
STEPS
.
selection
&&
<
Transfer
Host
Selection
handleClose=
{
handleClose
}
handleNext=
{
()
=>
setStep
(
STEPS
.
confirmation
)
}
// eslint-disable-line react/jsx-no-bind
handleBack=
{
()
=>
setStep
(
STEPS
.
info
)
}
// eslint-disable-line react/jsx-no-bind
handleSelected=
{
setSelectedId
}
selectedId=
{
selectedId
}
/>
}
{
step
===
STEPS
.
confirmation
&&
<
Transfer
Ownership
Confirmation
{
step
===
STEPS
.
confirmation
&&
<
Transfer
Host
Confirmation
handleClose=
{
handleClose
}
handleBack=
{
()
=>
setStep
(
STEPS
.
selection
)
}
// eslint-disable-line react/jsx-no-bind
handleTransfer=
{
handleTransfer
}
...
...
@@ -53,9 +53,9 @@ const TransferOwnershipModal = ({
</
Modal
>);
};
Transfer
Ownership
Modal
.
propTypes
=
{
Transfer
Host
Modal
.
propTypes
=
{
handleClose
:
PropTypes
.
func
,
handleTransfer
:
PropTypes
.
func
};
export
default
Transfer
Ownership
Modal
;
export
default
Transfer
Host
Modal
;
src/views/studio/modals/transfer-
ownership
-modal.scss
→
src/views/studio/modals/transfer-
host
-modal.scss
View file @
ae3135bf
@import
"../../../colors"
;
@import
"../../../frameless"
;
.transfer-
ownership
-modal
{
.transfer-
ownership
-title
{
.transfer-
host
-modal
{
.transfer-
host
-title
{
background
:
$ui-blue
;
border-top-left-radius
:
12px
;
border-top-right-radius
:
12px
;
...
...
@@ -35,7 +35,7 @@
align-items
:
flex-start
;
}
.transfer-
ownership
-image
{
.transfer-
host
-image
{
margin-top
:
2rem
;
}
...
...
@@ -43,27 +43,27 @@
padding
:
1rem
;
}
.transfer-
ownership
-alert-wrapper
{
.transfer-
host
-alert-wrapper
{
margin-right
:
2rem
;
}
.transfer-
ownership
-alert-wrapper
.alert-wrapper
{
.transfer-
host
-alert-wrapper
.alert-wrapper
{
position
:
relative
;
display
:
block
;
margin-bottom
:
2rem
;
}
.transfer-
ownership
-alert
.alert-msg
{
.transfer-
host
-alert
.alert-msg
{
font-size
:
16px
;
}
.transfer-
ownership
-button-row
{
.transfer-
host
-button-row
{
display
:
flex
;
justify-content
:
flex-end
;
padding-top
:
1
.5rem
;
}
.transfer-
ownership
-button-row-split
{
.transfer-
host
-button-row-split
{
justify-content
:
space-between
;
}
...
...
@@ -103,7 +103,7 @@
overflow
:
auto
;
}
.transfer-
ownership
-grid
{
.transfer-
host
-grid
{
display
:
grid
;
grid-template-columns
:
repeat
(
3
,
minmax
(
0
,
1fr
));
@media
#{
$intermediate-and-smaller
}
{
...
...
@@ -114,7 +114,7 @@
margin-bottom
:
1rem
;
}
.transfer-
ownership
-name-selected
{
.transfer-
host
-name-selected
{
color
:
white
!
important
;
}
...
...
@@ -122,7 +122,7 @@
margin
:
auto
8px
;
}
.transfer-
ownership
-tile-selected
{
.transfer-
host
-tile-selected
{
background
:
#0EBD8C
;
}
...
...
src/views/studio/modals/transfer-
ownership
-selection.jsx
→
src/views/studio/modals/transfer-
host
-selection.jsx
View file @
ae3135bf
...
...
@@ -5,15 +5,15 @@ import {FormattedMessage} from 'react-intl';
import
ModalInnerContent
from
'
../../../components/modal/base/modal-inner-content.jsx
'
;
import
Transfer
OwnershipTile
from
'
./transfer-ownership
-tile.jsx
'
;
import
Transfer
HostTile
from
'
./transfer-host
-tile.jsx
'
;
import
{
selectUserId
}
from
'
../../../redux/session
'
;
import
{
managers
}
from
'
../lib/redux-modules
'
;
import
{
loadManagers
}
from
'
../lib/studio-member-actions
'
;
import
'
./transfer-
ownership
-modal.scss
'
;
import
'
./transfer-
host
-modal.scss
'
;
const
Transfer
Ownership
Selection
=
({
const
Transfer
Host
Selection
=
({
handleSelected
,
handleNext
,
handleBack
,
...
...
@@ -34,10 +34,10 @@ const TransferOwnershipSelection = ({
</
h3
>
</
div
>
<
div
className=
"transfer-selection-scroll-pane"
>
<
div
className=
"transfer-
ownership
-grid"
>
<
div
className=
"transfer-
host
-grid"
>
{
items
.
map
(
item
=>
userId
!==
item
.
id
&&
(<
Transfer
Ownership
Tile
(<
Transfer
Host
Tile
key=
{
item
.
username
}
// eslint-disable-next-line react/jsx-no-bind
handleSelected=
{
()
=>
handleSelected
(
item
.
id
)
}
...
...
@@ -63,7 +63,7 @@ const TransferOwnershipSelection = ({
</
div
>
</
div
>
<
div
className=
"transfer-
ownership-button-row transfer-ownership
-button-row-split transfer-selection-buttons"
className=
"transfer-
host-button-row transfer-host
-button-row-split transfer-selection-buttons"
>
<
button
className=
"button"
...
...
@@ -83,7 +83,7 @@ const TransferOwnershipSelection = ({
);
};
Transfer
Ownership
Selection
.
propTypes
=
{
Transfer
Host
Selection
.
propTypes
=
{
handleBack
:
PropTypes
.
func
,
handleNext
:
PropTypes
.
func
,
handleSelected
:
PropTypes
.
func
,
...
...
@@ -110,4 +110,4 @@ export default connect(
{
onLoadMore
:
loadManagers
}
)(
Transfer
Ownership
Selection
);
)(
Transfer
Host
Selection
);
src/views/studio/modals/transfer-
ownership
-tile.jsx
→
src/views/studio/modals/transfer-
host
-tile.jsx
View file @
ae3135bf
...
...
@@ -3,12 +3,12 @@ import PropTypes from 'prop-types';
import
{
FormattedMessage
}
from
'
react-intl
'
;
import
classNames
from
'
classnames
'
;
const
Transfer
Ownership
Tile
=
({
const
Transfer
Host
Tile
=
({
className
,
username
,
image
,
isCreator
,
selected
,
handleSelected
})
=>
(
<
div
className=
{
classNames
(
'
studio-member-tile
'
,
className
,
{
'
transfer-
ownership
-tile-selected
'
:
selected
'
transfer-
host
-tile-selected
'
:
selected
})
}
onClick=
{
handleSelected
}
>
...
...
@@ -19,7 +19,7 @@ const TransferOwnershipTile = ({
<
div
className=
"studio-member-info"
>
<
div
className=
{
classNames
(
'
studio-member-name
'
,
{
'
transfer-
ownership
-name-selected
'
:
selected
}
{
'
transfer-
host
-name-selected
'
:
selected
}
)
}
>
...
...
@@ -34,7 +34,7 @@ const TransferOwnershipTile = ({
</
div
>
);
Transfer
Ownership
Tile
.
propTypes
=
{
Transfer
Host
Tile
.
propTypes
=
{
className
:
PropTypes
.
string
,
username
:
PropTypes
.
string
,
handleSelected
:
PropTypes
.
func
,
...
...
@@ -43,4 +43,4 @@ TransferOwnershipTile.propTypes = {
selected
:
PropTypes
.
bool
};
export
default
Transfer
Ownership
Tile
;
export
default
Transfer
Host
Tile
;
src/views/studio/studio-member-tile.jsx
View file @
ae3135bf
...
...
@@ -7,11 +7,11 @@ import {FormattedMessage} from 'react-intl';
import
PromoteModal
from
'
./modals/promote-modal.jsx
'
;
import
ManagerLimitModal
from
'
./modals/manager-limit-modal.jsx
'
;
import
Transfer
OwnershipModal
from
'
./modals/transfer-ownership
-modal.jsx
'
;
import
Transfer
HostModal
from
'
./modals/transfer-host
-modal.jsx
'
;
import
{
selectCanRemoveCurator
,
selectCanRemoveManager
,
selectCanPromoteCurators
,
selectCanTransfer
Ownership
selectCanTransfer
}
from
'
../../redux/studio-permissions
'
;
import
{
selectStudioTransferLaunched
}
from
'
../../redux/session.js
'
;
import
{
...
...
@@ -19,7 +19,7 @@ import {
promoteCurator
,
removeCurator
,
removeManager
,
transfer
Ownership
transfer
Host
}
from
'
./lib/studio-member-actions
'
;
import
{
selectStudioHasReachedManagerLimit
}
from
'
../../redux/studio
'
;
...
...
@@ -30,13 +30,13 @@ import removeIcon from './icons/remove-icon.svg';
import
promoteIcon
from
'
./icons/curator-icon.svg
'
;
const
StudioMemberTile
=
({
canRemove
,
canPromote
,
onRemove
,
canTransfer
Ownership
,
onPromote
,
onTransferOwnership
,
canRemove
,
canPromote
,
onRemove
,
canTransfer
Host
,
onPromote
,
onTransferHost
,
isCreator
,
hasReachedManagerLimit
,
// mapState props
username
,
image
// own props
})
=>
{
const
[
submitting
,
setSubmitting
]
=
useState
(
false
);
const
[
promoteModalOpen
,
setPromoteModalOpen
]
=
useState
(
false
);
const
[
transfer
OwnershipModalOpen
,
setTransferOwnership
ModalOpen
]
=
useState
(
false
);
const
[
transfer
HostModalOpen
,
setTransferHost
ModalOpen
]
=
useState
(
false
);
const
[
managerLimitReached
,
setManagerLimitReached
]
=
useState
(
false
);
const
{
errorAlert
,
successAlert
}
=
useAlertContext
();
const
userUrl
=
`/users/
${
username
}
`
;
...
...
@@ -55,7 +55,7 @@ const StudioMemberTile = ({
>
{
username
}
</
a
>
{
isCreator
&&
<
div
className=
"studio-member-role"
><
FormattedMessage
id=
"studio.creatorRole"
/></
div
>
}
</
div
>
{
(
canRemove
||
canPromote
||
canTransfer
Ownership
)
&&
{
(
canRemove
||
canPromote
||
canTransfer
Host
)
&&
<
OverflowMenu
>
{
canPromote
&&
<
li
>
<
button
...
...
@@ -88,11 +88,11 @@ const StudioMemberTile = ({
<
FormattedMessage
id=
"studio.remove"
/>
</
button
>
</
li
>
}
{
canTransfer
Ownership
&&
<
li
>
{
canTransfer
Host
&&
<
li
>
<
button
className=
"studio-member-tile-menu-wide"
onClick=
{
()
=>
{
setTransfer
Ownership
ModalOpen
(
true
);
setTransfer
Host
ModalOpen
(
true
);
}
}
>
<
img
src=
{
promoteIcon
}
/>
...
...
@@ -132,23 +132,23 @@ const StudioMemberTile = ({
/>
)
}
{
transfer
Ownership
ModalOpen
&&
<
Transfer
Ownership
Modal
handleClose=
{
()
=>
setTransfer
Ownership
ModalOpen
(
false
)
}
handleTransfer=
{
(
password
,
new
OwnerUsername
,
newOwner
UsernameId
)
=>
{
onTransfer
Ownership
(
password
,
newOwnerUsername
,
newOwner
UsernameId
)
{
transfer
Host
ModalOpen
&&
<
Transfer
Host
Modal
handleClose=
{
()
=>
setTransfer
Host
ModalOpen
(
false
)
}
handleTransfer=
{
(
password
,
new
HostUsername
,
newHost
UsernameId
)
=>
{
onTransfer
Host
(
password
,
newHostUsername
,
newHost
UsernameId
)
.
then
(()
=>
{
setTransfer
Ownership
ModalOpen
(
false
);
setTransfer
Host
ModalOpen
(
false
);
successAlert
({
id
:
'
studio.alertTransfer
'
,
values
:
{
name
:
new
Owner
Username
}
values
:
{
name
:
new
Host
Username
}
});
})
.
catch
(()
=>
{
setTransfer
Ownership
ModalOpen
(
false
);
setTransfer
Host
ModalOpen
(
false
);
errorAlert
({
id
:
'
studio.transfer.alert.somethingWentWrong
'
,
values
:
{
name
:
new
Owner
Username
}
values
:
{
name
:
new
Host
Username
}
});
});
}
}
...
...
@@ -161,10 +161,10 @@ const StudioMemberTile = ({
StudioMemberTile
.
propTypes
=
{
canRemove
:
PropTypes
.
bool
,
canPromote
:
PropTypes
.
bool
,
canTransfer
Ownership
:
PropTypes
.
bool
,
canTransfer
Host
:
PropTypes
.
bool
,
onRemove
:
PropTypes
.
func
,
onPromote
:
PropTypes
.
func
,
onTransfer
Ownership
:
PropTypes
.
func
,
onTransfer
Host
:
PropTypes
.
func
,
username
:
PropTypes
.
string
,
image
:
PropTypes
.
string
,
isCreator
:
PropTypes
.
bool
,
...
...
@@ -175,13 +175,13 @@ const ManagerTile = connect(
(
state
,
ownProps
)
=>
({
canRemove
:
selectCanRemoveManager
(
state
,
ownProps
.
id
),
canPromote
:
false
,
canTransfer
Ownership
:
selectCanTransferOwnership
(
state
,
ownProps
.
id
)
&&
canTransfer
Host
:
selectCanTransfer
(
state
,
ownProps
.
id
)
&&
selectStudioTransferLaunched
(
state
),
isCreator
:
state
.
studio
.
owner
===
ownProps
.
id
}),
{
onRemove
:
removeManager
,
onTransfer
Ownership
:
transferOwnership
onTransfer
Host
:
transferHost
}
)(
StudioMemberTile
);
...
...
static/svgs/studio/transfer-
ownership
.svg
→
static/svgs/studio/transfer-
host
.svg
View file @
ae3135bf
File moved
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