Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stage main 14.1.1 #13

Merged
merged 29 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
680713c
Merge pull request #2444 from StateVoicesNational/stage-main-14.1
engelhartrueben Sep 23, 2024
6cf1d8d
class component >> function component
engelhartrueben Sep 24, 2024
669df5d
remove clutter
engelhartrueben Sep 24, 2024
52614a5
class component >> function component
engelhartrueben Sep 24, 2024
c6974c7
change how we manipulate campaigns in this table
engelhartrueben Sep 24, 2024
01edd11
filter out campaigns that have been archived or unarchived
engelhartrueben Sep 24, 2024
8598a2f
ensure isArchived persists into next render
engelhartrueben Sep 24, 2024
d7c5c3e
add @testing-library/react @testing-library/jest-dom
engelhartrueben Sep 26, 2024
0992c41
downgrade testing library to 12.1.5
engelhartrueben Sep 26, 2024
e56d17b
Expoert AdminCampaignList for testing
engelhartrueben Sep 26, 2024
ce3a94a
add RTL userEvent and dom
engelhartrueben Sep 26, 2024
43aa5d6
Fix getAsync + delAsync redis errors
mau11 Sep 27, 2024
ebe30c8
remove testing-library/jest-dom
engelhartrueben Sep 27, 2024
6407b60
log error message
engelhartrueben Sep 30, 2024
7190805
upgrade twilio lookup to v2
engelhartrueben Sep 30, 2024
f0aadf0
forgotten yarn
engelhartrueben Sep 30, 2024
6009f18
persists sortBy
engelhartrueben Sep 30, 2024
1d476b9
redo timezone tests
engelhartrueben Sep 30, 2024
57ed8ea
prettier lint
engelhartrueben Oct 1, 2024
4bc59a3
prettier lint
engelhartrueben Oct 1, 2024
93d1041
Merge pull request #2472 from StateVoicesNational/mz/fix-redis-errors
mau11 Oct 1, 2024
c0415a6
remove parantheses
engelhartrueben Oct 1, 2024
710fe1d
use log instead of console for error message
engelhartrueben Oct 1, 2024
3364e9b
add back the v I accidently deleted
engelhartrueben Oct 1, 2024
2b8c7c5
Merge pull request #2471 from StateVoicesNational/re/twilio-lookup
engelhartrueben Oct 1, 2024
b67906b
Merge pull request #2473 from StateVoicesNational/re/archives
engelhartrueben Oct 1, 2024
9adc14f
Update Spoke version and add release notes + ran linter
mau11 Oct 1, 2024
7ce0e22
Merge pull request #2475 from StateVoicesNational/stage-main-14.1.1
engelhartrueben Oct 1, 2024
47be9d9
14.1.1
engelhartrueben Oct 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,34 @@ On November 19th, 2023, the repo Spoke was transferred from MoveOn to State Voic

