Show parents of spaces in Add to Space menu
This commit is contained in:
parent
7db9a33b29
commit
3f244f441f
4 changed files with 31 additions and 6 deletions
|
|
@ -3959,5 +3959,6 @@
|
|||
"onlyAdminDescription": "Since there are no other admins, all other participants will also be removed.",
|
||||
"tooltipInstructionsTitle": "Not sure what that does?",
|
||||
"tooltipInstructionsMobileBody": "Press and hold items to view tooltips.",
|
||||
"tooltipInstructionsBrowserBody": "Hover over items to view tooltips."
|
||||
"tooltipInstructionsBrowserBody": "Hover over items to view tooltips.",
|
||||
"addSpaceToSpaceDescription": "Select a space to add as a parent"
|
||||
}
|
||||
|
|
@ -16,7 +16,6 @@ import 'package:fluffychat/pangea/utils/error_handler.dart';
|
|||
import 'package:fluffychat/pangea/utils/firebase_analytics.dart';
|
||||
import 'package:fluffychat/pangea/widgets/subscription/subscription_snackbar.dart';
|
||||
import 'package:fluffychat/utils/localized_exception_extension.dart';
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import 'package:fluffychat/utils/tor_stub.dart'
|
||||
if (dart.library.html) 'package:tor_detector_web/tor_detector_web.dart';
|
||||
|
|
@ -801,7 +800,10 @@ class ChatListController extends State<ChatList>
|
|||
final selectedSpace = await showConfirmationDialog<String>(
|
||||
context: context,
|
||||
title: L10n.of(context)!.addToSpace,
|
||||
message: L10n.of(context)!.addToSpaceDescription,
|
||||
// #Pangea
|
||||
// message: L10n.of(context)!.addToSpaceDescription,
|
||||
message: L10n.of(context)!.addSpaceToSpaceDescription,
|
||||
// Pangea#
|
||||
fullyCapitalizedForMaterial: false,
|
||||
actions: Matrix.of(context)
|
||||
.client
|
||||
|
|
@ -820,8 +822,11 @@ class ChatListController extends State<ChatList>
|
|||
.map(
|
||||
(space) => AlertDialogAction(
|
||||
key: space.id,
|
||||
label: space
|
||||
.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!)),
|
||||
// #Pangea
|
||||
// label: space
|
||||
// .getLocalizedDisplayname(MatrixLocals(L10n.of(context)!)),
|
||||
label: space.nameIncludingParents(context),
|
||||
// Pangea#
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
|
|
|
|||
|
|
@ -145,4 +145,20 @@ extension ChildrenAndParentsRoomExtension on Room {
|
|||
),
|
||||
)
|
||||
.toList();
|
||||
|
||||
String _nameIncludingParents(BuildContext context) {
|
||||
String nameSoFar = getLocalizedDisplayname(MatrixLocals(L10n.of(context)!));
|
||||
Room currentRoom = this;
|
||||
var i = 0;
|
||||
while (i < 2) {
|
||||
if (currentRoom.immediateClassParents.isEmpty) {
|
||||
return nameSoFar;
|
||||
}
|
||||
currentRoom = currentRoom.immediateClassParents.first;
|
||||
nameSoFar =
|
||||
'${currentRoom.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!))} > $nameSoFar';
|
||||
i++;
|
||||
}
|
||||
return nameSoFar;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import 'package:fluffychat/pangea/models/class_model.dart';
|
|||
import 'package:fluffychat/pangea/models/tokens_event_content_model.dart';
|
||||
import 'package:fluffychat/pangea/utils/bot_name.dart';
|
||||
import 'package:fluffychat/pangea/utils/error_handler.dart';
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
@ -89,7 +90,6 @@ extension PangeaRoom on Room {
|
|||
Future<void> inviteTeachersToAnalyticsRoom() async =>
|
||||
await _inviteTeachersToAnalyticsRoom();
|
||||
|
||||
// Invite teachers of 1 space to all users' analytics rooms
|
||||
Future<void> inviteSpaceTeachersToAnalyticsRooms() async =>
|
||||
await _inviteSpaceTeachersToAnalyticsRooms();
|
||||
|
||||
|
|
@ -116,6 +116,9 @@ extension PangeaRoom on Room {
|
|||
|
||||
List<Room> get pangeaSpaceParents => _pangeaSpaceParents;
|
||||
|
||||
String nameIncludingParents(BuildContext context) =>
|
||||
_nameIncludingParents(context);
|
||||
|
||||
// class_and_exchange_settings
|
||||
|
||||
DateTime? get rulesUpdatedAt => _rulesUpdatedAt;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue