Skip to content

Commit

Permalink
Merge pull request #2237 from zetkin/main
Browse files Browse the repository at this point in the history
241007 Release
  • Loading branch information
richardolsson authored Oct 7, 2024
2 parents fd7aab2 + 6fe1dc2 commit 76259f4
Show file tree
Hide file tree
Showing 227 changed files with 10,407 additions and 785 deletions.
5 changes: 4 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
ZETKIN_APP_DOMAIN=http://www.dev.zetkin.org

ZETKIN_PRIVACY_POLICY_LINK=https://zetkin.org/privacy

# Zetkin API settings
ZETKIN_API_DOMAIN=dev.zetkin.org
ZETKIN_API_HOST=api.dev.zetkin.org
Expand All @@ -8,4 +10,5 @@ ZETKIN_CLIENT_SECRET=MWQyZmE2M2UtMzM3Yi00ODUyLWI2NGMtOWY5YTY5NTY3YjU5
ZETKIN_APP_HOST=localhost:3000
ZETKIN_USE_TLS=0

SESSION_PASSWORD=thisispasswordandshouldbelongerthan32characters
SESSION_PASSWORD=thisispasswordandshouldbelongerthan32characters
MONGODB_URL=
2 changes: 2 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ZETKIN_PRIVACY_POLICY_LINK=https://zetkin.org/privacy

# Zetkin API settings
ZETKIN_API_DOMAIN=dev.zetkin.org
ZETKIN_API_HOST=localhost
Expand Down
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/zui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: ZUI design system
about: Components for the ZUI design system library
title: '🧱 ZUI: '
labels: '🧱 ZUI'
assignees: ''
---

## Description

## Screenshots

## Figma link

You need to be logged into a Figma account to properly view the Figma content.

## Requirements

- [ ] Requirement 1

## Open questions

## Possible implementations

Develop this using Storybook. We want all the design system components to be documented through their own Storybook stories.

For reference, you can look at the already existing ZUI components created on the `undocumented/new-design-system` branch (not ZUI components that exist on `main`, as they are not part of the new design system.)

## Git

The main git branch for the work on the new design system is `undocumented/new-design-system`. Unless otherwise instructed, do your work on a new branch branched off from this branch.

Name your branch `issue-number/zui-name`, ex: `issue-928/zui-button` for a branch where work is done that is documented in the issue with number 928, where a button component is being made.
67 changes: 37 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Zetkin
# Zetkin Web App

This is the new Zetkin front-end application, currently under development. It
will run at app.zetkin.org and replace the current www.zetk.in, call.zetk.in and
organize.zetk.in applications.
This is the current-generation (Gen3) web interface for the Zetkin Platform. It
is gradually replacing the older (Gen2) web apps that can be found elsewhere.

## Technology

