diff --git a/data/ui.yml b/data/ui.yml index e55ab6bc8e..a04647209b 100644 --- a/data/ui.yml +++ b/data/ui.yml @@ -132,6 +132,7 @@ rest: additionalPermissions: Additional permissions uat: UAT iat: IAT + screen_reader_text_checkmark_icon: Multiple permissions are required, or a different permission may be used. For more information about the permissions, see the documentation for this endpoint. rest_reference: in: In description: Description @@ -147,9 +148,9 @@ rest_reference: code_samples: Code samples for "{{ RESTOperationTitle }}" preview_notice: Preview notice for "{{ RESTOperationTitle }}" preview_notices: Preview notices for "{{ RESTOperationTitle }}" + fine_grained_access: Fine-grained access tokens for "{{ RESTOperationTitle }}" preview_header_is_required: This header is required preview_notice_to_change: This API is under preview and subject to change - works_with: Works with api_reference: REST API reference enum_description_title: Can be one of required: Required @@ -167,6 +168,16 @@ rest_reference: button_text: copy_to_clipboard: Copy to clipboard copied: Copied! + works_with_tokens: 'This endpoint works with the following token types' + permission_sets: 'The token must have at least one of the following permission sets' + permission_set: 'The token must have the following permission set' + no_permission_sets: 'The token does not require any permissions.' + allows_public_read_access: This endpoint can be used without authentication or the aforementioned permissions if only public resources are requested. + allows_public_read_access_no_permissions: This endpoint can be used without authentication if only public resources are requested. + user_access_token_name: GitHub App user access tokens + installation_access_token_name: GitHub App installation access tokens + fine_grained_access_token_name: Fine-grained personal access tokens + no_fine_grained_access: This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens. webhooks: action_type_switch_error: There was an error switching webhook action types. action_type: Action type diff --git a/src/fixtures/fixtures/data/ui.yml b/src/fixtures/fixtures/data/ui.yml index e55ab6bc8e..a04647209b 100644 --- a/src/fixtures/fixtures/data/ui.yml +++ b/src/fixtures/fixtures/data/ui.yml @@ -132,6 +132,7 @@ rest: additionalPermissions: Additional permissions uat: UAT iat: IAT + screen_reader_text_checkmark_icon: Multiple permissions are required, or a different permission may be used. For more information about the permissions, see the documentation for this endpoint. rest_reference: in: In description: Description @@ -147,9 +148,9 @@ rest_reference: code_samples: Code samples for "{{ RESTOperationTitle }}" preview_notice: Preview notice for "{{ RESTOperationTitle }}" preview_notices: Preview notices for "{{ RESTOperationTitle }}" + fine_grained_access: Fine-grained access tokens for "{{ RESTOperationTitle }}" preview_header_is_required: This header is required preview_notice_to_change: This API is under preview and subject to change - works_with: Works with api_reference: REST API reference enum_description_title: Can be one of required: Required @@ -167,6 +168,16 @@ rest_reference: button_text: copy_to_clipboard: Copy to clipboard copied: Copied! + works_with_tokens: 'This endpoint works with the following token types' + permission_sets: 'The token must have at least one of the following permission sets' + permission_set: 'The token must have the following permission set' + no_permission_sets: 'The token does not require any permissions.' + allows_public_read_access: This endpoint can be used without authentication or the aforementioned permissions if only public resources are requested. + allows_public_read_access_no_permissions: This endpoint can be used without authentication if only public resources are requested. + user_access_token_name: GitHub App user access tokens + installation_access_token_name: GitHub App installation access tokens + fine_grained_access_token_name: Fine-grained personal access tokens + no_fine_grained_access: This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens. webhooks: action_type_switch_error: There was an error switching webhook action types. action_type: Action type diff --git a/src/github-apps/components/PermissionsList.tsx b/src/github-apps/components/PermissionsList.tsx index 286f679d9f..f572c5ff03 100644 --- a/src/github-apps/components/PermissionsList.tsx +++ b/src/github-apps/components/PermissionsList.tsx @@ -1,6 +1,7 @@ import { useRouter } from 'next/router' import cx from 'classnames' import { slug as githubSlug } from 'github-slugger' +import { CheckIcon, XIcon } from '@primer/octicons-react' import { HeadingLink } from 'src/frame/components/article/HeadingLink' import { useTranslation } from 'src/languages/components/useTranslation' @@ -107,9 +108,6 @@ export function PermissionsList({ ) : null - const additionalPermissions = operation['additional-permissions'].map( - (permission) => items[permission].displayTitle, - ) const permissionsClass = operation['additional-permissions'].length ? '' : 'text-center' @@ -129,18 +127,16 @@ export function PermissionsList({ ) : null} - {operation['additional-permissions'].length - ? additionalPermissions.map((permission, index) => { - return ( -
- {permission} - {additionalPermissions.length - 1 !== index ? ( - , - ) : null} -
- ) - }) - : '✖️'} + {operation['additional-permissions'] ? ( + +