Skip to content

Commit

Permalink
fix: broken Redux thunks during earlier refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyvion committed Sep 22, 2023
1 parent 2a5888e commit 8e6b32f
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 10 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/draft_new_hotfix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: 'Draft new hotfix'

on:
workflow_dispatch:
inputs:
version:
description: 'The version you want to hotfix.'
required: true

jobs:
draft-new-hotfix:
name: 'Draft a new hotfix'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Create hotfix branch
run: git checkout -b hotfix/${{ github.event.inputs.version }}

- name: Update changelog
uses: thomaseizinger/[email protected]
with:
version: ${{ github.event.inputs.version }}

# In order to make a commit, we need to initialize a user.
- name: Initialize mandatory git config
run: |
git config user.name "GitHub Actions"
git config user.email [email protected]
# This step will differ depending on your project setup
# Fortunately, yarn has a built-in command for doing this!
- name: Bump version in package.json
run: npm version ${{ github.event.inputs.version }} --no-git-tag-version

- name: Commit changelog and manifest files
id: make-commit
run: |
git add CHANGELOG.md package.json
git commit --message "chore: prepare hotfix ${{ github.event.inputs.version }}"
echo "::set-output name=commit::$(git rev-parse HEAD)"
- name: Push new branch
run: git push origin hotfix/${{ github.event.inputs.version }}

- name: Create pull request
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
head: hotfix/${{ github.event.inputs.version }}
base: main
title: Hotfix version ${{ github.event.inputs.version }}
reviewers: ${{ github.actor }}
body: |
Hi @${{ github.actor }}!
This PR was created in response to a manual trigger of the hotfix workflow here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}.
I've updated the changelog and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}.
Merging this PR will create a GitHub release and upload any assets that are created as part of the release build.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed 🐛

- Use the current edit values to render the item details so they update live when they're changed
- Fix broken Redux thunks during earlier refactoring that prevented editors from being able to update and save comic values

## [1.2.0] - 2023-09-20

Expand Down
22 changes: 12 additions & 10 deletions src/components/EditorModePanel/EditorModePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export default function EditorModePanel() {
}
onSubmit={(e) => {
e.preventDefault()
saveChanges()
dispatch(saveChanges())
}}
>
<div className="flex justify-between border-b border-solid border-b-stone-300 border-l-0 border-t-0 border-r-0 -mx-2 -mt-2 mb-2">
Expand All @@ -229,39 +229,39 @@ export default function EditorModePanel() {
navigationData={editorData.missing.cast}
title="Missing cast"
description="Navigate to comics without cast members"
onSetCurrentComic={setCurrentComic}
onSetCurrentComic={(c) => dispatch(setCurrentComic(c))}
id={-1}
useColors={settings.useColors}
/>
<MissingNavElement
navigationData={editorData.missing.location}
title="Missing location"
description="Navigate to comics without locations"
onSetCurrentComic={setCurrentComic}
onSetCurrentComic={(c) => dispatch(setCurrentComic(c))}
id={-2}
useColors={settings.useColors}
/>
<MissingNavElement
navigationData={editorData.missing.storyline}
title="Missing storyline"
description="Navigate to comics without storylines"
onSetCurrentComic={setCurrentComic}
onSetCurrentComic={(c) => dispatch(setCurrentComic(c))}
id={-3}
useColors={settings.useColors}
/>
<MissingNavElement
navigationData={editorData.missing.title}
title="Missing title"
description="Navigate to comics without a title"
onSetCurrentComic={setCurrentComic}
onSetCurrentComic={(c) => dispatch(setCurrentComic(c))}
id={-4}
useColors={settings.useColors}
/>
<MissingNavElement
navigationData={editorData.missing.tagline}
title="Missing tagline"
description="Navigate to comics without a tagline"
onSetCurrentComic={setCurrentComic}
onSetCurrentComic={(c) => dispatch(setCurrentComic(c))}
id={-5}
useColors={settings.useColors}
/>
Expand All @@ -280,7 +280,7 @@ export default function EditorModePanel() {
label="Title"
inputId="qcext-comic-title"
value={title}
onValueChange={setTitle}
onValueChange={(t) => dispatch(setTitle(t))}
dirty={isTitleDirty}
/>
</ExpandingEditor>
Expand All @@ -295,7 +295,7 @@ export default function EditorModePanel() {
label="Tagline"
inputId="qcext-comic-tagline"
value={tagline}
onValueChange={setTagline}
onValueChange={(t) => dispatch(setTagline(t))}
dirty={isTaglineDirty}
/>
</ExpandingEditor>
Expand All @@ -312,9 +312,11 @@ export default function EditorModePanel() {
inputId="qcext-comic-publish-date"
dateValue={publishDate}
isAccurateValue={isAccuratePublishDate}
onDateValueChange={(date) => setPublishDate(date)}
onDateValueChange={(date) => dispatch(setPublishDate(date))}
onIsAccurateValueChange={(isAccuratePublishDate) =>
setIsAccuratePublishDate(isAccuratePublishDate)
dispatch(
setIsAccuratePublishDate(isAccuratePublishDate)
)
}
isDateValueDirty={isPublishDateDirty}
isIsAccurateValueDirty={isIsAccuratePublishDateDirty}
Expand Down

0 comments on commit 8e6b32f

Please sign in to comment.