diff --git a/.github/workflows/git-command.yml b/.github/workflows/git-command.yml index b9cc7d98..76df571b 100644 --- a/.github/workflows/git-command.yml +++ b/.github/workflows/git-command.yml @@ -16,7 +16,7 @@ jobs: - uses: hmarr/debug-action@v2.1.0 - name: Add Workflow link to command comment - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 with: token: ${{ secrets.GIT_PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} @@ -50,7 +50,7 @@ jobs: echo "merge_conflict=$(git merge-tree $(git merge-base HEAD origin/$SLASH_COMMAND_ARG_BRANCH) origin/$SLASH_COMMAND_ARG_BRANCH HEAD | grep '<<')" >> $GITHUB_OUTPUT - name: Add reaction to command comment on merge conflict - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 if: ${{ steps.check-conflict.outputs.merge_conflict }} with: token: ${{ secrets.GIT_PAT }} @@ -81,7 +81,7 @@ jobs: - name: Add reaction to command comment on nothing to do if: ${{ !steps.check-conflict.outputs.merge_conflict && steps.commit_and_push.outputs.changes == 'no' }} - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 with: token: ${{ secrets.GIT_PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} @@ -92,7 +92,7 @@ jobs: - name: Add reaction to command comment on success if: ${{ !steps.check-conflict.outputs.merge_conflict && steps.commit_and_push.outputs.changes == 'yes' }} - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 with: token: ${{ secrets.GIT_PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} @@ -103,7 +103,7 @@ jobs: reactions: "+1" - name: Add reaction to command comment on failure - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 if: failure() with: token: ${{ secrets.GIT_PAT }} @@ -119,7 +119,7 @@ jobs: timeout-minutes: 1 steps: - name: Update comment - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 with: token: ${{ secrets.GIT_PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index a9d89a61..ae7efec3 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Update comment if empty if: ${{ github.event.client_payload.slash_command.args.all == '' }} - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 with: token: ${{ secrets.GIT_PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} diff --git a/.github/workflows/jira-command.yml b/.github/workflows/jira-command.yml index 4ef05b3d..4875fcc1 100644 --- a/.github/workflows/jira-command.yml +++ b/.github/workflows/jira-command.yml @@ -16,7 +16,7 @@ jobs: - uses: hmarr/debug-action@v2.1.0 - name: Add Workflow link to command comment - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 with: token: ${{ secrets.GIT_PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} @@ -64,7 +64,7 @@ jobs: type: ${{ github.event.client_payload.slash_command.args.unnamed.arg2 || 'task' }} - name: Add reaction to command comment on success - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 with: token: ${{ secrets.GIT_PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} @@ -74,7 +74,7 @@ jobs: reactions: "+1" - name: Add reaction to command comment on failure - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 if: failure() with: token: ${{ secrets.GIT_PAT }} @@ -91,7 +91,7 @@ jobs: timeout-minutes: 1 steps: - name: Update comment - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 with: token: ${{ secrets.GIT_PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} diff --git a/.github/workflows/slash-command-dispatch.yml b/.github/workflows/slash-command-dispatch.yml index eba62df2..12dea9cf 100644 --- a/.github/workflows/slash-command-dispatch.yml +++ b/.github/workflows/slash-command-dispatch.yml @@ -72,7 +72,7 @@ jobs: - name: Edit comment with error message if: ${{ steps.determine_command.outputs.command_state == 'unknown' }} - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ github.event.comment.id }} body: | diff --git a/src/components/CellViews/DateTimeCell.js b/src/components/CellViews/DateTimeCell.js index 9aecaff3..7c5d1ff3 100644 --- a/src/components/CellViews/DateTimeCell.js +++ b/src/components/CellViews/DateTimeCell.js @@ -1,12 +1,12 @@ import { format, isValid } from "date-fns"; +export const dateTimeFormat = "MMM dd yyyy, HH:mm:ss"; export const DateTimeCell = (column) => { const date = new Date(column.value); - const dateFormat = "MMM dd yyyy, HH:mm:ss"; return column.value ? (
- {isValid(date) ? format(date, dateFormat) : ""} + {isValid(date) ? format(date, dateTimeFormat) : ""}
) : ( "" diff --git a/src/components/CellViews/StringCell.js b/src/components/CellViews/StringCell.js index 57bf479e..d4c7a3bc 100644 --- a/src/components/CellViews/StringCell.js +++ b/src/components/CellViews/StringCell.js @@ -1,24 +1,31 @@ -const valueToString = (value) => { +import { format, isValid } from "date-fns"; +import { dateTimeFormat } from "./DateTimeCell"; + +export const valueToString = (value) => { if (typeof value === "string") return value; + /* if undefined or null we'll treat it as empty string */ + if (value === undefined || value === null) return ""; + if (value instanceof Date && isValid(value)) return format(value, dateTimeFormat); try { + /* JSON.stringify will handle JSON and non-strings, non-null, non-undefined */ return JSON.stringify(value); } catch { - return value.toString(); + return 'Error: Invalid JSON'; } }; export const StringCell = ({ value }) => { + const style = { + maxHeight: "100%", + overflow: "hidden", + fontSize: 12, + lineHeight: "16px", + }; + return ( -
- {value ? valueToString(value) : ""} +
+ {valueToString(value)}
); };