From 62e4d049eebf03a5fc396f604d88ebdedc5eae82 Mon Sep 17 00:00:00 2001 From: Elinor Date: Mon, 5 Feb 2024 16:22:12 +0300 Subject: [PATCH] Chore: Release 9.5.0 (#2994) * Chore: Update to 9.4.0 (#2959) * Fix: Remove lazy loading on feedback button (#2963) * Fix: Ignore aria rule on Sample Queries component (#2962) * Chore: change workflow permissions (#2966) * Bump version to 9.5.0 --------- Co-authored-by: Charles Wahome Co-authored-by: github-actions --- .github/workflows/combine-prs.yml | 118 ------------------ .github/workflows/cut-release.yml | 23 +--- .github/workflows/linter.yml | 4 + .github/workflows/projectbot.yml | 5 + package-lock.json | 4 +- package.json | 2 +- src/app/views/app-sections/FeedbackButton.tsx | 66 ---------- src/app/views/main-header/FeedbackButton.tsx | 118 +++++++----------- src/tests/accessibility/accessibility.spec.ts | 3 +- 9 files changed, 64 insertions(+), 279 deletions(-) delete mode 100644 .github/workflows/combine-prs.yml delete mode 100644 src/app/views/app-sections/FeedbackButton.tsx diff --git a/.github/workflows/combine-prs.yml b/.github/workflows/combine-prs.yml deleted file mode 100644 index 166f96858..000000000 --- a/.github/workflows/combine-prs.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: 'Combine PRs' - -# This workflow will merge all dependabot PRs into one branch and open a new PR against dependabot-upgrades -on: - workflow_dispatch: - inputs: - branchPrefix: - description: 'Branch prefix to find combinable PRs based on' - required: true - default: 'dependabot/' - combineBranchName: - description: 'Name of the branch to combine PRs into' - required: true - default: 'dependabot-upgrades' - -jobs: - # Update dependabot-upgrades branch so that it's in sync with dev - merge-dev-dependabot-upgrades: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set Git config - run: | - git config user.name github-actions - git config user.email github-actions@github.com - - - name: Merge dev to dependabot-upgrades - run: | - git fetch --unshallow - git pull origin - git checkout dependabot-upgrades - git merge --no-ff origin/dev --allow-unrelated-histories -m "Auto-merge dev to dependabot-upgrades" - git push - - # Get all PRs opened by dependabot - combine-prs: - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v3 - id: fetch-branch-names - name: Fetch branch names - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const pulls = await github.paginate('GET /repos/:owner/:repo/pulls', { - owner: context.repo.owner, - repo: context.repo.repo - }); - branches = []; - prs = []; - base_branch = null; - for (const pull of pulls) { - const branch = pull['head']['ref']; - console.log('Pull for branch: ' + branch); - if (branch.startsWith('${{ github.event.inputs.branchPrefix }}')) { - console.log('Branch matched: ' + branch); - console.log('Adding branch to array: ' + branch); - branches.push(branch); - prs.push('#' + pull['number'] + ' ' + pull['title']); - } - } - - if (branches.length == 0) { - core.setFailed('No PRs/branches matched criteria'); - return; - } - - core.setOutput('base-branch', 'dev'); - core.setOutput('prs-string', prs.join('\n')); - - combined = branches.join(' ') - console.log('Combined: ' + combined); - return combined - - # Checks-out the repository under $GITHUB_WORKSPACE, so this job can access it - - uses: actions/checkout@v2.3.3 - with: - fetch-depth: 0 - - # Merges all dependabot PRs into the dependabot-upgrades branch - - name: Created combined branch - env: - BRANCHES_TO_COMBINE: ${{ steps.fetch-branch-names.outputs.result }} - COMBINE_BRANCH_NAME: ${{ github.event.inputs.combineBranchName }} - run: | - echo "$BRANCHES_TO_COMBINE" - sourcebranches="${BRANCHES_TO_COMBINE%\"}" - sourcebranches="${sourcebranches#\"}" - - git config pull.rebase false - git config user.name github-actions - git config user.email github-actions@github.com - - git fetch - git pull origin - git checkout $COMBINE_BRANCH_NAME - - git pull origin $sourcebranches --no-edit - git push -f origin $COMBINE_BRANCH_NAME - - # Opens a pull request to dev from dependabot-upgrades branch - - uses: actions/github-script@v3 - name: Create Combined Pull Request - env: - PRS_STRING: ${{ steps.fetch-branch-names.outputs.prs-string }} - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const prString = process.env.PRS_STRING; - const body = 'This PR was created by the Combine PRs action by combining the following PRs:\n' + prString; - await github.pulls.create({ - owner: context.repo.owner, - repo: context.repo.repo, - title: 'Combined dependabot pull requests', - head: '${{ github.event.inputs.combineBranchName }}', - base: '${{ steps.fetch-branch-names.outputs.base-branch }}', - body: body - }); diff --git a/.github/workflows/cut-release.yml b/.github/workflows/cut-release.yml index a80bd1e2a..986ca67f2 100644 --- a/.github/workflows/cut-release.yml +++ b/.github/workflows/cut-release.yml @@ -6,6 +6,10 @@ on: description: Release type (major/minor/patch) required: true +permissions: + pull-requests: write + contents: write + jobs: cut-release: name: Creates release branch and PRs into dev/master @@ -74,22 +78,3 @@ jobs: echo "NEW_VERSION=${newVersion}" >> $GITHUB_ENV echo "::set-output name=branchName::$branchName" - - - name: Create pull request into dev - uses: repo-sync/pull-request@v2 - if: ${{ github.event.inputs.release-type == 'major' || github.event.inputs.release-type == 'minor' }} - with: - source_branch: ${{ steps.create-release.outputs.branchName }} - destination_branch: "dev" - github_token: ${{ secrets.GITHUB_TOKEN }} - pr_title: "Chore: Update to ${{ env.NEW_VERSION }}" - pr_body: ${{ env.devPrBody }} - - - name: Create pull request into master - uses: repo-sync/pull-request@v2 - with: - source_branch: ${{ steps.create-release.outputs.branchName }} - destination_branch: "master" - github_token: ${{ secrets.GITHUB_TOKEN }} - pr_title: "Chore: Release ${{ env.NEW_VERSION }}" - pr_body: ${{ env.masterPrBody }} \ No newline at end of file diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 92bc913b4..9d916999d 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -12,6 +12,10 @@ on: env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} +permissions: + contents: write + pull-requests: write + jobs: install: name: Install node modules diff --git a/.github/workflows/projectbot.yml b/.github/workflows/projectbot.yml index 58157c834..300eda311 100644 --- a/.github/workflows/projectbot.yml +++ b/.github/workflows/projectbot.yml @@ -5,6 +5,11 @@ on: issues: types: - opened + +permissions: + issues: write + repository-projects: write + jobs: track_issue: runs-on: ubuntu-latest diff --git a/package-lock.json b/package-lock.json index f889715c6..0699a1f72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "graph-explorer-v2", - "version": "9.4.0", + "version": "9.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "graph-explorer-v2", - "version": "9.4.0", + "version": "9.5.0", "dependencies": { "@augloop/types-core": "file:packages/types-core-2.16.189.tgz", "@axe-core/webdriverjs": "4.8.1", diff --git a/package.json b/package.json index ddce06090..59157319d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "graph-explorer-v2", - "version": "9.4.0", + "version": "9.5.0", "private": true, "dependencies": { "@augloop/types-core": "file:packages/types-core-2.16.189.tgz", diff --git a/src/app/views/app-sections/FeedbackButton.tsx b/src/app/views/app-sections/FeedbackButton.tsx deleted file mode 100644 index e66079a16..000000000 --- a/src/app/views/app-sections/FeedbackButton.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import { DirectionalHint, IconButton, IIconProps, TooltipHost } from '@fluentui/react'; -import { useState } from 'react'; -import { translateMessage } from '../../utils/translate-messages'; -import FeedbackForm from '../query-runner/request/feedback/FeedbackForm'; -import { ACCOUNT_TYPE } from '../../services/graph-constants'; -import { useAppSelector } from '../../../store'; - -export const FeedbackButton = () => { - const [enableSurvey, setEnableSurvey] = useState(false); - const { profile } = useAppSelector((state) => state); - - const feedbackIcon : IIconProps = { - iconName : 'Feedback' - } - const feedbackTitle = translateMessage('Feedback'); - const content =
{translateMessage('Feedback')}
- - const feedbackIconStyles = { - root:{ - height: '50px', - width: '50px' - } - } - const calloutProps = { - gapSpace: 0 - }; - const hostStyles = { root: { - display: 'inline-block' - } - }; - - const toggleSurvey = () => { - setEnableSurvey(prevState => !prevState); - } - - const disableSurvey = () => { - setEnableSurvey(false); - } - - return ( -
- {profile?.profileType !== ACCOUNT_TYPE.AAD && -
- - - - - -
- } -
- ) -} \ No newline at end of file diff --git a/src/app/views/main-header/FeedbackButton.tsx b/src/app/views/main-header/FeedbackButton.tsx index 921fded88..259291171 100644 --- a/src/app/views/main-header/FeedbackButton.tsx +++ b/src/app/views/main-header/FeedbackButton.tsx @@ -1,52 +1,35 @@ -import { - getTheme, - IButton, - IconButton, - IIconProps, - TooltipHost -} from '@fluentui/react'; -import { useRef, useState, useEffect, lazy, Suspense } from 'react'; +import { getTheme, IButton, IconButton, IIconProps, TooltipHost } from '@fluentui/react'; +import { useRef, useState, useEffect } from 'react'; import { translateMessage } from '../../utils/translate-messages'; -const FeedbackForm = lazy( - () => - import( - /* webpackChunkName: "feedback-form" */ '../query-runner/request/feedback/FeedbackForm' - ) -); +import FeedbackForm from '../query-runner/request/feedback/FeedbackForm'; import { ACCOUNT_TYPE } from '../../services/graph-constants'; import { componentNames, eventTypes, telemetry } from '../../../telemetry'; import { useAppSelector } from '../../../store'; export const FeedbackButton = () => { const [enableSurvey, setEnableSurvey] = useState(false); - const [renderSurvey, setRenderSurvey] = useState(false); const { profile } = useAppSelector((state) => state); const currentTheme = getTheme(); - const feedbackIcon: IIconProps = { - iconName: 'Feedback' - }; + const feedbackIcon : IIconProps = { + iconName : 'Feedback' + } const feedbackTitle = translateMessage('Feedback'); - const content = ( -
{translateMessage('Feedback')}
- ); + const content =
{translateMessage('Feedback')}
- const feedbackButtonRef = useRef(null); - const isFirstSurveyRender = useRef(true); - useEffect(() => { - if (enableSurvey && !renderSurvey) { - setRenderSurvey(true); - } - if (isFirstSurveyRender.current) { - isFirstSurveyRender.current = false; + const feedbackButtonRef = useRef(null) + const isFirstRender = useRef(true); + useEffect( () => { + if (isFirstRender.current) { + isFirstRender.current = false; return; } - if (!enableSurvey) { + if(!enableSurvey){ feedbackButtonRef.current?.focus(); } - }, [enableSurvey, renderSurvey]); + },[enableSurvey]) const feedbackIconStyles = { - root: { + root:{ height: '50px', width: '50px', marginTop: '-8px', @@ -54,63 +37,54 @@ export const FeedbackButton = () => { background: `${currentTheme.palette.neutralLight} !important` } } - }; + } const calloutProps = { gapSpace: 0 }; - const hostStyles = { - root: { - display: 'inline-block' - } + const hostStyles = { root: { + display: 'inline-block' + } }; const activateSurvey = () => { setEnableSurvey(true); trackFeedbackButtonEvent(); - }; + } const disableSurvey = () => { setEnableSurvey(false); - }; + } const trackFeedbackButtonEvent = () => { telemetry.trackEvent(eventTypes.BUTTON_CLICK_EVENT, { ComponentName: componentNames.FEEDBACK_BUTTON }); - }; + } return (
- {profile?.profileType !== ACCOUNT_TYPE.AAD && ( -
- - - - {renderSurvey && ( - /* use null as a fallback as the feedback form renders in a different DOM sub-tree */ - - - - )} -
- )} + {profile?.profileType !== ACCOUNT_TYPE.AAD && +
+ + + + + +
+ }
- ); -}; + ) +} \ No newline at end of file diff --git a/src/tests/accessibility/accessibility.spec.ts b/src/tests/accessibility/accessibility.spec.ts index 6278ead17..522c14cf8 100644 --- a/src/tests/accessibility/accessibility.spec.ts +++ b/src/tests/accessibility/accessibility.spec.ts @@ -26,7 +26,8 @@ test.describe('Accessibility', () => { 'landmark-unique', 'aria-allowed-attr', 'aria-required-children', - 'color-contrast' + 'color-contrast', + 'aria-conditional-attr' ]) .analyze(); accessibilityScan.setLegacyMode(false);