mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-11 18:20:27 +09:00
Merge pull request #626 from anyproto/feature/space-limits
Feature/Space limits
This commit is contained in:
commit
d14905657f
7 changed files with 19 additions and 4 deletions
|
@ -257,6 +257,8 @@
|
|||
"spaceAccountStatus",
|
||||
"spaceLocalStatus",
|
||||
"spaceAccessType",
|
||||
"readersLimit",
|
||||
"writersLimit",
|
||||
"targetSpaceId",
|
||||
"creator",
|
||||
"createdDate"
|
||||
|
|
|
@ -146,6 +146,8 @@
|
|||
"pluralBacklinks": "backlink|backlinks",
|
||||
"pluralMember": "member|members",
|
||||
"pluralRequest": "request|requests",
|
||||
"pluralReader": "reader|readers",
|
||||
"pluralWriter": "writers|writers",
|
||||
|
||||
"electronAboutVersion": "Version:",
|
||||
"electronAboutDescription": "Anytype is a next generation software that breaks down barriers between applications, gives back privacy and data ownership to users.",
|
||||
|
@ -761,7 +763,7 @@
|
|||
"popupSettingsSpaceShareTitle": "Sharing",
|
||||
"popupSettingsSpaceShareInviteLinkTitle": "Invite link",
|
||||
"popupSettingsSpaceShareInviteLinkLabel": "Share this link to invite others to your Space. Once they request to join, you can set their access rights.",
|
||||
"popupSettingsSpaceShareInvitesLimit": "You can add up to %s %s",
|
||||
"popupSettingsSpaceShareInvitesLimit": "You can add up to %s %s and up to %s %s",
|
||||
|
||||
"popupSettingsSpaceShareMembersTitle": "Members",
|
||||
"popupSettingsSpaceShareJoinRequest": "Join Request",
|
||||
|
|
|
@ -7,6 +7,10 @@
|
|||
.icon.remove:hover .inner { background-color: var(--color-text-tertiary); }
|
||||
}
|
||||
|
||||
.widget.widgetSpace {
|
||||
.cnt { background-color: var(--color-shape-secondary); color: var(--color-text-primary); }
|
||||
}
|
||||
|
||||
.widget.widgetTree {
|
||||
.icon.set { background-image: url('#{$themePath}/icon/sidebar/set.svg'); }
|
||||
.icon.collection { background-image: url('#{$themePath}/icon/sidebar/collection.svg'); }
|
||||
|
|
|
@ -215,7 +215,7 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R
|
|||
onCreate(message.objectId);
|
||||
};
|
||||
|
||||
analytics.event('CreateSpace', { usecase, middleTime: message.middleTime });
|
||||
analytics.event('CreateSpace', { usecase, middleTime: message.middleTime, route: 'Navigation' });
|
||||
analytics.event('SelectUsecase', { type: usecase });
|
||||
});
|
||||
};
|
||||
|
|
|
@ -57,6 +57,7 @@ const PopupSettingsSpaceShare = observer(class PopupSettingsSpaceShare extends R
|
|||
|
||||
const hasLink = cid && key;
|
||||
const space = UtilSpace.getSpaceview();
|
||||
const { readersLimit, writersLimit } = space;
|
||||
const isShared = space.spaceAccessType == I.SpaceType.Shared;
|
||||
const participant = UtilSpace.getParticipant();
|
||||
const members = this.getMembers();
|
||||
|
@ -64,6 +65,9 @@ const PopupSettingsSpaceShare = observer(class PopupSettingsSpaceShare extends R
|
|||
const length = members.length;
|
||||
const isShareActive = UtilSpace.isShareActive();
|
||||
|
||||
const readersLimitText = UtilCommon.plural(readersLimit, translate('pluralReader'));
|
||||
const writersLimitText = UtilCommon.plural(writersLimit, translate('pluralWriter'));
|
||||
|
||||
const Member = (item: any) => {
|
||||
const isActive = item.id == participant.id;
|
||||
const isOwner = item.permissions == I.ParticipantPermissions.Owner;
|
||||
|
@ -174,7 +178,7 @@ const PopupSettingsSpaceShare = observer(class PopupSettingsSpaceShare extends R
|
|||
</div>
|
||||
|
||||
<div className="invitesLimit">
|
||||
{UtilCommon.sprintf(translate('popupSettingsSpaceShareInvitesLimit'), MEMBER_LIMIT, UtilCommon.plural(MEMBER_LIMIT, translate('pluralMember')))}
|
||||
{UtilCommon.sprintf(translate('popupSettingsSpaceShareInvitesLimit'), readersLimit, readersLimitText, writersLimit, writersLimitText)}
|
||||
</div>
|
||||
</React.Fragment>
|
||||
) : (
|
||||
|
|
|
@ -155,6 +155,8 @@ class PopupUsecasePageItem extends React.Component<I.PopupUsecase, State> {
|
|||
C.WorkspaceCreate({ name: object.title, iconOption: UtilCommon.rand(1, Constant.iconCnt) }, I.Usecase.None, (message: any) => {
|
||||
if (!message.error.code) {
|
||||
cb(message.objectId, true);
|
||||
|
||||
analytics.event('CreateSpace', { middleTime: message.middleTime, route: 'Gallery' });
|
||||
} else {
|
||||
this.setState({ isLoading: false, error: message.error.description });
|
||||
};
|
||||
|
|
|
@ -302,10 +302,11 @@ class DetailStore {
|
|||
object.spaceAccessType = Number(object.spaceAccessType) || I.SpaceType.Private;
|
||||
object.spaceAccountStatus = Number(object.spaceAccountStatus) || I.SpaceStatus.Unknown;
|
||||
object.spaceLocalStatus = Number(object.spaceLocalStatus) || I.SpaceStatus.Unknown;
|
||||
object.readersLimit = Number(object.readersLimit) || 0;
|
||||
object.writersLimit = Number(object.writersLimit) || 0;
|
||||
object.spaceId = Relation.getStringValue(object.spaceId);
|
||||
object.spaceDashboardId = Relation.getStringValue(object.spaceDashboardId);
|
||||
object.targetSpaceId = Relation.getStringValue(object.targetSpaceId);
|
||||
|
||||
return object;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue