diff --git a/.github/workflows/cd-beta.yaml b/.github/workflows/cd-beta.yaml index 78957899f4..c7a80376b7 100644 --- a/.github/workflows/cd-beta.yaml +++ b/.github/workflows/cd-beta.yaml @@ -83,7 +83,24 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v2 - - name: Create Stable Release PR - run: gh pr create -B stable -H beta --title 'Stable Release' --body 'Created by Github action' + + - name: Check if PR exists + id: check + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + prs=$(gh pr list \ + --repo "$GITHUB_REPOSITORY" \ + --head 'beta' \ + --base 'stable' \ + --json title \ + --jq 'length') + if ((prs > 0)); then + echo "skip=true" >> "$GITHUB_OUTPUT" + fi + + - name: Create Stable Release + if: "!steps.check.outputs.skip" + run: gh pr create -B stable -H dev --title 'Stable Release' --body 'Created by Github action' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/cd-dev.yaml b/.github/workflows/cd-dev.yaml new file mode 100644 index 0000000000..47f4c2b372 --- /dev/null +++ b/.github/workflows/cd-dev.yaml @@ -0,0 +1,119 @@ +name: cd-dev + +concurrency: + group: dev + cancel-in-progress: true + +on: + # Uncomment to work on CD in development mode. + # pull_request: + # branches: [ master ] + push: + branches: + - dev + +jobs: + deploy_dev: + runs-on: ubuntu-latest + env: + ENV: "dev" + + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Auth with Gcloud + uses: google-github-actions/auth@v2 + with: + credentials_json: ${{ secrets.GCP_DEV_SA_KEY }} + - name: Set up Gcloud SDK + uses: google-github-actions/setup-gcloud@v2 + with: + project_id: zesty-dev + - name: Set up Node + uses: actions/setup-node@v2 + with: + node-version: "16.5.0" + cache: "npm" + cache-dependency-path: package-lock.json + - name: Install Dependencies + run: npm install + - name: Build + run: npm run build:dev + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + - name: Deploy to Dev + run: gcloud app deploy app.yaml --quiet --project zesty-dev + + failed_deploy_notification_to_slack: + runs-on: ubuntu-latest + if: ${{ failure() }} + needs: [deploy_dev] + steps: + - name: Failed Deploy Notification To Slack + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_CHANNEL: code-deploy + SLACK_COLOR: "#FF2A08" + SLACK_ICON: https://brand.zesty.io/zesty-io-logo.svg + SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy." + SLACK_TITLE: "FAILED: Dev Deployment for manager-ui" + SLACK_USERNAME: Deploy Bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + + success_deploy_notification_to_slack: + runs-on: ubuntu-latest + if: ${{ success() }} + needs: [deploy_dev] + steps: + - name: Success Deploy Notification To Slack + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_CHANNEL: code-deploy + SLACK_COLOR: "#75BF43" + SLACK_ICON: https://brand.zesty.io/zesty-io-logo.svg + # SLACK_MESSAGE: "PR merge by ${{ github.actor }} has been deployed to stage." + SLACK_TITLE: "SUCCESS: Dev Deployment of manager-ui" + SLACK_USERNAME: Deploy Bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v4 + with: + # this assumes that you have created a personal access token + # (PAT) and configured it as a GitHub action secret named + # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). + token: ${{ secrets.GITHUB_TOKEN }} + # this is a built-in strategy in release-please, see "Action Inputs" + # for more options + release-type: node + target-branch: stage + + # create_stage_pr: + # runs-on: ubuntu-latest + # needs: [deploy_dev] + # steps: + # - name: Checkout Repo + # uses: actions/checkout@v2 + + # - name: Check if PR exists + # id: check + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: | + # prs=$(gh pr list \ + # --repo "$GITHUB_REPOSITORY" \ + # --head 'dev' \ + # --base 'stage' \ + # --json title \ + # --jq 'length') + # if ((prs > 0)); then + # echo "skip=true" >> "$GITHUB_OUTPUT" + # fi + + # - name: Create Stage Release + # if: "!steps.check.outputs.skip" + # run: gh pr create -B stage -H dev --title 'Stage Release' --body 'Created by Github action' + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/cd-dev-stage.yaml b/.github/workflows/cd-stage.yaml similarity index 64% rename from .github/workflows/cd-dev-stage.yaml rename to .github/workflows/cd-stage.yaml index 095d94cffb..524fc7ec3c 100644 --- a/.github/workflows/cd-dev-stage.yaml +++ b/.github/workflows/cd-stage.yaml @@ -1,52 +1,10 @@ -name: cd-dev-stage +name: cd-stage on: - # Uncomment to work on CD in development mode. - # pull_request: - # branches: [ master ] push: branches: - - dev + - stage jobs: - deploy_dev: - runs-on: ubuntu-latest - env: - ENV: "dev" - - steps: - # This Clean step simply checks if there's already a workflow running from the last - # commit and cancels it if there is. This helps us save on cloud cost in the long run. - # See https://github.com/rokroskar/workflow-run-cleanup-action for more information. - - name: Clean - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - if: "github.ref != 'refs/heads/master'" - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Auth with Gcloud - uses: google-github-actions/auth@v2 - with: - credentials_json: ${{ secrets.GCP_DEV_SA_KEY }} - - name: Set up Gcloud SDK - uses: google-github-actions/setup-gcloud@v2 - with: - project_id: zesty-dev - - name: Set up Node - uses: actions/setup-node@v2 - with: - node-version: "16.5.0" - cache: "npm" - cache-dependency-path: package-lock.json - - name: Install Dependencies - run: npm install - - name: Build - run: npm run build:dev - env: - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - - name: Deploy to Dev - run: gcloud app deploy app.yaml --quiet --project zesty-dev - deploy_stage: runs-on: ubuntu-latest env: @@ -89,7 +47,7 @@ jobs: failed_deploy_notification_to_slack: runs-on: ubuntu-latest if: ${{ failure() }} - needs: [deploy_dev, deploy_stage] + needs: [deploy_stage] steps: - name: Failed Deploy Notification To Slack uses: rtCamp/action-slack-notify@v2 @@ -98,7 +56,7 @@ jobs: SLACK_COLOR: "#FF2A08" SLACK_ICON: https://brand.zesty.io/zesty-io-logo.svg SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy." - SLACK_TITLE: "FAILED: Dev/Stage Deployment for manager-ui" + SLACK_TITLE: "FAILED: Stage Deployment for manager-ui" SLACK_USERNAME: Deploy Bot SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} @@ -120,7 +78,7 @@ jobs: create_beta_pr: runs-on: ubuntu-latest - needs: [deploy_dev, deploy_stage] + needs: [deploy_stage] steps: - name: Checkout Repo uses: actions/checkout@v2 @@ -132,7 +90,7 @@ jobs: run: | prs=$(gh pr list \ --repo "$GITHUB_REPOSITORY" \ - --head 'dev' \ + --head 'stage' \ --base 'beta' \ --json title \ --jq 'length') @@ -142,6 +100,6 @@ jobs: - name: Create Beta Release if: "!steps.check.outputs.skip" - run: gh pr create -B beta -H dev --title 'Beta Release' --body 'Created by Github action' + run: gh pr create -B beta -H stage --title 'Beta Release' --body 'Created by Github action' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/apps/content-editor/src/app/views/ItemEdit/components/ItemEditHeader/ItemEditHeaderActions.tsx b/src/apps/content-editor/src/app/views/ItemEdit/components/ItemEditHeader/ItemEditHeaderActions.tsx index f8255933b3..6200aed622 100644 --- a/src/apps/content-editor/src/app/views/ItemEdit/components/ItemEditHeader/ItemEditHeaderActions.tsx +++ b/src/apps/content-editor/src/app/views/ItemEdit/components/ItemEditHeader/ItemEditHeaderActions.tsx @@ -289,7 +289,8 @@ export const ItemEditHeaderActions = ({ {itemState === ITEM_STATES.draft || itemState === ITEM_STATES.dirty || publishAfterSave || - isFetching ? ( + isFetching || + saving ? ( void; onClose?: () => void; @@ -72,7 +76,7 @@ export const RenameFileModal: FC = ({ New File Name - = ({ }, }} autoFocus - onFocus={(evt) => evt.target.select()} + onFocus={(evt: React.FocusEvent) => + evt.target.select() + } value={renamedFilename} - onChange={(evt) => { - setRenamedFilename(evt.target.value); + onChange={(evt: React.ChangeEvent) => { + setRenamedFilename(evt.target.value.replace(" ", "-")); }} - onKeyPress={(event) => event.key === "Enter" && handleUpdate()} + onKeyPress={(event: React.KeyboardEvent) => + event.key === "Enter" && handleUpdate() + } InputProps={{ disableUnderline: true, endAdornment: ( diff --git a/src/apps/media/src/app/components/Thumbnail/ThumbnailContent.tsx b/src/apps/media/src/app/components/Thumbnail/ThumbnailContent.tsx index 43d56564d9..6ce30ef6a5 100644 --- a/src/apps/media/src/app/components/Thumbnail/ThumbnailContent.tsx +++ b/src/apps/media/src/app/components/Thumbnail/ThumbnailContent.tsx @@ -9,6 +9,10 @@ import { import { alpha } from "@mui/material/styles"; +import { withCursorPosition } from "../../../../../../shell/components/withCursorPosition"; + +const TextFieldWithCursorPosition = withCursorPosition(TextField); + interface Props { filename: string; onFilenameChange?: (value: string) => void; @@ -45,13 +49,15 @@ export const ThumbnailContent: FC = ({ {onFilenameChange ? ( - onFilenameChange(e.target.value)} + onChange={(e: React.ChangeEvent) => + onFilenameChange(e.target.value.replace(" ", "-")) + } sx={{ "& .MuiInputBase-root.MuiOutlinedInput-root": { borderRadius: 0,