setVisibility(Visibility.Private)}
/>
@@ -136,7 +136,7 @@ const SpaceCreateMenu = ({ onFinished }) => {
{
- _t("Give it a memorable name and photo to help you identify it.")
+ _t("Give it a photo, name and description to help you identify it.")
} {
_t("You can change these at any point.")
}
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index d7c750ab2d8..7828007df77 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -989,7 +989,7 @@
"Go back": "Go back",
"Personalise your public space": "Personalise your public space",
"Personalise your private space": "Personalise your private space",
- "Give it a memorable name and photo to help you identify it.": "Give it a memorable name and photo to help you identify it.",
+ "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.",
"Creating...": "Creating...",
"Create": "Create",
From 91104236857087ad35336c6f7816dd8d5c0eae1e Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Mon, 8 Feb 2021 14:02:56 +0000
Subject: [PATCH 88/94] Fix default avatar colours being generated wrong in
space room directory
---
.../structures/SpaceRoomDirectory.tsx | 31 +++++++++++--------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/src/components/structures/SpaceRoomDirectory.tsx b/src/components/structures/SpaceRoomDirectory.tsx
index b0f4ebf4386..c6f630c09be 100644
--- a/src/components/structures/SpaceRoomDirectory.tsx
+++ b/src/components/structures/SpaceRoomDirectory.tsx
@@ -33,6 +33,7 @@ import {shouldShowSpaceSettings} from "../../utils/space";
import {EnhancedMap} from "../../utils/maps";
import StyledCheckbox from "../views/elements/StyledCheckbox";
import AutoHideScrollbar from "./AutoHideScrollbar";
+import BaseAvatar from "../views/avatars/BaseAvatar";
interface IProps {
space: Room;
@@ -77,16 +78,18 @@ interface ISubspaceProps {
const SubSpace: React.FC = ({ space, editing, event, onRemoveFromSpaceClick, children }) => {
const name = space.name || space.canonical_alias || space.aliases?.[0] || _t("Unnamed Space");
- const oobData = {
- roomId: space.room_id,
- avatarUrl: space.avatar_url,
- name,
- };
+ let url;
+ if (space.avatar_url) {
+ url = MatrixClientPeg.get().mxcUrlToHttp(space.avatar_url,
+ Math.floor(24 * window.devicePixelRatio),
+ Math.floor(24 * window.devicePixelRatio),
+ "crop");
+ }
// TODO add preview/join/already in for subspaces
return
-
+
{ name }
{/*
@@ -113,12 +116,6 @@ interface IRoomTileProps {
const RoomTile = ({ room, event, editing, onRemoveFromSpaceClick, onPreviewClick, onJoinClick }: IRoomTileProps) => {
const name = room.name || room.canonical_alias || room.aliases?.[0] || _t("Unnamed Room");
- const oobData = {
- roomId: room.room_id,
- avatarUrl: room.avatar_url,
- name,
- };
-
// TODO consider event for both inSpace (via) && auto_join
// send back to top level event contents/state keys etc to update on `Save`
// uniq keyed by Parent ID + Child ID
@@ -160,8 +157,16 @@ const RoomTile = ({ room, event, editing, onRemoveFromSpaceClick, onPreviewClick
}
}
+ let url;
+ if (room.avatar_url) {
+ url = cli.mxcUrlToHttp(room.avatar_url,
+ Math.floor(32 * window.devicePixelRatio),
+ Math.floor(32 * window.devicePixelRatio),
+ "crop");
+ }
+
return
-
+
From 3a74bd3123faf831308fb718ff7bb5ed130226ac Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Mon, 8 Feb 2021 15:24:05 +0000
Subject: [PATCH 89/94] Sort space children as per the MSC
---
src/stores/SpaceStore.tsx | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/stores/SpaceStore.tsx b/src/stores/SpaceStore.tsx
index 75124481a5a..571cfd0f97f 100644
--- a/src/stores/SpaceStore.tsx
+++ b/src/stores/SpaceStore.tsx
@@ -110,10 +110,21 @@ export class SpaceStoreClass extends AsyncStoreWithClient {
}, roomId);
}
+ private static getOrder = (ev: MatrixEvent): string | null => {
+ const content = ev.getContent();
+ if (typeof content.order === "string" && Array.from(content.order).every((c: string) => {
+ const charCode = c.charCodeAt(0);
+ return charCode >= 0x20 && charCode <= 0x7F;
+ })) {
+ return content.order;
+ }
+ return null;
+ };
+
private getChildren(spaceId: string): Room[] {
const room = this.matrixClient?.getRoom(spaceId);
- return room?.currentState.getStateEvents(EventType.SpaceChild)
- .filter(ev => ev.getContent()?.via)
+ const childEvents = room?.currentState.getStateEvents(EventType.SpaceChild).filter(ev => ev.getContent()?.via);
+ return sortBy(childEvents, SpaceStoreClass.getOrder)
.map(ev => this.matrixClient.getRoom(ev.getStateKey()))
.filter(Boolean) || [];
}
From ebba9255f4f50f72b83c54ad68709e85c888c4a7 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Mon, 8 Feb 2021 15:28:04 +0000
Subject: [PATCH 90/94] Don't show un-joined spaces in the hierarchy
---
src/stores/SpaceStore.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/stores/SpaceStore.tsx b/src/stores/SpaceStore.tsx
index 571cfd0f97f..d908715aaa7 100644
--- a/src/stores/SpaceStore.tsx
+++ b/src/stores/SpaceStore.tsx
@@ -126,7 +126,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient {
const childEvents = room?.currentState.getStateEvents(EventType.SpaceChild).filter(ev => ev.getContent()?.via);
return sortBy(childEvents, SpaceStoreClass.getOrder)
.map(ev => this.matrixClient.getRoom(ev.getStateKey()))
- .filter(Boolean) || [];
+ .filter(room => room?.getMyMembership() === "join") || [];
}
public getChildRooms(spaceId: string): Room[] {
From e0dca6c2a6253027488ec7a039f2a0057cd94aff Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Tue, 9 Feb 2021 11:48:58 +0000
Subject: [PATCH 91/94] Wire up Space Room Directory admin mode
---
res/css/structures/_SpaceRoomDirectory.scss | 5 +-
.../structures/SpaceRoomDirectory.tsx | 101 +++++++++++++++---
src/i18n/strings/en_EN.json | 1 +
src/stores/SpaceStore.tsx | 2 -
4 files changed, 89 insertions(+), 20 deletions(-)
diff --git a/res/css/structures/_SpaceRoomDirectory.scss b/res/css/structures/_SpaceRoomDirectory.scss
index 8e3a5f7e610..e7a78fca4d6 100644
--- a/res/css/structures/_SpaceRoomDirectory.scss
+++ b/res/css/structures/_SpaceRoomDirectory.scss
@@ -142,7 +142,7 @@ limitations under the License.
min-height: 76px;
box-sizing: border-box;
- &:hover {
+ &.mx_AccessibleButton:hover {
background-color: rgba(141, 151, 165, 0.1);
}
@@ -198,6 +198,8 @@ limitations under the License.
margin: auto 0 auto 28px;
.mx_AccessibleButton {
+ vertical-align: middle;
+
& + .mx_AccessibleButton {
margin-left: 24px;
}
@@ -211,7 +213,6 @@ limitations under the License.
.mx_Checkbox {
display: inline-block;
- vertical-align: text-bottom;
}
}
}
diff --git a/src/components/structures/SpaceRoomDirectory.tsx b/src/components/structures/SpaceRoomDirectory.tsx
index c6f630c09be..50651369f78 100644
--- a/src/components/structures/SpaceRoomDirectory.tsx
+++ b/src/components/structures/SpaceRoomDirectory.tsx
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-import React, {useMemo, useState} from "react";
+import React, {useMemo, useRef, useState} from "react";
import Room from "matrix-js-sdk/src/models/room";
import MatrixEvent from "matrix-js-sdk/src/models/event";
import {EventType, RoomType} from "matrix-js-sdk/src/@types/event";
@@ -62,7 +62,11 @@ export interface ISpaceSummaryEvent {
origin_server_ts: number;
type: string;
state_key: string;
- content: object;
+ content: {
+ order?: string;
+ auto_join?: boolean;
+ via?: string;
+ };
}
/* eslint-enable camelcase */
@@ -104,18 +108,50 @@ const SubSpace: React.FC = ({ space, editing, event, onRemoveFro
};
+interface IAction {
+ event: MatrixEvent;
+ removed: boolean;
+ autoJoin: boolean;
+}
+
interface IRoomTileProps {
room: ISpaceSummaryRoom;
event?: MatrixEvent;
editing?: boolean;
onPreviewClick(): void;
- onRemoveFromSpaceClick?(): void;
+ queueAction(action: IAction): void;
onJoinClick?(): void;
}
-const RoomTile = ({ room, event, editing, onRemoveFromSpaceClick, onPreviewClick, onJoinClick }: IRoomTileProps) => {
+const RoomTile = ({ room, event, editing, queueAction, onPreviewClick, onJoinClick }: IRoomTileProps) => {
const name = room.name || room.canonical_alias || room.aliases?.[0] || _t("Unnamed Room");
+ const evContent = event?.getContent();
+ const [autoJoin, _setAutoJoin] = useState(evContent?.auto_join);
+ const [removed, _setRemoved] = useState(!evContent?.via);
+
+ const setAutoJoin = () => {
+ _setAutoJoin(v => {
+ queueAction({
+ event,
+ removed,
+ autoJoin: !v,
+ });
+ return !v;
+ });
+ };
+
+ const setRemoved = () => {
+ _setRemoved(v => {
+ queueAction({
+ event,
+ removed: !v,
+ autoJoin,
+ });
+ return !v;
+ });
+ };
+
// TODO consider event for both inSpace (via) && auto_join
// send back to top level event contents/state keys etc to update on `Save`
// uniq keyed by Parent ID + Child ID
@@ -126,13 +162,16 @@ const RoomTile = ({ room, event, editing, onRemoveFromSpaceClick, onPreviewClick
let actions;
if (editing) {
if (event) {
- actions =
-
- {}}
- />
-
+ if (removed) {
+ actions =
+
+ ;
+ } else {
+ actions =
+
+
+ ;
+ }
} else {
actions =
{ _t("No permissions")}
@@ -165,7 +204,7 @@ const RoomTile = ({ room, event, editing, onRemoveFromSpaceClick, onPreviewClick
"crop");
}
- return
+ const content =
@@ -183,6 +222,16 @@ const RoomTile = ({ room, event, editing, onRemoveFromSpaceClick, onPreviewClick
{ actions }
+ ;
+
+ if (editing) {
+ return
+ { content }
+
+ }
+
+ return
+ { content }
;
};
@@ -219,6 +268,7 @@ interface IHierarchyLevelProps {
editing?: boolean;
relations: EnhancedMap
;
parents: Set;
+ queueAction(action: IAction): void;
onPreviewClick(roomId: string): void;
onRemoveFromSpaceClick?(roomId: string): void;
onJoinClick?(roomId: string, parents: Set): void;
@@ -232,9 +282,11 @@ export const HierarchyLevel = ({
parents,
onPreviewClick,
onJoinClick,
+ queueAction,
}: IHierarchyLevelProps) => {
const cli = MatrixClientPeg.get();
const space = cli.getRoom(spaceId);
+ // TODO respect order
const [subspaces, childRooms] = relations.get(spaceId)?.reduce((result, roomId: string) => {
if (!rooms.has(roomId)) return result; // TODO wat
result[rooms.get(roomId).room_type === RoomType.Space ? 0 : 1].push(roomId);
@@ -258,9 +310,7 @@ export const HierarchyLevel = ({
? space?.currentState.getStateEvents(EventType.SpaceChild, roomId)
: undefined}
editing={editing}
- onRemoveFromSpaceClick={() => {
- console.log("@@ remove room from space", roomId);
- }}
+ queueAction={queueAction}
onPreviewClick={() => {
onPreviewClick(roomId);
}}
@@ -296,6 +346,7 @@ export const HierarchyLevel = ({
parents={newParents}
onPreviewClick={onPreviewClick}
onJoinClick={onJoinClick}
+ queueAction={queueAction}
/>
))
@@ -317,6 +368,9 @@ const SpaceRoomDirectory: React.FC = ({ space, initialText = "", onFinis
onFinished();
};
+ // stored within a ref as we don't need to re-render when it changes
+ const pendingActions = useRef(new Map());
+
let adminButton;
if (shouldShowSpaceSettings(cli, space)) { // TODO this is an imperfect test
const onManageButtonClicked = () => {
@@ -324,7 +378,19 @@ const SpaceRoomDirectory: React.FC = ({ space, initialText = "", onFinis
};
const onSaveButtonClicked = () => {
- // TODO
+ // TODO setBusy
+ pendingActions.current.forEach(({event, autoJoin, removed}) => {
+ const content = {
+ ...event.getContent(),
+ auto_join: autoJoin,
+ };
+
+ if (removed) {
+ delete content["via"];
+ }
+
+ cli.sendStateEvent(event.getRoomId(), event.getType(), content, event.getStateKey());
+ });
setIsEditing(false);
};
@@ -399,6 +465,9 @@ const SpaceRoomDirectory: React.FC = ({ space, initialText = "", onFinis
editing={isEditing}
relations={relations}
parents={new Set()}
+ queueAction={action => {
+ pendingActions.current.set(action.event.room_id, action);
+ }}
onPreviewClick={roomId => {
showRoom(roomsMap.get(roomId), Array.from(viaMap.get(roomId) || []), false);
onFinished();
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 7828007df77..37911b785a9 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -2552,6 +2552,7 @@
"You have %(count)s unread notifications in a prior version of this room.|other": "You have %(count)s unread notifications in a prior version of this room.",
"You have %(count)s unread notifications in a prior version of this room.|one": "You have %(count)s unread notification in a prior version of this room.",
"Unnamed Space": "Unnamed Space",
+ "Undo": "Undo",
"Remove from Space": "Remove from Space",
"No permissions": "No permissions",
"You're in this room": "You're in this room",
diff --git a/src/stores/SpaceStore.tsx b/src/stores/SpaceStore.tsx
index d908715aaa7..7dd8b257675 100644
--- a/src/stores/SpaceStore.tsx
+++ b/src/stores/SpaceStore.tsx
@@ -64,8 +64,6 @@ const getRoomFn: FetchRoomFn = (room: Room) => {
export class SpaceStoreClass extends AsyncStoreWithClient {
constructor() {
super(defaultDispatcher, {});
-
- if (!SettingsStore.getValue("feature_spaces")) return;
}
// The spaces representing the roots of the various tree-like hierarchies
From 5ffc110efaf994f9b4576fed84ee4bf80a588744 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Tue, 9 Feb 2021 12:06:15 +0000
Subject: [PATCH 92/94] delint
---
.../structures/SpaceRoomDirectory.tsx | 48 +++++++++----------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/src/components/structures/SpaceRoomDirectory.tsx b/src/components/structures/SpaceRoomDirectory.tsx
index 50651369f78..ab770a7c90a 100644
--- a/src/components/structures/SpaceRoomDirectory.tsx
+++ b/src/components/structures/SpaceRoomDirectory.tsx
@@ -130,28 +130,6 @@ const RoomTile = ({ room, event, editing, queueAction, onPreviewClick, onJoinCli
const [autoJoin, _setAutoJoin] = useState(evContent?.auto_join);
const [removed, _setRemoved] = useState(!evContent?.via);
- const setAutoJoin = () => {
- _setAutoJoin(v => {
- queueAction({
- event,
- removed,
- autoJoin: !v,
- });
- return !v;
- });
- };
-
- const setRemoved = () => {
- _setRemoved(v => {
- queueAction({
- event,
- removed: !v,
- autoJoin,
- });
- return !v;
- });
- };
-
// TODO consider event for both inSpace (via) && auto_join
// send back to top level event contents/state keys etc to update on `Save`
// uniq keyed by Parent ID + Child ID
@@ -160,8 +138,30 @@ const RoomTile = ({ room, event, editing, queueAction, onPreviewClick, onJoinCli
const myMembership = cli.getRoom(room.room_id)?.getMyMembership();
let actions;
- if (editing) {
+ if (editing && queueAction) {
if (event) {
+ const setAutoJoin = () => {
+ _setAutoJoin(v => {
+ queueAction({
+ event,
+ removed,
+ autoJoin: !v,
+ });
+ return !v;
+ });
+ };
+
+ const setRemoved = () => {
+ _setRemoved(v => {
+ queueAction({
+ event,
+ removed: !v,
+ autoJoin,
+ });
+ return !v;
+ });
+ };
+
if (removed) {
actions =
@@ -268,7 +268,7 @@ interface IHierarchyLevelProps {
editing?: boolean;
relations: EnhancedMap;
parents: Set;
- queueAction(action: IAction): void;
+ queueAction?(action: IAction): void;
onPreviewClick(roomId: string): void;
onRemoveFromSpaceClick?(roomId: string): void;
onJoinClick?(roomId: string, parents: Set): void;
From 112e2822badf02daa05b641945b69af1bba0b70f Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 10 Feb 2021 13:14:55 +0000
Subject: [PATCH 93/94] Iterate space room directory
---
res/css/structures/_SpaceRoomDirectory.scss | 31 +++--
.../structures/SpaceRoomDirectory.tsx | 110 ++++++++++++++----
src/i18n/strings/en_EN.json | 1 +
3 files changed, 111 insertions(+), 31 deletions(-)
diff --git a/res/css/structures/_SpaceRoomDirectory.scss b/res/css/structures/_SpaceRoomDirectory.scss
index e7a78fca4d6..7b942d358f3 100644
--- a/res/css/structures/_SpaceRoomDirectory.scss
+++ b/res/css/structures/_SpaceRoomDirectory.scss
@@ -110,6 +110,9 @@ limitations under the License.
margin-top: 8px;
.mx_SpaceRoomDirectory_subspace_info {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
margin-bottom: 8px;
color: $secondary-fg-color;
font-weight: $font-semi-bold;
@@ -124,6 +127,13 @@ limitations under the License.
.mx_BaseAvatar_image {
border-radius: 8px;
}
+
+ .mx_SpaceRoomDirectory_actions {
+ text-align: right;
+ height: min-content;
+ margin-left: auto;
+ margin-right: 16px;
+ }
}
.mx_SpaceRoomDirectory_subspace_children {
@@ -191,7 +201,7 @@ limitations under the License.
}
}
- .mx_SpaceRoomDirectory_roomTile_actions {
+ .mx_SpaceRoomDirectory_actions {
width: 180px;
text-align: right;
height: min-content;
@@ -204,16 +214,19 @@ limitations under the License.
margin-left: 24px;
}
}
+ }
+ }
- .mx_SpaceRoomDirectory_roomTile_actionsText {
- font-size: $font-12px;
- line-height: $font-15px;
- color: $secondary-fg-color;
- }
+ .mx_SpaceRoomDirectory_actions {
+ .mx_SpaceRoomDirectory_actionsText {
+ font-weight: normal;
+ font-size: $font-12px;
+ line-height: $font-15px;
+ color: $secondary-fg-color;
+ }
- .mx_Checkbox {
- display: inline-block;
- }
+ .mx_Checkbox {
+ display: inline-block;
}
}
}
diff --git a/src/components/structures/SpaceRoomDirectory.tsx b/src/components/structures/SpaceRoomDirectory.tsx
index ab770a7c90a..69070af39af 100644
--- a/src/components/structures/SpaceRoomDirectory.tsx
+++ b/src/components/structures/SpaceRoomDirectory.tsx
@@ -74,15 +74,88 @@ interface ISubspaceProps {
space: ISpaceSummaryRoom;
event?: MatrixEvent;
editing?: boolean;
- onRemoveFromSpaceClick?(): void;
onPreviewClick?(): void;
+ queueAction?(action: IAction): void;
onJoinClick?(): void;
}
-const SubSpace: React.FC = ({ space, editing, event, onRemoveFromSpaceClick, children }) => {
+const SubSpace: React.FC = ({
+ space,
+ editing,
+ event,
+ queueAction,
+ onJoinClick,
+ onPreviewClick,
+ children,
+}) => {
const name = space.name || space.canonical_alias || space.aliases?.[0] || _t("Unnamed Space");
- let url;
+ const evContent = event?.getContent();
+ const [autoJoin, _setAutoJoin] = useState(evContent?.auto_join);
+ const [removed, _setRemoved] = useState(!evContent?.via);
+
+ const cli = MatrixClientPeg.get();
+ const cliRoom = cli.getRoom(space.room_id);
+ const myMembership = cliRoom?.getMyMembership();
+
+ // TODO DRY code
+ let actions;
+ if (editing && queueAction) {
+ if (event && cliRoom?.currentState.maySendStateEvent(event.getType(), cli.getUserId())) {
+ const setAutoJoin = () => {
+ _setAutoJoin(v => {
+ queueAction({
+ event,
+ removed,
+ autoJoin: !v,
+ });
+ return !v;
+ });
+ };
+
+ const setRemoved = () => {
+ _setRemoved(v => {
+ queueAction({
+ event,
+ removed: !v,
+ autoJoin,
+ });
+ return !v;
+ });
+ };
+
+ if (removed) {
+ actions =
+
+ ;
+ } else {
+ actions =
+
+
+ ;
+ }
+ } else {
+ actions =
+ { _t("No permissions")}
+ ;
+ }
+ // TODO confirm remove from space click behaviour here
+ } else {
+ if (myMembership === "join") {
+ actions =
+ { _t("You're in this space")}
+ ;
+ } else if (onJoinClick) {
+ actions =
+
+ { _t("Preview") }
+
+
+
+ }
+ }
+
+ let url: string;
if (space.avatar_url) {
url = MatrixClientPeg.get().mxcUrlToHttp(space.avatar_url,
Math.floor(24 * window.devicePixelRatio),
@@ -90,17 +163,14 @@ const SubSpace: React.FC = ({ space, editing, event, onRemoveFro
"crop");
}
- // TODO add preview/join/already in for subspaces
return
{ name }
- {/*
-
{}}
- />*/}
+
+ { actions }
+
{ children }
@@ -119,7 +189,7 @@ interface IRoomTileProps {
event?: MatrixEvent;
editing?: boolean;
onPreviewClick(): void;
- queueAction(action: IAction): void;
+ queueAction?(action: IAction): void;
onJoinClick?(): void;
}
@@ -135,11 +205,12 @@ const RoomTile = ({ room, event, editing, queueAction, onPreviewClick, onJoinCli
// uniq keyed by Parent ID + Child ID
const cli = MatrixClientPeg.get();
- const myMembership = cli.getRoom(room.room_id)?.getMyMembership();
+ const cliRoom = cli.getRoom(room.room_id);
+ const myMembership = cliRoom?.getMyMembership();
let actions;
if (editing && queueAction) {
- if (event) {
+ if (event && cliRoom?.currentState.maySendStateEvent(event.getType(), cli.getUserId())) {
const setAutoJoin = () => {
_setAutoJoin(v => {
queueAction({
@@ -173,17 +244,14 @@ const RoomTile = ({ room, event, editing, queueAction, onPreviewClick, onJoinCli
;
}
} else {
- actions =
+ actions =
{ _t("No permissions")}
;
}
- // TODO if editing && !event then user does not have permission, show this
- // TODO check for permissions
- // TODO add checkybox
// TODO confirm remove from space click behaviour here
} else {
if (myMembership === "join") {
- actions =
+ actions =
{ _t("You're in this room")}
;
} else if (onJoinClick) {
@@ -196,7 +264,7 @@ const RoomTile = ({ room, event, editing, queueAction, onPreviewClick, onJoinCli
}
}
- let url;
+ let url: string;
if (room.avatar_url) {
url = cli.mxcUrlToHttp(room.avatar_url,
Math.floor(32 * window.devicePixelRatio),
@@ -219,7 +287,7 @@ const RoomTile = ({ room, event, editing, queueAction, onPreviewClick, onJoinCli
{ room.num_joined_members }
-
+
{ actions }
;
@@ -328,9 +396,7 @@ export const HierarchyLevel = ({
space={rooms.get(roomId)}
event={space?.currentState.getStateEvents(EventType.SpaceChild, roomId)}
editing={editing}
- onRemoveFromSpaceClick={() => {
- console.log("@@ remove subspace from space", roomId);
- }}
+ queueAction={queueAction}
onPreviewClick={() => {
onPreviewClick(roomId);
}}
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 37911b785a9..e1f3ecb5b7e 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -2555,6 +2555,7 @@
"Undo": "Undo",
"Remove from Space": "Remove from Space",
"No permissions": "No permissions",
+ "You're in this space": "You're in this space",
"You're in this room": "You're in this room",
"Save changes": "Save changes",
"All users join by default": "All users join by default",
From ad5d8b07038ec1086a6a2b8bea01a7c31fa1fd5e Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Thu, 18 Feb 2021 14:33:53 +0000
Subject: [PATCH 94/94] i18n
---
src/i18n/strings/en_EN.json | 118 ++++++++++++++++++++++++++++++++----
1 file changed, 107 insertions(+), 11 deletions(-)
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 5bbbdf60b59..db8ef54fd0e 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -777,6 +777,7 @@
"%(senderName)s: %(reaction)s": "%(senderName)s: %(reaction)s",
"%(senderName)s: %(stickerName)s": "%(senderName)s: %(stickerName)s",
"Change notification settings": "Change notification settings",
+ "Spaces prototype. Incompatible with Communities, Communities v2 and Custom Tags": "Spaces prototype. Incompatible with Communities, Communities v2 and Custom Tags",
"Render LaTeX maths in messages": "Render LaTeX maths in messages",
"Communities v2 prototypes. Requires compatible homeserver. Highly experimental - use with caution.": "Communities v2 prototypes. Requires compatible homeserver. Highly experimental - use with caution.",
"New spinner design": "New spinner design",
@@ -977,8 +978,42 @@
"From %(deviceName)s (%(deviceId)s)": "From %(deviceName)s (%(deviceId)s)",
"Decline (%(counter)s)": "Decline (%(counter)s)",
"Accept
to continue:": "Accept
to continue:",
- "Remove": "Remove",
+ "Delete": "Delete",
"Upload": "Upload",
+ "Name": "Name",
+ "Description": "Description",
+ "Create a space": "Create a space",
+ "Organise rooms into spaces, for just you or anyone": "Organise rooms into spaces, for just you or anyone",
+ "Public": "Public",
+ "Open space for anyone, best for communities": "Open space for anyone, best for communities",
+ "Private": "Private",
+ "Invite only space, best for yourself or teams": "Invite only space, best for yourself or teams",
+ "Go back": "Go back",
+ "Personalise your public space": "Personalise your public space",
+ "Personalise your private space": "Personalise 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.",
+ "Creating...": "Creating...",
+ "Create": "Create",
+ "Expand space panel": "Expand space panel",
+ "Collapse space panel": "Collapse space panel",
+ "Home": "Home",
+ "Click to copy": "Click to copy",
+ "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 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",
+ "Space Home": "Space Home",
+ "Members": "Members",
+ "Explore rooms": "Explore rooms",
+ "Space options": "Space options",
+ "Remove": "Remove",
"This bridge was provisioned by
.": "This bridge was provisioned by
.",
"This bridge is managed by
.": "This bridge is managed by
.",
"Workspace:
": "Workspace:
",
@@ -1132,7 +1167,6 @@
"Disconnect anyway": "Disconnect anyway",
"You are still
sharing your personal data on the identity server
.": "You are still
sharing your personal data on the identity server
.",
"We recommend that you remove your email addresses and phone numbers from the identity server before disconnecting.": "We recommend that you remove your email addresses and phone numbers from the identity server before disconnecting.",
- "Go back": "Go back",
"Identity Server (%(server)s)": "Identity Server (%(server)s)",
"You are currently using
to discover and be discoverable by existing contacts you know. You can change your identity server below.": "You are currently using
to discover and be discoverable by existing contacts you know. You can change your identity server below.",
"If you don't want to use
to discover and be discoverable by existing contacts you know, enter another identity server below.": "If you don't want to use
to discover and be discoverable by existing contacts you know, enter another identity server below.",
@@ -1412,6 +1446,7 @@
"and %(count)s others...|one": "and one other...",
"Invite to this room": "Invite to this room",
"Invite to this community": "Invite to this community",
+ "Invite to this space": "Invite to this space",
"Invited": "Invited",
"Filter room members": "Filter room members",
"%(userName)s (power %(powerLevelNumber)s)": "%(userName)s (power %(powerLevelNumber)s)",
@@ -1484,6 +1519,10 @@
"Rooms": "Rooms",
"Add room": "Add room",
"Create new room": "Create new room",
+ "You do not have permissions to create new rooms in this space": "You do not have permissions to create new rooms in this space",
+ "Add existing room": "Add existing room",
+ "You do not have permissions to add rooms to this space": "You do not have permissions to add rooms to this space",
+ "Explore space rooms": "Explore space rooms",
"Explore community rooms": "Explore community rooms",
"Explore public rooms": "Explore public rooms",
"Low priority": "Low priority",
@@ -1554,7 +1593,6 @@
"Favourited": "Favourited",
"Favourite": "Favourite",
"Low Priority": "Low Priority",
- "Settings": "Settings",
"Leave Room": "Leave Room",
"Room options": "Room options",
"%(count)s unread messages including mentions.|other": "%(count)s unread messages including mentions.",
@@ -1643,7 +1681,6 @@
"The homeserver the user you’re verifying is connected to": "The homeserver the user you’re verifying is connected to",
"Yours, or the other users’ internet connection": "Yours, or the other users’ internet connection",
"Yours, or the other users’ session": "Yours, or the other users’ session",
- "Members": "Members",
"Room Info": "Room Info",
"You can only pin up to %(count)s widgets|other": "You can only pin up to %(count)s widgets",
"Unpin": "Unpin",
@@ -1674,6 +1711,7 @@
"Share Link to User": "Share Link to User",
"Direct message": "Direct message",
"Demote yourself?": "Demote yourself?",
+ "You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the space it will be impossible to regain privileges.": "You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the space it will be impossible to regain privileges.",
"You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the room it will be impossible to regain privileges.": "You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the room it will be impossible to regain privileges.",
"Demote": "Demote",
"Disinvite": "Disinvite",
@@ -1795,8 +1833,6 @@
"%(senderDisplayName)s changed the room avatar to
![]()
": "%(senderDisplayName)s changed the room avatar to
![]()
",
"Click here to see older messages.": "Click here to see older messages.",
"This room is a continuation of another conversation.": "This room is a continuation of another conversation.",
- "Copied!": "Copied!",
- "Failed to copy": "Failed to copy",
"Add an Integration": "Add an Integration",
"You are about to be taken to a third-party site so you can authenticate your account for use with %(integrationsUrl)s. Do you wish to continue?": "You are about to be taken to a third-party site so you can authenticate your account for use with %(integrationsUrl)s. Do you wish to continue?",
"Edited at %(date)s": "Edited at %(date)s",
@@ -1941,7 +1977,6 @@
"Continue with %(provider)s": "Continue with %(provider)s",
"Sign in with single sign-on": "Sign in with single sign-on",
"And %(count)s more...|other": "And %(count)s more...",
- "Home": "Home",
"Enter a server name": "Enter a server name",
"Looks good": "Looks good",
"Can't find this server or its room list": "Can't find this server or its room list",
@@ -1956,6 +1991,15 @@
"Add a new server...": "Add a new server...",
"%(networkName)s rooms": "%(networkName)s rooms",
"Matrix rooms": "Matrix rooms",
+ "Space selection": "Space selection",
+ "Add existing spaces/rooms": "Add existing spaces/rooms",
+ "Filter your rooms and spaces": "Filter your rooms and spaces",
+ "Spaces": "Spaces",
+ "Don't want to add an existing room?": "Don't want to add an existing room?",
+ "Create a new room": "Create a new room",
+ "Applying...": "Applying...",
+ "Apply": "Apply",
+ "Failed to add rooms to space": "Failed to add rooms to space",
"Matrix ID": "Matrix ID",
"Matrix Room ID": "Matrix Room ID",
"email address": "email address",
@@ -2009,7 +2053,6 @@
"You can change this later if needed.": "You can change this later if needed.",
"What's the name of your community or team?": "What's the name of your community or team?",
"Enter name": "Enter name",
- "Create": "Create",
"Add image (optional)": "Add image (optional)",
"An image will help people identify your community.": "An image will help people identify your community.",
"Community IDs cannot be empty.": "Community IDs cannot be empty.",
@@ -2031,7 +2074,6 @@
"Create a public room": "Create a public room",
"Create a private room": "Create a private room",
"Create a room in %(communityName)s": "Create a room in %(communityName)s",
- "Name": "Name",
"Topic (optional)": "Topic (optional)",
"Make this room public": "Make this room public",
"Block anyone not part of %(serverName)s from ever joining this room.": "Block anyone not part of %(serverName)s from ever joining this room.",
@@ -2131,6 +2173,8 @@
"Go": "Go",
"Invite someone using their name, email address, username (like
) or
share this room.": "Invite someone using their name, email address, username (like
) or
share this room.",
"Invite someone using their name, username (like
) or
share this room.": "Invite someone using their name, username (like
) or
share this room.",
+ "Invite someone using their name, email address, username (like
) or
share this space.": "Invite someone using their name, email address, username (like
) or
share this space.",
+ "Invite someone using their name, username (like
) or
share this space.": "Invite someone using their name, username (like
) or
share this space.",
"Transfer": "Transfer",
"a new master key signature": "a new master key signature",
"a new cross-signing key signature": "a new cross-signing key signature",
@@ -2240,6 +2284,14 @@
"Link to selected message": "Link to selected message",
"Copy": "Copy",
"Command Help": "Command Help",
+ "Failed to save space settings.": "Failed to save space settings.",
+ "Space settings": "Space settings",
+ "Edit settings relating to your space.": "Edit settings relating to your space.",
+ "Make this space private": "Make this space private",
+ "Leave Space": "Leave Space",
+ "View dev tools": "View dev tools",
+ "Saving...": "Saving...",
+ "Save Changes": "Save Changes",
"To help us prevent this in future, please
send us logs.": "To help us prevent this in future, please
send us logs.",
"Missing session data": "Missing session data",
"Some session data, including encrypted message keys, is missing. Sign out and sign in to fix this, restoring keys from backup.": "Some session data, including encrypted message keys, is missing. Sign out and sign in to fix this, restoring keys from backup.",
@@ -2434,7 +2486,6 @@
"Your community hasn't got a Long Description, a HTML page to show to community members.
Click here to open settings and give it one!": "Your community hasn't got a Long Description, a HTML page to show to community members.
Click here to open settings and give it one!",
"Long Description (HTML)": "Long Description (HTML)",
"Upload avatar": "Upload avatar",
- "Description": "Description",
"Community %(groupId)s not found": "Community %(groupId)s not found",
"This homeserver does not support communities": "This homeserver does not support communities",
"Failed to load %(groupId)s": "Failed to load %(groupId)s",
@@ -2448,11 +2499,12 @@
"Explore Public Rooms": "Explore Public Rooms",
"Create a Group Chat": "Create a Group Chat",
"Upgrade to %(hostSignupBrand)s": "Upgrade to %(hostSignupBrand)s",
- "Explore rooms": "Explore rooms",
"Failed to reject invitation": "Failed to reject invitation",
"Cannot create rooms in this community": "Cannot create rooms in this community",
"You do not have permission to create rooms in this community.": "You do not have permission to create rooms in this community.",
+ "This space is not public. You will not be able to rejoin without an invite.": "This space is not public. You will not be able to rejoin without an invite.",
"This room is not public. You will not be able to rejoin without an invite.": "This room is not public. You will not be able to rejoin without an invite.",
+ "Are you sure you want to leave the space '%(spaceName)s'?": "Are you sure you want to leave the space '%(spaceName)s'?",
"Are you sure you want to leave the room '%(roomName)s'?": "Are you sure you want to leave the room '%(roomName)s'?",
"Failed to forget room %(errCode)s": "Failed to forget room %(errCode)s",
"Signed Out": "Signed Out",
@@ -2516,6 +2568,49 @@
"Failed to reject invite": "Failed to reject invite",
"You have %(count)s unread notifications in a prior version of this room.|other": "You have %(count)s unread notifications in a prior version of this room.",
"You have %(count)s unread notifications in a prior version of this room.|one": "You have %(count)s unread notification in a prior version of this room.",
+ "Unnamed Space": "Unnamed Space",
+ "Undo": "Undo",
+ "Remove from Space": "Remove from Space",
+ "No permissions": "No permissions",
+ "You're in this space": "You're in this space",
+ "You're in this room": "You're in this room",
+ "Save changes": "Save changes",
+ "All users join by default": "All users join by default",
+ "Manage rooms": "Manage rooms",
+ "Find a room...": "Find a room...",
+ "Accept Invite": "Accept Invite",
+ "Add existing rooms & spaces": "Add existing rooms & spaces",
+ "Default Rooms": "Default Rooms",
+ "Your server does not support showing space hierarchies.": "Your server does not support showing space hierarchies.",
+ "%(count)s members|other": "%(count)s members",
+ "
invited you to
": "
invited you to
",
+ "You have been invited to
": "You have been invited to
",
+ "Your public space
": "Your public space
",
+ "Your private space
": "Your private space
",
+ "Welcome to
": "Welcome to
",
+ "#general": "#general",
+ "#random": "#random",
+ "#support": "#support",
+ "Room name": "Room name",
+ "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",
+ "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",
+ "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...",
+ "What discussions do you want to have?": "What discussions do you want to have?",
+ "We'll create rooms for each topic.": "We'll create rooms for each topic.",
+ "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.",
"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",
@@ -2534,6 +2629,7 @@
"Switch to dark mode": "Switch to dark mode",
"Switch theme": "Switch theme",
"User menu": "User menu",
+ "Space and user menu": "Space and user menu",
"Community and user menu": "Community and user menu",
"Could not load user profile": "Could not load user profile",
"Verify this login": "Verify this login",