The latest version can be found here: [Release Notes](https://github.com/StateVoicesNational/Spoke/blob/main/docs/RELEASE_NOTES.md)



## Setting up Spoke


The easiest way to get started is with Heroku. You can also learn about Spoke through the [texter](https://youtu.be/EqE1UDvKGco) and [admin](https://youtu.be/PTMykMX8gII) video demos or in the explanation on [how to decide if Spoke is right for you.](docs/EXPLANATION_DECIDING_ON_SPOKE.md)
The easiest way to get started is with Heroku. You can also learn about Spoke through the [texter](https://youtu.be/EqE1UDvKGco) and [admin](https://youtu.be/PTMykMX8gII) video demos or in the explanation on [how to decide if Spoke is right for you.](docs/EXPLANATION_DECIDING_ON_SPOKE.md)

For developers, please see our recommendations for [deploying locally for development](docs/HOWTO_DEVELOPMENT_LOCAL_SETUP.md).

Want to know more?
[Click here to visit the Spoke Documentation microsite!](https://statevoicesnational.github.io/Spoke/)


### 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.1.0">
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.1.1">

<img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy">
</a>

Follow up instructions located [here](docs/HOWTO_HEROKU_DEPLOY.md).


**NOTE:** You can upgrade this deployment later for use in a production setting, but keep in mind you will need to migrate data from any prior campaigns. Thus it is best to upgrade before you start any live campaigns. This will cost ~$75 ($25 dyno + $50 postgres) a month and should be suitable for production level usage for most organizations. We recommend that if you plan to use Spoke at scale that you use [this link to deploy with a production infrastructure from the start!](https://heroku.com/deploy?template=https://github.com/StateVoicesNational/Spoke/tree/heroku-button-paid)

**NOTE:** You can upgrade this deployment later for use in a production setting, but keep in mind you will need to migrate data from any prior campaigns. Thus it is best to upgrade before you start any live campaigns. This will cost ~$75 ($25 dyno + \$50 postgres) a month and should be suitable for production level usage for most organizations. We recommend that if you plan to use Spoke at scale that you use [this link to deploy with a production infrastructure from the start!](https://heroku.com/deploy?template=https://github.com/StateVoicesNational/Spoke/tree/heroku-button-paid)

### Other Options for Production Use

You can also [deploy on AWS Lambda.](docs/HOWTO_DEPLOYING_AWS_LAMBDA.md) which is a lot cheaper than Heroku at scale, but requires considerably more technical knowledge to deploy and maintain. We recommend this option for large scale campaigns with tech resources.

Additional guidance:

- [Choosing a set-up for production](docs/EXPLANATION_CHOOSE_A_SETUP.md)
- [How to hire someone to install Spoke](docs/HOWTO_HIRE_SOMEONE_TO_INSTALL_SPOKE.md)
- [Option for minimalist deployment](docs/HOWTO_MINIMALIST_DEPLOY.md)
Expand Down
87 changes: 69 additions & 18 deletions __test__/containers/CampaignList.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,31 @@
*/
import React from "react";
import { mount } from "enzyme";
import { AdminCampaignList } from "../../src/containers/AdminCampaignList";
import { TIMEZONE_SORT } from "../../src/components/AdminCampaignList/SortBy";
import { act } from "react-dom/test-utils";
import {
render,
screen,
waitFor,
cleanup
} from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { StyleSheetTestUtils } from "aphrodite";

import { AdminCampaignList } from "../../src/containers/AdminCampaignList";

// https://github.com/Khan/aphrodite/issues/62#issuecomment-267026726
beforeEach(() => {
StyleSheetTestUtils.suppressStyleInjection();
});
afterEach(() => {
StyleSheetTestUtils.clearBufferAndResumeStyleInjection();
cleanup();
});

describe("CampaignList", () => {
const params = {
adminPerms: true,
organizationId: 77
organizationId: "77"
};

const mutations = {
Expand Down Expand Up @@ -110,19 +127,21 @@ describe("CampaignList", () => {

describe("Campaign list sorting", () => {
const campaignWithCreator = {
id: 1,
id: "1",
title: "test",
creator: {
displayName: "Lorem Ipsum"
},
completionStats: {},
organization: {
id: 1
}
},
timezone: "US/Eastern"
};

const data = {
organization: {
id: 1,
id: "1",
cacheable: 2,
campaigns: {
campaigns: [campaignWithCreator],
Expand All @@ -132,26 +151,58 @@ describe("CampaignList", () => {
total: 1
}
}
}
},
refetch: () => {}
};

test("Timezone column is displayed when timezone is current sort", () => {
test("Timezone column is displayed when timezone is current sort", async () => {
StyleSheetTestUtils.suppressStyleInjection();
const wrapper = mount(
<AdminCampaignList data={data} mutations={mutations} params={params} />
);
wrapper.setState({
sortBy: TIMEZONE_SORT.value
act(() => {
render(
<AdminCampaignList
data={data}
mutations={mutations}
params={params}
/>
);
});

act(() => {
userEvent.click(
screen.getByRole("button", { name: /sort: created, newest/i }),
{ skipHover: true }
);
});
expect(wrapper.containsMatchingElement("Timezone")).toBeTruthy();

act(() => {
userEvent.click(
screen.getByRole("option", { name: /sort: timezone/i }),
{ skipHover: true }
);
});

await waitFor(() =>
expect(
screen.getByRole("columnheader", { name: /timezone/i })
).toBeTruthy()
);
});

test("Timezone column is hidden when it isn't the current sort", () => {
StyleSheetTestUtils.suppressStyleInjection();
const wrapper = mount(
<AdminCampaignList data={data} mutations={mutations} params={params} />
);
expect(wrapper.containsMatchingElement("Timezone")).toBeFalsy();
act(() => {
render(
<AdminCampaignList
data={data}
mutations={mutations}
params={params}
/>
);
});
const timezoneButton = screen.queryByText("columnheader", {
name: /timezone/i
});
expect(timezoneButton).toBeNull();
});
});
});
Loading
Loading