refactor: update team nomenclature (#3880)

Co-authored-by: jamesgeorge007 <jamesgeorge998001@gmail.com>
This commit is contained in:
Nivedin
2024-03-08 23:54:32 +05:30
committed by GitHub
parent e69d5a6253
commit 07e8af7947
5 changed files with 91 additions and 71 deletions

View File

@@ -154,7 +154,7 @@
"invalid_name": "Please provide a name for the collection", "invalid_name": "Please provide a name for the collection",
"invalid_root_move": "Collection already in the root", "invalid_root_move": "Collection already in the root",
"moved": "Moved Successfully", "moved": "Moved Successfully",
"my_collections": "My Collections", "my_collections": "Personal Collections",
"name": "My New Collection", "name": "My New Collection",
"name_length_insufficient": "Collection name should be at least 3 characters long", "name_length_insufficient": "Collection name should be at least 3 characters long",
"new": "New Collection", "new": "New Collection",
@@ -166,14 +166,12 @@
"save_as": "Save as", "save_as": "Save as",
"save_to_collection": "Save to Collection", "save_to_collection": "Save to Collection",
"select": "Select a Collection", "select": "Select a Collection",
"select_location": "Select location", "select_location": "Select location"
"select_team": "Select a team",
"team_collections": "Team Collections"
}, },
"confirm": { "confirm": {
"close_unsaved_tab": "Are you sure you want to close this tab?", "close_unsaved_tab": "Are you sure you want to close this tab?",
"close_unsaved_tabs": "Are you sure you want to close all tabs? {count} unsaved tabs will be lost.", "close_unsaved_tabs": "Are you sure you want to close all tabs? {count} unsaved tabs will be lost.",
"exit_team": "Are you sure you want to leave this team?", "exit_team": "Are you sure you want to leave this workspace?",
"logout": "Are you sure you want to logout?", "logout": "Are you sure you want to logout?",
"remove_collection": "Are you sure you want to permanently delete this collection?", "remove_collection": "Are you sure you want to permanently delete this collection?",
"remove_environment": "Are you sure you want to permanently delete this environment?", "remove_environment": "Are you sure you want to permanently delete this environment?",
@@ -181,7 +179,7 @@
"remove_history": "Are you sure you want to permanently delete all history?", "remove_history": "Are you sure you want to permanently delete all history?",
"remove_request": "Are you sure you want to permanently delete this request?", "remove_request": "Are you sure you want to permanently delete this request?",
"remove_shared_request": "Are you sure you want to permanently delete this shared request?", "remove_shared_request": "Are you sure you want to permanently delete this shared request?",
"remove_team": "Are you sure you want to delete this team?", "remove_team": "Are you sure you want to delete this workspace?",
"remove_telemetry": "Are you sure you want to opt-out of Telemetry?", "remove_telemetry": "Are you sure you want to opt-out of Telemetry?",
"request_change": "Are you sure you want to discard current request, unsaved changes will be lost.", "request_change": "Are you sure you want to discard current request, unsaved changes will be lost.",
"save_unsaved_tab": "Do you want to save changes made in this tab?", "save_unsaved_tab": "Do you want to save changes made in this tab?",
@@ -234,9 +232,9 @@
"headers": "This request does not have any headers", "headers": "This request does not have any headers",
"history": "History is empty", "history": "History is empty",
"invites": "Invite list is empty", "invites": "Invite list is empty",
"members": "Team is empty", "members": "Workspace is empty",
"parameters": "This request does not have any parameters", "parameters": "This request does not have any parameters",
"pending_invites": "There are no pending invites for this team", "pending_invites": "There are no pending invites for this workspace",
"profile": "Login to view your profile", "profile": "Login to view your profile",
"protocols": "Protocols are empty", "protocols": "Protocols are empty",
"request_variables": "This request does not have any request variables", "request_variables": "This request does not have any request variables",
@@ -245,8 +243,8 @@
"shared_requests": "Shared requests are empty", "shared_requests": "Shared requests are empty",
"shared_requests_logout": "Login to view your shared requests or create a new one", "shared_requests_logout": "Login to view your shared requests or create a new one",
"subscription": "Subscriptions are empty", "subscription": "Subscriptions are empty",
"team_name": "Team name empty", "team_name": "Workspace name empty",
"teams": "You don't belong to any teams", "teams": "You don't belong to any workspaces",
"tests": "There are no tests for this request" "tests": "There are no tests for this request"
}, },
"environment": { "environment": {
@@ -263,7 +261,7 @@
"import_or_create": "Import or create a environment", "import_or_create": "Import or create a environment",
"invalid_name": "Please provide a name for the environment", "invalid_name": "Please provide a name for the environment",
"list": "Environment variables", "list": "Environment variables",
"my_environments": "My Environments", "my_environments": "Personal Environments",
"name": "Name", "name": "Name",
"nested_overflow": "nested environment variables are limited to 10 levels", "nested_overflow": "nested environment variables are limited to 10 levels",
"new": "New Environment", "new": "New Environment",
@@ -278,7 +276,7 @@
"select": "Select environment", "select": "Select environment",
"set": "Set environment", "set": "Set environment",
"set_as_environment": "Set as environment", "set_as_environment": "Set as environment",
"team_environments": "Team Environments", "team_environments": "Workspace Environments",
"title": "Environments", "title": "Environments",
"updated": "Environment updated", "updated": "Environment updated",
"value": "Value", "value": "Value",
@@ -293,8 +291,8 @@
"check_how_to_add_origin": "Check how you can add an origin", "check_how_to_add_origin": "Check how you can add an origin",
"curl_invalid_format": "cURL is not formatted properly", "curl_invalid_format": "cURL is not formatted properly",
"danger_zone": "Danger zone", "danger_zone": "Danger zone",
"delete_account": "Your account is currently an owner in these teams:", "delete_account": "Your account is currently an owner in these workspaces:",
"delete_account_description": "You must either remove yourself, transfer ownership, or delete these teams before you can delete your account.", "delete_account_description": "You must either remove yourself, transfer ownership, or delete these workspaces before you can delete your account.",
"empty_req_name": "Empty Request Name", "empty_req_name": "Empty Request Name",
"f12_details": "(F12 for details)", "f12_details": "(F12 for details)",
"gql_prettify_invalid_query": "Couldn't prettify an invalid query, solve query syntax errors and try again", "gql_prettify_invalid_query": "Couldn't prettify an invalid query, solve query syntax errors and try again",
@@ -396,8 +394,8 @@
"from_insomnia_description": "Import from Insomnia collection", "from_insomnia_description": "Import from Insomnia collection",
"from_json": "Import from Hoppscotch", "from_json": "Import from Hoppscotch",
"from_json_description": "Import from Hoppscotch collection file", "from_json_description": "Import from Hoppscotch collection file",
"from_my_collections": "Import from My Collections", "from_my_collections": "Import from Personal Collections",
"from_my_collections_description": "Import from My Collections file", "from_my_collections_description": "Import from Personal Collections file",
"from_openapi": "Import from OpenAPI", "from_openapi": "Import from OpenAPI",
"from_openapi_description": "Import from OpenAPI specification file (YML/JSON)", "from_openapi_description": "Import from OpenAPI specification file (YML/JSON)",
"from_postman": "Import from Postman", "from_postman": "Import from Postman",
@@ -514,7 +512,7 @@
"email_verification_mail": "A verification email has been sent to your email address. Please click on the link to verify your email address.", "email_verification_mail": "A verification email has been sent to your email address. Please click on the link to verify your email address.",
"no_permission": "You do not have permission to perform this action.", "no_permission": "You do not have permission to perform this action.",
"owner": "Owner", "owner": "Owner",
"owner_description": "Owners can add, edit, and delete requests, collections and team members.", "owner_description": "Owners can add, edit, and delete requests, collections and workspace members.",
"roles": "Roles", "roles": "Roles",
"roles_description": "Roles are used to control access to the shared collections.", "roles_description": "Roles are used to control access to the shared collections.",
"updated": "Profile updated", "updated": "Profile updated",
@@ -819,12 +817,12 @@
"title": "Tabs" "title": "Tabs"
}, },
"workspace": { "workspace": {
"delete": "Delete current team", "delete": "Delete current workspace",
"edit": "Edit current team", "edit": "Edit current workspace",
"invite": "Invite people to team", "invite": "Invite people to workspace",
"new": "Create new team", "new": "Create new workspace",
"switch_to_personal": "Switch to your personal workspace", "switch_to_personal": "Switch to your personal workspace",
"title": "Teams" "title": "Workspaces"
} }
}, },
"sse": { "sse": {
@@ -881,7 +879,6 @@
"forum": "Ask questions and get answers", "forum": "Ask questions and get answers",
"github": "Follow us on Github", "github": "Follow us on Github",
"shortcuts": "Browse app faster", "shortcuts": "Browse app faster",
"team": "Get in touch with the team",
"title": "Support", "title": "Support",
"twitter": "Follow us on Twitter" "twitter": "Follow us on Twitter"
}, },
@@ -912,60 +909,59 @@
"websocket": "WebSocket" "websocket": "WebSocket"
}, },
"team": { "team": {
"already_member": "You are already a member of this team. Contact your team owner.", "already_member": "You are already a member of this workspace. Contact your workspace owner.",
"create_new": "Create new team", "create_new": "Create new workspace",
"deleted": "Team deleted", "deleted": "Workspace deleted",
"edit": "Edit Team", "edit": "Edit Workspace",
"email": "E-mail", "email": "E-mail",
"email_do_not_match": "Email doesn't match with your account details. Contact your team owner.", "email_do_not_match": "Email doesn't match with your account details. Contact your workspace owner.",
"exit": "Exit Team", "exit": "Exit Workspace",
"exit_disabled": "Only owner cannot exit the team", "exit_disabled": "Only owner cannot exit the workspace",
"failed_invites": "Failed invites", "failed_invites": "Failed invites",
"invalid_coll_id": "Invalid collection ID", "invalid_coll_id": "Invalid collection ID",
"invalid_email_format": "Email format is invalid", "invalid_email_format": "Email format is invalid",
"invalid_id": "Invalid team ID. Contact your team owner.", "invalid_id": "Invalid workspace ID. Contact your workspace owner.",
"invalid_invite_link": "Invalid invite link", "invalid_invite_link": "Invalid invite link",
"invalid_invite_link_description": "The link you followed is invalid. Contact your team owner.", "invalid_invite_link_description": "The link you followed is invalid. Contact your workspace owner.",
"invalid_member_permission": "Please provide a valid permission to the team member", "invalid_member_permission": "Please provide a valid permission to the workspace member",
"invite": "Invite", "invite": "Invite",
"invite_more": "Invite more", "invite_more": "Invite more",
"invite_tooltip": "Invite people to this workspace", "invite_tooltip": "Invite people to this workspace",
"invited_to_team": "{owner} invited you to join {team}", "invited_to_team": "{owner} invited you to join {workspace}",
"join": "Invitation accepted", "join": "Invitation accepted",
"join_beta": "Join the beta program to access teams.", "join_team": "Join {workspace}",
"join_team": "Join {team}", "joined_team": "You have joined {workspace}",
"joined_team": "You have joined {team}", "joined_team_description": "You are now a member of this workspace",
"joined_team_description": "You are now a member of this team", "left": "You left the workspace",
"left": "You left the team",
"login_to_continue": "Login to continue", "login_to_continue": "Login to continue",
"login_to_continue_description": "You need to be logged in to join a team.", "login_to_continue_description": "You need to be logged in to join a workspace.",
"logout_and_try_again": "Logout and sign in with another account", "logout_and_try_again": "Logout and sign in with another account",
"member_has_invite": "This email ID already has an invite. Contact your team owner.", "member_has_invite": "This email ID already has an invite. Contact your workspace owner.",
"member_not_found": "Member not found. Contact your team owner.", "member_not_found": "Member not found. Contact your workspace owner.",
"member_removed": "User removed", "member_removed": "User removed",
"member_role_updated": "User roles updated", "member_role_updated": "User roles updated",
"members": "Members", "members": "Members",
"more_members": "+{count} more", "more_members": "+{count} more",
"name_length_insufficient": "Team name should be at least 6 characters long", "name_length_insufficient": "Workspace name should be at least 6 characters long",
"name_updated": "Team name updated", "name_updated": "Workspace name updated",
"new": "New Team", "new": "New Workspace",
"new_created": "New team created", "new_created": "New workspace created",
"new_name": "My New Team", "new_name": "My New Workspace",
"no_access": "You do not have edit access to this team", "no_access": "You do not have edit access to this workspace",
"no_invite_found": "Invitation not found. Contact your team owner.", "no_invite_found": "Invitation not found. Contact your workspace owner.",
"no_request_found": "Request not found.", "no_request_found": "Request not found.",
"not_found": "Team not found. Contact your team owner.", "not_found": "Workspace not found. Contact your workspace owner.",
"not_valid_viewer": "You are not a valid viewer. Contact your team owner.", "not_valid_viewer": "You are not a valid viewer. Contact your workspace owner.",
"parent_coll_move": "Cannot move collection to a child collection", "parent_coll_move": "Cannot move collection to a child collection",
"pending_invites": "Pending invites", "pending_invites": "Pending invites",
"permissions": "Permissions", "permissions": "Permissions",
"same_target_destination": "Same target and destination", "same_target_destination": "Same target and destination",
"saved": "Team saved", "saved": "Workspace saved",
"select_a_team": "Select a team", "select_a_team": "Select a workspace",
"success_invites": "Success invites", "success_invites": "Success invites",
"title": "Teams", "title": "Workspaces",
"we_sent_invite_link": "We sent an invite link to all invitees!", "we_sent_invite_link": "We sent an invite link to all invitees!",
"we_sent_invite_link_description": "Ask all invitees to check their inbox. Click on the link to join the team." "we_sent_invite_link_description": "Ask all invitees to check their inbox. Click on the link to join the workspace."
}, },
"team_environment": { "team_environment": {
"deleted": "Environment Deleted", "deleted": "Environment Deleted",
@@ -991,8 +987,10 @@
}, },
"workspace": { "workspace": {
"change": "Change workspace", "change": "Change workspace",
"personal": "My Workspace", "personal": "Personal Workspace",
"team": "Team Workspace", "personal_workspace": "{name}'s Workspace",
"other_workspaces": "My Workspaces",
"team": "Workspace",
"title": "Workspaces" "title": "Workspaces"
}, },
"site_protection": { "site_protection": {

View File

@@ -330,11 +330,16 @@ const myTeams = useReadonlyStream(teamListAdapter.teamList$, null)
const workspace = workspaceService.currentWorkspace const workspace = workspaceService.currentWorkspace
const workspaceName = computed(() => const workspaceName = computed(() => {
workspace.value.type === "personal" if (workspace.value.type === "personal") {
? t("workspace.personal") return currentUser.value?.displayName
: workspace.value.teamName ? t("workspace.personal_workspace", {
) name: currentUser.value.displayName,
})
: t("workspace.personal")
}
return workspace.value.teamName
})
const refetchTeams = () => { const refetchTeams = () => {
teamListAdapter.fetchList() teamListAdapter.fetchList()

View File

@@ -15,6 +15,8 @@ import { computed } from "vue"
import { useI18n } from "~/composables/i18n" import { useI18n } from "~/composables/i18n"
import { useService } from "dioc/vue" import { useService } from "dioc/vue"
import { WorkspaceService } from "~/services/workspace.service" import { WorkspaceService } from "~/services/workspace.service"
import { useReadonlyStream } from "~/composables/stream"
import { platform } from "~/platform"
const props = defineProps<{ const props = defineProps<{
section?: string section?: string
@@ -26,14 +28,23 @@ const t = useI18n()
const workspaceService = useService(WorkspaceService) const workspaceService = useService(WorkspaceService)
const workspace = workspaceService.currentWorkspace const workspace = workspaceService.currentWorkspace
const currentUser = useReadonlyStream(
platform.auth.getProbableUserStream(),
platform.auth.getProbableUser()
)
const currentWorkspace = computed(() => { const currentWorkspace = computed(() => {
const personalWorkspaceName = currentUser.value?.displayName
? t("workspace.personal_workspace", { name: currentUser.value.displayName })
: t("workspace.personal")
if (props.isOnlyPersonal) { if (props.isOnlyPersonal) {
return `${t("workspace.personal")}` return personalWorkspaceName
} }
if (workspace.value.type === "team") { if (workspace.value.type === "team") {
return teamWorkspaceName.value return teamWorkspaceName.value
} }
return `${t("workspace.personal")}` return personalWorkspaceName
}) })
const teamWorkspaceName = computed(() => { const teamWorkspaceName = computed(() => {

View File

@@ -3,7 +3,7 @@
<div class="flex flex-col"> <div class="flex flex-col">
<div class="flex flex-col"> <div class="flex flex-col">
<HoppSmartItem <HoppSmartItem
label="My Workspace" :label="personalWorkspaceName"
:icon="IconUser" :icon="IconUser"
:info-icon="workspace.type === 'personal' ? IconDone : undefined" :info-icon="workspace.type === 'personal' ? IconDone : undefined"
:active-info-icon="workspace.type === 'personal'" :active-info-icon="workspace.type === 'personal'"
@@ -36,7 +36,7 @@
class="sticky top-0 z-10 mb-2 flex items-center justify-between bg-popover py-2 pl-2" class="sticky top-0 z-10 mb-2 flex items-center justify-between bg-popover py-2 pl-2"
> >
<div class="flex items-center px-2 font-semibold text-secondaryLight"> <div class="flex items-center px-2 font-semibold text-secondaryLight">
{{ t("team.title") }} {{ t("workspace.other_workspaces") }}
</div> </div>
<HoppButtonSecondary <HoppButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
@@ -96,6 +96,12 @@ const currentUser = useReadonlyStream(
platform.auth.getProbableUser() platform.auth.getProbableUser()
) )
const personalWorkspaceName = computed(() =>
currentUser.value?.displayName
? t("workspace.personal_workspace", { name: currentUser.value.displayName })
: t("workspace.personal")
)
const workspaceService = useService(WorkspaceService) const workspaceService = useService(WorkspaceService)
const teamListadapter = workspaceService.acquireTeamListAdapter(null) const teamListadapter = workspaceService.acquireTeamListAdapter(null)
const myTeams = useReadonlyStream(teamListadapter.teamList$, []) const myTeams = useReadonlyStream(teamListadapter.teamList$, [])

View File

@@ -71,7 +71,7 @@
<h1 class="heading"> <h1 class="heading">
{{ {{
t("team.join_team", { t("team.join_team", {
team: inviteDetails.data.right.teamInvitation.team.name, workspace: inviteDetails.data.right.teamInvitation.team.name,
}) })
}} }}
</h1> </h1>
@@ -81,7 +81,7 @@
owner: owner:
inviteDetails.data.right.teamInvitation.creator.displayName ?? inviteDetails.data.right.teamInvitation.creator.displayName ??
inviteDetails.data.right.teamInvitation.creator.email, inviteDetails.data.right.teamInvitation.creator.email,
team: inviteDetails.data.right.teamInvitation.team.name, workspace: inviteDetails.data.right.teamInvitation.team.name,
}) })
}} }}
</p> </p>
@@ -89,7 +89,7 @@
<HoppButtonPrimary <HoppButtonPrimary
:label=" :label="
t('team.join_team', { t('team.join_team', {
team: inviteDetails.data.right.teamInvitation.team.name, workspace: inviteDetails.data.right.teamInvitation.team.name,
}) })
" "
:loading="loading" :loading="loading"
@@ -109,14 +109,14 @@
<h1 class="heading"> <h1 class="heading">
{{ {{
t("team.joined_team", { t("team.joined_team", {
team: inviteDetails.data.right.teamInvitation.team.name, workspace: inviteDetails.data.right.teamInvitation.team.name,
}) })
}} }}
</h1> </h1>
<p class="mt-2 text-secondaryLight"> <p class="mt-2 text-secondaryLight">
{{ {{
t("team.joined_team_description", { t("team.joined_team_description", {
team: inviteDetails.data.right.teamInvitation.team.name, workspace: inviteDetails.data.right.teamInvitation.team.name,
}) })
}} }}
</p> </p>