diff --git a/.github/workflows/cd-packages.yaml b/.github/workflows/cd-packages.yaml index c153ff9bb6..aa0f7fe6bd 100644 --- a/.github/workflows/cd-packages.yaml +++ b/.github/workflows/cd-packages.yaml @@ -1,12 +1,17 @@ name: Publish packages permissions: + id-token: write # required for OIDC on npm contents: write # needed to push tags on: push: branches: - main + paths: + - "packages/core/**" + - "packages/libs/**" + - "packages/sdk/typescript/human-protocol-sdk/**" jobs: publish: @@ -14,10 +19,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 + with: + token: ${{ secrets.GH_GITBOOK_TOKEN }} - uses: actions/setup-node@v4 with: node-version-file: .nvmrc cache: yarn + registry-url: "https://registry.npmjs.org" + # Ensure npm 11.5.1 or later is installed to support OIDC + - name: Update npm + run: npm install -g npm@latest - name: Install dependencies run: yarn install --immutable # If there is no new version for dependency package (e.g. core) @@ -31,7 +42,6 @@ jobs: run: yarn workspaces foreach --all --no-private -pt npm publish --tolerate-republish --json | tee publish.log env: SKIP_PREPACK: true - YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Tag published packages run: node scripts/tag-published-packages.mjs publish.log - name: Push created tags diff --git a/packages/apps/human-app/frontend/src/modules/worker/jobs/components/report-abuse-modal.tsx b/packages/apps/human-app/frontend/src/modules/worker/jobs/components/report-abuse-modal.tsx index 879ebd2c65..117ffd9ec4 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/jobs/components/report-abuse-modal.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/jobs/components/report-abuse-modal.tsx @@ -4,9 +4,11 @@ import { Box, Button, CircularProgress, + FormControl, + MenuItem, + Select as MuiSelect, Stack, Typography, - TextField, } from '@mui/material'; import ErrorIcon from '@mui/icons-material/Error'; import SuccessIcon from '@mui/icons-material/CheckCircle'; @@ -23,6 +25,20 @@ interface ReportAbuseModalProps { const ABUSE_ERROR = 'Abuse has already been reported'; +const REASON_OPTIONS = [ + 'sexual_content', + 'nudity', + 'violence', + 'gore', + 'hate_or_racism', + 'drugs', + 'terrorism', + 'child_abuse', + 'self_harm', + 'weapons', + 'criminal_activity', +] as const; + function ErrorState({ error }: { error: string }) { const { t } = useTranslation(); @@ -101,11 +117,11 @@ export function ReportAbuseModal({ const isIdleOrLoading = isIdle || isPending; const handleReportAbuse = () => { - reason.trim().length > 0 && + reason.length > 0 && reportAbuseMutation({ escrow_address: escrowAddress, chain_id: chainId, - reason: reason.trim(), + reason, }); }; @@ -120,27 +136,30 @@ export function ReportAbuseModal({ {t('worker.reportAbuse.modalHeader')} {isIdleOrLoading && ( - - {t('worker.reportAbuse.modalParagraph')} - + <> + + {t('worker.reportAbuse.modalParagraph')} + + + { + setReason(e.target.value); + }} + > + {REASON_OPTIONS.map((value) => ( + + {t(`worker.reportAbuse.reasons.${value}`)} + + ))} + + + )} {isPending && } {isError && } {isSuccess && } - { - setReason(e.target.value); - }} - />