@@ -391,50 +419,40 @@ const SpaceSetupFirstRooms = ({ space, title, description, onFinished }) => {
const SpaceSetupPublicShare = ({ space, onFinished }) => {
return
-
{ _t("Share your public space") }
-
{ _t("At the moment only you can see it.") }
+
{ _t("Share %(name)s", { name: space.name }) }
+
+ { _t("It's just you at the moment, it will be even better with others.") }
+
-
+
;
};
-const SpaceSetupPrivateScope = ({ onFinished }) => {
- const [option, setOption] = useState
(null);
-
+const SpaceSetupPrivateScope = ({ space, onFinished }) => {
return
{ _t("Who are you working with?") }
-
{ _t("Ensure the right people have access to the space.") }
-
-
- { _t("Just Me") }
- { _t("A private space just for you") }
- ,
- }, {
- value: "meAndMyTeammates",
- className: "mx_SpaceRoomView_privateScope_meAndMyTeammatesButton",
- label:
- { _t("Me and my teammates") }
- { _t("A private space for you and your teammates") }
- ,
- },
- ]}
- />
-
-
-
onFinished(option !== "justMe")} />
+
+ { _t("Make sure the right people have access to %(name)s", { name: space.name }) }
+
+ { onFinished(false) }}
+ >
+ { _t("Just me") }
+ { _t("A private space to organise your rooms") }
+
+ { onFinished(true) }}
+ >
+ { _t("Me and my teammates") }
+ { _t("A private space for you and your teammates") }
+
;
};
@@ -464,6 +482,7 @@ const SpaceSetupPrivateInvite = ({ space, onFinished }) => {
onChange={ev => setEmailAddress(i, ev.target.value)}
ref={fieldRefs[i]}
onValidate={validateEmailRules}
+ autoFocus={i === 0}
/>;
});
@@ -501,9 +520,18 @@ const SpaceSetupPrivateInvite = ({ space, onFinished }) => {
setBusy(false);
};
+ let onClick = onFinished;
+ let buttonLabel = _t("Skip for now");
+ if (emailAddresses.some(name => name.trim())) {
+ onClick = onNextClick;
+ buttonLabel = busy ? _t("Inviting...") : _t("Continue")
+ }
+
return
{ _t("Invite your teammates") }
-
{ _t("Ensure the right people have access to the space.") }
+
+ { _t("Make sure the right people have access. You can invite more later.") }
+
{ error &&
{ error }
}
{ fields }
@@ -518,8 +546,7 @@ const SpaceSetupPrivateInvite = ({ space, onFinished }) => {
-
{_t("Skip for now")}
-
+
;
};
@@ -547,17 +574,26 @@ export default class SpaceRoomView extends React.PureComponent {
this.state = {
phase,
showRightPanel: RightPanelStore.getSharedInstance().isOpenForRoom,
+ myMembership: this.props.space.getMyMembership(),
};
this.dispatcherRef = defaultDispatcher.register(this.onAction);
this.rightPanelStoreToken = RightPanelStore.getSharedInstance().addListener(this.onRightPanelStoreUpdate);
+ this.context.on("Room.myMembership", this.onMyMembership);
}
componentWillUnmount() {
defaultDispatcher.unregister(this.dispatcherRef);
this.rightPanelStoreToken.remove();
+ this.context.off("Room.myMembership", this.onMyMembership);
}
+ private onMyMembership = (room: Room, myMembership: string) => {
+ if (room.roomId === this.props.space.roomId) {
+ this.setState({ myMembership });
+ }
+ };
+
private onRightPanelStoreUpdate = () => {
this.setState({
showRightPanel: RightPanelStore.getSharedInstance().isOpenForRoom,
@@ -594,10 +630,43 @@ export default class SpaceRoomView extends React.PureComponent {
}
};
+ private goToFirstRoom = async () => {
+ const childRooms = SpaceStore.instance.getChildRooms(this.props.space.roomId);
+ if (childRooms.length) {
+ const room = childRooms[0];
+ defaultDispatcher.dispatch({
+ action: "view_room",
+ room_id: room.roomId,
+ });
+ return;
+ }
+
+ let suggestedRooms = SpaceStore.instance.suggestedRooms;
+ if (SpaceStore.instance.activeSpace !== this.props.space) {
+ // the space store has the suggested rooms loaded for a different space, fetch the right ones
+ suggestedRooms = (await SpaceStore.instance.fetchSuggestedRooms(this.props.space, 1)).rooms;
+ }
+
+ if (suggestedRooms.length) {
+ const room = suggestedRooms[0];
+ defaultDispatcher.dispatch({
+ action: "view_room",
+ room_id: room.room_id,
+ oobData: {
+ avatarUrl: room.avatar_url,
+ name: room.name || room.canonical_alias || room.aliases.pop() || _t("Empty room"),
+ },
+ });
+ return;
+ }
+
+ this.setState({ phase: Phase.Landing });
+ };
+
private renderBody() {
switch (this.state.phase) {
case Phase.Landing:
- if (this.props.space.getMyMembership() === "join") {
+ if (this.state.myMembership === "join") {
return ;
} else {
return {
return this.setState({ phase: Phase.PublicShare })}
/>;
case Phase.PublicShare:
- return this.setState({ phase: Phase.Landing })}
- />;
+ return ;
case Phase.PrivateScope:
return {
this.setState({ phase: invite ? Phase.PrivateInvite : Phase.PrivateCreateRooms });
}}
@@ -634,7 +702,8 @@ export default class SpaceRoomView extends React.PureComponent {
return this.setState({ phase: Phase.Landing })}
/>;
}
diff --git a/src/components/views/dialogs/AddExistingToSpaceDialog.tsx b/src/components/views/dialogs/AddExistingToSpaceDialog.tsx
index 66efaefd9d..500637244a 100644
--- a/src/components/views/dialogs/AddExistingToSpaceDialog.tsx
+++ b/src/components/views/dialogs/AddExistingToSpaceDialog.tsx
@@ -69,6 +69,7 @@ const AddExistingToSpaceDialog: React.FC = ({ matrixClient: cli, space,
const existingRoomsSet = new Set(existingRooms);
const rooms = cli.getVisibleRooms().filter(room => {
return !existingRoomsSet.has(room) // not already in space
+ && !room.isSpaceRoom() // not a space itself
&& room.name.toLowerCase().includes(lcQuery) // contains query
&& !DMRoomMap.shared().getUserIdForRoomId(room.roomId); // not a DM
});
diff --git a/src/components/views/spaces/SpaceCreateMenu.tsx b/src/components/views/spaces/SpaceCreateMenu.tsx
index 88098d1b66..879cf929e0 100644
--- a/src/components/views/spaces/SpaceCreateMenu.tsx
+++ b/src/components/views/spaces/SpaceCreateMenu.tsx
@@ -108,7 +108,7 @@ const SpaceCreateMenu = ({ onFinished }) => {
body =
{ _t("Create a space") }
{ _t("Spaces are new ways to group rooms and people. " +
- "To join an existing space you’ll need an invite") }
+ "To join an existing space you'll need an invite.") }
{
{
- _t("Give it a photo, name and description to help you identify it.")
+ _t("Add some details to help people recognise it.")
} {
- _t("You can change these at any point.")
+ _t("You can change these anytime.")
}
diff --git a/src/components/views/spaces/SpacePanel.tsx b/src/components/views/spaces/SpacePanel.tsx
index 48e2c86b2c..bacf1bd929 100644
--- a/src/components/views/spaces/SpacePanel.tsx
+++ b/src/components/views/spaces/SpacePanel.tsx
@@ -220,13 +220,19 @@ const SpacePanel = () => {
{
+ openMenu();
+ if (!isPanelCollapsed) setPanelCollapsed(true);
+ }}
isNarrow={isPanelCollapsed}
/>
setPanelCollapsed(!isPanelCollapsed)}
+ onClick={() => {
+ setPanelCollapsed(!isPanelCollapsed);
+ if (menuDisplayed) closeMenu();
+ }}
title={expandCollapseButtonTitle}
/>
{ contextMenu }
diff --git a/src/components/views/spaces/SpacePublicShare.tsx b/src/components/views/spaces/SpacePublicShare.tsx
index 3930c1db16..b2d3b7ce29 100644
--- a/src/components/views/spaces/SpacePublicShare.tsx
+++ b/src/components/views/spaces/SpacePublicShare.tsx
@@ -41,13 +41,13 @@ const SpacePublicShare = ({ space, onFinished }: IProps) => {
const success = await copyPlaintext(permalinkCreator.forRoom());
const text = success ? _t("Copied!") : _t("Failed to copy");
setCopiedText(text);
- await sleep(10);
+ await sleep(5000);
if (copiedText === text) { // if the text hasn't changed by another click then clear it after some time
setCopiedText(_t("Click to copy"));
}
}}
>
- { _t("Share invite link") }
+ { _t("Share invite link") }
{ copiedText }
{
onFinished();
}}
>
- { _t("Invite by email or username") }
+ { _t("Invite people") }
+ { _t("Invite with email or username") }
;
};
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 63b19831bb..9739523d96 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -989,7 +989,7 @@
"Name": "Name",
"Description": "Description",
"Create a space": "Create a space",
- "Spaces are new ways to group rooms and people. To join an existing space you’ll need an invite": "Spaces are new ways to group rooms and people. To join an existing space you’ll need an invite",
+ "Spaces are new ways to group rooms and people. To join an existing space you'll need an invite.": "Spaces are new ways to group rooms and people. To join an existing space you'll need an invite.",
"Public": "Public",
"Open space for anyone, best for communities": "Open space for anyone, best for communities",
"Private": "Private",
@@ -998,8 +998,8 @@
"Go back": "Go back",
"Your public space": "Your public space",
"Your private space": "Your private space",
- "Give it a photo, name and description to help you identify it.": "Give it a photo, name and description to help you identify it.",
- "You can change these at any point.": "You can change these at any point.",
+ "Add some details to help people recognise it.": "Add some details to help people recognise it.",
+ "You can change these anytime.": "You can change these anytime.",
"Creating...": "Creating...",
"Create": "Create",
"Expand space panel": "Expand space panel",
@@ -1009,10 +1009,10 @@
"Copied!": "Copied!",
"Failed to copy": "Failed to copy",
"Share invite link": "Share invite link",
- "Invite by email or username": "Invite by email or username",
+ "Invite people": "Invite people",
+ "Invite with email or username": "Invite with email or username",
"Invite members": "Invite members",
"Share your public space": "Share your public space",
- "Invite people": "Invite people",
"Settings": "Settings",
"Leave space": "Leave space",
"New room": "New room",
@@ -2633,22 +2633,24 @@
"Failed to create initial space rooms": "Failed to create initial space rooms",
"Skip for now": "Skip for now",
"Creating rooms...": "Creating rooms...",
- "At the moment only you can see it.": "At the moment only you can see it.",
- "Finish": "Finish",
+ "Share %(name)s": "Share %(name)s",
+ "It's just you at the moment, it will be even better with others.": "It's just you at the moment, it will be even better with others.",
+ "Go to my first room": "Go to my first room",
"Who are you working with?": "Who are you working with?",
- "Ensure the right people have access to the space.": "Ensure the right people have access to the space.",
- "Just Me": "Just Me",
- "A private space just for you": "A private space just for you",
+ "Make sure the right people have access to %(name)s": "Make sure the right people have access to %(name)s",
+ "Just me": "Just me",
+ "A private space to organise your rooms": "A private space to organise your rooms",
"Me and my teammates": "Me and my teammates",
"A private space for you and your teammates": "A private space for you and your teammates",
"Failed to invite the following users to your space: %(csvUsers)s": "Failed to invite the following users to your space: %(csvUsers)s",
- "Invite your teammates": "Invite your teammates",
- "Invite by username": "Invite by username",
"Inviting...": "Inviting...",
+ "Invite your teammates": "Invite your teammates",
+ "Make sure the right people have access. You can invite more later.": "Make sure the right people have access. You can invite more later.",
+ "Invite by username": "Invite by username",
"What are some things you want to discuss?": "What are some things you want to discuss?",
- "We'll create rooms for each topic.": "We'll create rooms for each topic.",
+ "Let's create a room for each of them. You can add more later too, including already existing ones.": "Let's create a room for each of them. You can add more later too, including already existing ones.",
"What projects are you working on?": "What projects are you working on?",
- "We'll create rooms for each of them. You can add existing rooms after setup.": "We'll create rooms for each of them. You can add existing rooms after setup.",
+ "We'll create rooms for each of them. You can add more later too, including already existing ones.": "We'll create rooms for each of them. You can add more later too, including already existing ones.",
"Tried to load a specific point in this room's timeline, but you do not have permission to view the message in question.": "Tried to load a specific point in this room's timeline, but you do not have permission to view the message in question.",
"Tried to load a specific point in this room's timeline, but was unable to find it.": "Tried to load a specific point in this room's timeline, but was unable to find it.",
"Failed to load timeline position": "Failed to load timeline position",
diff --git a/src/stores/SpaceStore.tsx b/src/stores/SpaceStore.tsx
index d1abc68f4e..b82acfd0ed 100644
--- a/src/stores/SpaceStore.tsx
+++ b/src/stores/SpaceStore.tsx
@@ -118,23 +118,32 @@ export class SpaceStoreClass extends AsyncStoreWithClient