From 09023d93e123e97d4dda2f9d14cce958d6b97740 Mon Sep 17 00:00:00 2001 From: Sophie <29382425+sophietheking@users.noreply.github.com> Date: Thu, 6 Apr 2023 23:33:05 +0200 Subject: [PATCH 1/2] [2023-04-06]: Optionally disable notifications from team mentions - [GA] (#36017) Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com> Co-authored-by: Siara <108543037+SiaraMist@users.noreply.github.com> --- .../about-teams.md | 6 ++++- .../configuring-team-notifications.md | 27 +++++++++++++++++++ .../creating-a-team.md | 1 + .../organizing-members-into-teams/index.md | 2 +- data/features/team-mentions-setting.yml | 6 +++++ .../organizations/team-notifications.md | 7 +++++ 6 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 content/organizations/organizing-members-into-teams/configuring-team-notifications.md create mode 100644 data/features/team-mentions-setting.yml create mode 100644 data/reusables/organizations/team-notifications.md diff --git a/content/organizations/organizing-members-into-teams/about-teams.md b/content/organizations/organizing-members-into-teams/about-teams.md index 281e9f378d..2c921c1074 100644 --- a/content/organizations/organizing-members-into-teams/about-teams.md +++ b/content/organizations/organizing-members-into-teams/about-teams.md @@ -16,7 +16,11 @@ topics: ## About teams -You can use teams to organize, mention, and manage access for people in an organization. Organization owners and team maintainers can give teams admin, read, or write access to organization repositories. Organization members can send a notification to an entire team by mentioning the team's name. Organization members can also send a notification to an entire team by requesting a review from that team. Organization members can request reviews from specific teams with read access to the repository where the pull request is opened. Teams can be designated as owners of certain types or areas of code in a CODEOWNERS file. +You can use teams to manage access for people in an organization, and for sending notifications. Organization owners and team maintainers can give teams admin, read, or write access to organization repositories. Organization members can send a notification to an entire team by mentioning the team's name. + +{% ifversion team-mentions-setting %}Organization owners and team maintainers can disable team notifications. For more information, see "[AUTOTITLE](/organizations/organizing-members-into-teams/configuring-team-notifications)."{% endif %} + +Organization members can also send a notification to an entire team by requesting a review from that team. Organization members can request reviews from specific teams with read access to the repository where the pull request is opened. Teams can be designated as owners of certain types or areas of code in a CODEOWNERS file. For more information, see: - "[AUTOTITLE](/organizations/managing-user-access-to-your-organizations-repositories/managing-team-access-to-an-organization-repository)" diff --git a/content/organizations/organizing-members-into-teams/configuring-team-notifications.md b/content/organizations/organizing-members-into-teams/configuring-team-notifications.md new file mode 100644 index 0000000000..918ccbbef9 --- /dev/null +++ b/content/organizations/organizing-members-into-teams/configuring-team-notifications.md @@ -0,0 +1,27 @@ +--- +title: Configuring team notifications +intro: 'Team maintainers and organization owners can configure notifications for specific teams.' +versions: + feature: team-mentions-setting +topics: + - Organizations + - Teams +--- + +Team maintainers and organization owners can enable or disable notifications for specific teams. When notifications are enabled, members of the team will receive notifications when the team is mentioned in an issue, pull request, or comment. + +Disabling team notifications won't unsubscribe people that are already subscribed to threads. + +{% note %} + +**Note:** This setting does not affect notifications for reviews requested from the team. + +{% endnote %} + +{% data reusables.profile.access_org %} +{% data reusables.user-settings.access_org %} +{% data reusables.organizations.teams %} +1. In the list of teams, click the name of the team whose parent you'd like to change. +{% data reusables.organizations.team_settings %} +{% data reusables.organizations.team-notifications %} +1. Click **Save changes**. \ No newline at end of file diff --git a/content/organizations/organizing-members-into-teams/creating-a-team.md b/content/organizations/organizing-members-into-teams/creating-a-team.md index 03efc6ed90..ad0ada9270 100644 --- a/content/organizations/organizing-members-into-teams/creating-a-team.md +++ b/content/organizations/organizing-members-into-teams/creating-a-team.md @@ -31,6 +31,7 @@ Only organization owners and maintainers of a parent team can create a new child * If your organization or enterprise account uses team synchronization, under "Identity Provider Groups", select the **Select Groups** dropdown menu, and click up to five identity provider groups to connect to the new team. For more information, see "[AUTOTITLE](/organizations/organizing-members-into-teams/synchronizing-a-team-with-an-identity-provider-group)." {% endif %} {% data reusables.organizations.team_visibility %} +{% data reusables.organizations.team-notifications %} {% data reusables.organizations.create_team %} 1. Optionally, [give the team access to organization repositories](/organizations/managing-user-access-to-your-organizations-repositories/managing-team-access-to-an-organization-repository). diff --git a/content/organizations/organizing-members-into-teams/index.md b/content/organizations/organizing-members-into-teams/index.md index ebe04edd68..a3ccb3d6a4 100644 --- a/content/organizations/organizing-members-into-teams/index.md +++ b/content/organizations/organizing-members-into-teams/index.md @@ -29,6 +29,7 @@ children: - /managing-code-review-settings-for-your-team - /renaming-a-team - /changing-team-visibility + - /configuring-team-notifications - /synchronizing-a-team-with-an-identity-provider-group - /moving-a-team-in-your-organizations-hierarchy - /requesting-to-add-a-child-team @@ -39,4 +40,3 @@ children: - /deleting-a-team shortTitle: Organize members into teams --- - diff --git a/data/features/team-mentions-setting.yml b/data/features/team-mentions-setting.yml new file mode 100644 index 0000000000..863001d599 --- /dev/null +++ b/data/features/team-mentions-setting.yml @@ -0,0 +1,6 @@ +# Reference: #9959 +# Optionally disable notifications from team mentions +versions: + fpt: '*' + ghec: '*' + ghes: '>=3.10' diff --git a/data/reusables/organizations/team-notifications.md b/data/reusables/organizations/team-notifications.md new file mode 100644 index 0000000000..ef48b78bd9 --- /dev/null +++ b/data/reusables/organizations/team-notifications.md @@ -0,0 +1,7 @@ +1. Under "Team notifications", select **Enabled** or **Disabled**. + + {% note %} + + **Note:** This setting only applies to @mentions of the team name. This setting does not affect notifications for reviews requested from the team. + + {% endnote %} From 7cb56f3fb7644c70a0dcce8484ad71639ec8dbd5 Mon Sep 17 00:00:00 2001 From: Kevin Heis Date: Thu, 6 Apr 2023 14:48:03 -0700 Subject: [PATCH 2/2] Remove two unused files (#36252) --- components/hooks/useWindowScroll.ts | 24 ------------------------ components/lib/getAnchorLink.ts | 1 - 2 files changed, 25 deletions(-) delete mode 100644 components/hooks/useWindowScroll.ts delete mode 100644 components/lib/getAnchorLink.ts diff --git a/components/hooks/useWindowScroll.ts b/components/hooks/useWindowScroll.ts deleted file mode 100644 index f0f055e5fd..0000000000 --- a/components/hooks/useWindowScroll.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { useState, useEffect } from 'react' - -// returns scroll position -export function useWindowScroll(): number { - const [scrollPosition, setScrollPosition] = useState( - typeof window !== 'undefined' ? window.scrollY : 0 - ) - - useEffect(() => { - const setScollPositionCallback = () => setScrollPosition(window.scrollY) - - if (typeof window !== 'undefined') { - window.addEventListener('scroll', setScollPositionCallback) - } - - return () => { - if (typeof window !== 'undefined') { - window.removeEventListener('scroll', setScollPositionCallback) - } - } - }, []) - - return scrollPosition -} diff --git a/components/lib/getAnchorLink.ts b/components/lib/getAnchorLink.ts deleted file mode 100644 index 8f46044d65..0000000000 --- a/components/lib/getAnchorLink.ts +++ /dev/null @@ -1 +0,0 @@ -export const getAnchorLink = (title: string) => title.toLowerCase().replace(/\s/g, '-')