Skip to content

Commit

Permalink
PATCH 14.0.1 (#2386)
Browse files Browse the repository at this point in the history
* bug/2382: currentInteractionStep variable needs to continue w/in block instead of new const

* Dependabot Config File (#2379)

* init dependabot.yml

* typo

* fix for campaign sort bug (#2384)

* fix bug where the CampaignTable would white screen of death after trying to sort

* set initial sort to ID_DESC

* remove sorting on archive column

* call this.state.campaigns directly wherever possible. Object destructured pageInfo immidiately

* add 14.0.1 release notes

* 14.0 >> 14.0.1

* link pr's

* fix typo

---------

Co-authored-by: Schuyler Duveen <[email protected]>
Co-authored-by: Maureen <[email protected]>
  • Loading branch information
3 people authored Jul 24, 2024
1 parent ff740cc commit 898ae5e
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 18 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
target-branch: "stage-main-14.1"
schedule:
interval: "weekly"
day: "monday"
time: "12:00"
rebase-strategy: auto
open-pull-requests-limit: 10
labels:
- "A-dependencies"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Spoke was created by Saikat Chakrabarti and Sheena Pakanati.

On November 19th, 2023, the repo Spoke was transfered from MoveOn to StateVoices.

The latest version is [14.0.0](https://github.com/StateVoicesNational/Spoke/tree/v14.0) (see [release notes](https://github.com/StateVoicesNational/Spoke/blob/main/docs/RELEASE_NOTES.md#v140))
The latest version is [14.0.1](https://github.com/StateVoicesNational/Spoke/tree/v14.0.1) (see [release notes](https://github.com/StateVoicesNational/Spoke/blob/main/docs/RELEASE_NOTES.md#v1401))


## Setting up Spoke
Expand All @@ -25,7 +25,7 @@ Want to know more?
### Quick Start with Heroku
This version of Spoke suitable for testing and, potentially, for small campaigns. This won't cost any money and will not support production(aka large-scale) usage. It's a great way to practice deploying Spoke or see it in action.

<a href="https://heroku.com/deploy?template=https://github.com/StateVoicesNational/Spoke/tree/v14.0">
<a href="https://heroku.com/deploy?template=https://github.com/StateVoicesNational/Spoke/tree/v14.0.1">

<img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy">
</a>
Expand Down
13 changes: 13 additions & 0 deletions docs/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Release Notes

## v14.0.1
_July 2024:_ Version 14.0.1

14.0.1 is a patch release.

### Bug Fixes
- [#2384](https://github.com/StateVoicesNational/Spoke/pull/2384) - Fix white-screen-of-death when trying to sort the Admin Campaign List
- [#2383](https://github.com/StateVoicesNational/Spoke/pull/2383) - Fix white-screen-of-death when trying to click "All Responses
- [#2379](https://github.com/StateVoicesNational/Spoke/pull/2379) - Create `dependabot.yml`

### Appreciations
[Maureen Zitouni](https://github.com/mau11), [Ruby Engelhart](https://github.com/engelhartrueben), [Schuyler Duveen](https://github.com/schuyler1d)

## v14.0
_July 2024:_ Version 14.0

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spoke",
"version": "14.0.0",
"version": "14.0.1",
"description": "Spoke",
"main": "src/server",
"engines": {
Expand Down
21 changes: 11 additions & 10 deletions src/components/AdminCampaignList/CampaignTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export class CampaignTable extends React.Component {
};

state = {
dataTableKey: "initial"
dataTableKey: "initial",
campaigns: [...this.props.data.organization.campaigns.campaigns]
};

statusIsChanging = campaign => {
Expand Down Expand Up @@ -119,7 +120,8 @@ export class CampaignTable extends React.Component {
customBodyRender: (value, tableMeta) => {
const campaign = campaigns.find(c => c.id === tableMeta.rowData[0]);
return this.renderArchiveIcon(campaign);
}
},
sort: false
},
style: {
width: "5em"
Expand Down Expand Up @@ -305,8 +307,7 @@ export class CampaignTable extends React.Component {
};

render() {
const { campaigns, pageInfo } = this.props.data.organization.campaigns;
const { limit, offset, total } = pageInfo;
const { limit, offset, total } = this.props.data.organization.campaigns.pageInfo;
const displayPage = Math.floor(offset / limit) + 1;
let rowSizeList = [10, 20, 50, 100];

Expand Down Expand Up @@ -346,14 +347,14 @@ export class CampaignTable extends React.Component {
break;
case "sort":
this.clearCampaignSelection();
campaigns.sort(this.sortFunc(tableState.sortOrder.name));
this.state.campaigns.sort(this.sortFunc(tableState.sortOrder.name));
if (tableState.sortOrder.direction === "desc") {
campaigns.reverse();
this.state.campaigns.reverse()
}
break;
case "rowSelectionChange":
const ids = tableState.selectedRows.data.map(({ index }) => {
return campaigns[index].id;
return this.state.campaigns[index].id;
});
this.props.handleChecked(ids);
break;
Expand All @@ -365,17 +366,17 @@ export class CampaignTable extends React.Component {
}
};

return campaigns.length === 0 ? (
return this.state.campaigns.length === 0 ? (
<Empty title="No campaigns" icon={<SpeakerNotesIcon />} />
) : (
<div>
<br />
<br />
<MUIDataTable
data={campaigns}
data={this.state.campaigns}
columns={this.prepareTableColumns(
this.props.data.organization,
campaigns
this.state.campaigns
)}
options={options}
/>
Expand Down
4 changes: 1 addition & 3 deletions src/components/AssignmentTexter/Controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,9 @@ export class AssignmentTexterContactControls extends React.Component {
let currentInteractionStep = null;

if (availableSteps.length > 0) {
const currentInteractionStep = deepCopy(
currentInteractionStep = deepCopy(
availableSteps[availableSteps.length - 1]
);

currentInteractionStep.question.filteredAnswerOptions =
currentInteractionStep.question.answerOptions;
}
Expand Down Expand Up @@ -504,7 +503,6 @@ export class AssignmentTexterContactControls extends React.Component {
filteredCannedResponses
} = this.state;
const { messages } = contact;

const availableInteractionSteps = getAvailableInteractionSteps(
questionResponses,
campaign.interactionSteps
Expand Down
4 changes: 2 additions & 2 deletions src/containers/AdminCampaignList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { dataTest } from "../lib/attributes";
import loadData from "./hoc/load-data";
import theme from "../styles/theme";
import SortBy, {
DUE_DATE_DESC_SORT
ID_DESC_SORT
} from "../components/AdminCampaignList/SortBy";
import Search from "../components/Search";
import CampaignTable from "../components/AdminCampaignList/CampaignTable";
Expand All @@ -38,7 +38,7 @@ const INITIAL_FILTER = {
isArchived: false,
searchString: ""
};
const INITIAL_SORT_BY = DUE_DATE_DESC_SORT.value;
const INITIAL_SORT_BY = ID_DESC_SORT.value;

export class AdminCampaignList extends React.Component {
static propTypes = {
Expand Down

0 comments on commit 898ae5e

Please sign in to comment.