The new Zetkin app is built on [NEXT.js](https://nextjs.org) with TypeScript.
The Zetkin Platform is software for organizing activism, developed by staff and
volunteers at [Zetkin Foundation](https://zetkin.org) and used by organizations
within the international left.

## Contributing

Do you want to contribute to this project and become part of a community of people
that use their coding skills to help the international left? We try to make the
process as easy and transparent as possible. Read all about it in the separate
Expand All @@ -18,57 +18,64 @@ Also see [TESTING.md](./TESTING.md) for details about automated testing.

## Instructions

### Windows
### Getting the code

The code is [hosted on GitHub](https://github.com/zetkin/app.zetkin.org) (likely
where you are currently reading this information). If you are unfamiliar with
Git and/or GitHub, here's some recommended reading from the GitHub Docs:

- [About GitHub and Git](https://docs.github.com/en/get-started/start-your-journey/about-github-and-git)
- [Set up Git](https://docs.github.com/en/get-started/getting-started-with-git/set-up-git)
(We recommend either the Git command-line interface or a plugin for your IDE)
- [Contributing to a project](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project)
explains how you can submit your first PR to a project like Zetkin

You can use any editor or IDE to edit the code, but most of us use [VSCode](https://code.visualstudio.com/).

1. Fork zetkin/app.zetking.org into your personal GitHub account.
1. Install Git for Windows from https://git-scm.com/download/win
2. Generate an SSH key, for example with
Git Gui / Help / Show SSH Key / Generate Key
3. Add your key to GitHub by copying the public part of it to
your GitHub settings at https://github.com/settings/keys
4. Install Visual Studio Code.
5. In Visual Studio Code use Clone Repository and from GitHub, connect your
installation of Visual Studio Code to your GitHub account, and then clone
your fork from GitHub. Note that you will be prompted for the passphrase of
your private key if you chose to use one when you created your SSH Key.
### Running the code (normal)

### Common
The Zetkin web app is a NEXT.js app that runs in the Node.js JavaScript runtime.
If you don't have it already, you must [install Node.js](https://nodejs.org/)
first.

Install all the dependencies using [`yarn` (Classic)](https://classic.yarnpkg.com):
We use [`yarn` (Classic)](https://classic.yarnpkg.com) to manage our code
dependencies. Once you have installed `yarn` you can install all other
dependencies like so:

```
$ yarn install
```

Then start the devserver:
With dependencies installed, you can start the development server:

```
$ yarn devserver
```

You should now be able to access the app on http://localhost:3000. It will
communicate with the Zetkin API running on our public development server.
communicate with the Zetkin API running on our public development server. See
below for login credentials.

### Docker
### Running the code (Docker)

As **an alternative to the normal development setup**,
you can also run the provided Docker Compose setup.
As **an alternative to the normal development setup**, you can also run the provided
Docker Compose setup.

* Requires Docker Compose v2+
* Backend development: Run local production (after building, it starts very fast)
- Requires Docker Compose v2+
- Backend development: Run local production (after building, it starts very fast)
and access the organizations directly on http://localhost:3000/organizations/.

```
$ docker compose -f dev.yml --profile static up
```

* Frontend development: Similar to the normal yarn setup documented here.
- Frontend development: Similar to the normal yarn setup documented here.

```
$ docker compose -f dev.yml --profile dev up
```

* Linting: You can run lint commands from within a container, too:
- Linting: You can run lint commands from within a container, too:

```
$ # Default: Run .githooks/precommit
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import KPD from '../..';
import {
ELEMENT_TYPE,
RESPONSE_TYPE,
ZetkinSurveyExtended,
} from 'utils/types/zetkin';

const KPDMembershipSurvey: ZetkinSurveyExtended = {
access: 'open',
callers_only: false,
campaign: null,
elements: [
{
hidden: false,
id: 1,
question: {
description: '',
options: [
{
id: 1,
text: 'Yes',
},
{
id: 2,
text: 'No',
},
],
question: 'Do you want to be active?',
required: false,
response_config: {
widget_type: 'radio',
},
response_type: RESPONSE_TYPE.OPTIONS,
},
type: ELEMENT_TYPE.QUESTION,
},
{
hidden: false,
id: 2,
question: {
description: '',
question: 'What would you like to do?',
required: false,
response_config: {
multiline: true,
},
response_type: RESPONSE_TYPE.TEXT,
},
type: ELEMENT_TYPE.QUESTION,
},
{
hidden: false,
id: 3,
question: {
description: '',
options: [
{
id: 1,
text: 'Flyers',
},
{
id: 2,
text: 'Phone banking',
},
],
question: 'How do you want to help?',
required: false,
response_config: {
widget_type: 'checkbox',
},
response_type: RESPONSE_TYPE.OPTIONS,
},
type: ELEMENT_TYPE.QUESTION,
},
],
expires: null,
id: 1,
info_text: '',
org_access: 'sameorg',
organization: {
id: KPD.id,
title: KPD.title,
},
published: '1857-05-07T13:37:00.000Z',
signature: 'allow_anonymous',
title: 'Membership survey',
};

export default KPDMembershipSurvey;
Loading

0 comments on commit 76259f4

Please sign in to comment.