zetkin / app.zetkin.org Goto Github PK
View Code? Open in Web Editor NEWRevamped Zetkin web interface.
Home Page: https://app-zetkin-org.vercel.app
Revamped Zetkin web interface.
Home Page: https://app-zetkin-org.vercel.app
This is a page that should exist as a sub-page to organization pages, when there are any active sub-organizations or parent organizations related to the current organization.
It should contain a link to the parent organization and a list of active sub-organizations.
There's a need to handle the case when a user is not a member of an organization and clicking on follow on this organizations org/events/campaigns page.
Steps to reproduce:
/o/5
Follow
or Följ
Expected result: Since the development user is not a member of the organization with an id of 5 we expect some sort of message to indicate and handle this.
Actual result: No change in UI that indicates that the user is not a member of said organization.
Most pages share a common UI framework (header, footer et c) with other pages. This can be solved two ways.
<Header>
and <Footer>
components.<Header>
and a <Footer>
Option 2 is the preferred solution.
The reason for going with option 2 is that it will keep the header and footer "alive" across pages. This allows for transitions, consistent scroll states et c, whereas option 1 would reset the header and footer on every navigation.
Another benefit is that overall layout/template code lives in a single location, instead of every page component. Adding a new feature above the header only needs to happen in one place, not in every page.
The challenge with solution 2 is that different pages might have different layout requirements. The most obvious example is that organizer pages and public pages have vastly different layouts.
This means that the page component needs to somehow specify which layout to use, and the App
component needs to use the correct one.
One approach to this is discussed here: #1
Another set of ideas for refactors and clean-ups:
prefer-const
linting ruleno-trailing-spaces
linting ruletypes/zetkin.ts
moduleOrg*
prefixesdata-test
attributes to data-testid
eslint-disable @typescript-eslint/no-non-null-assertion
and clean up usage of !
props.children
everywhere (especially along with <Flex/>
)More to come…
Add org logo in page header on the following pages
Campaign page containing:
The organization page is the home of an organization that uses Zetkin. This is where they direct their members to find content, sign up to things and interact with the organization using Zetkin.
The page should contain:
In the future it will also link to sub-pages:
Below are two relevant but very rough wireframes.
Research and implement internationalization for all components in the app.
Event lists will be used in many different places, like org pages, the home/discover page and the user home page.
Should display a list of event cards, where each card includes at least the following information about an event:
Focus on making development and testing easier, not beautiful design.
We need to do some spring cleaning and refactoring:
ignoreCase
'
vs "
@typescript-eslint/explicit-function-return-type
strict
mode?The URL to the Zetkin API should be externalized eventually, so that we can toggle between using the development environment and the live environment.
Originally posted by @richardolsson in #10 (comment)
Configure HTTP Content Security Policy to further protect against XSS and more. More info at MDN: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
When NODE_ENV
is 'production'
, i.e. the site is running live in production, the /api/coverage
route should return 404.
This page should allow the user to:
Layout template for the user home set of pages (as defined in #25). The layout should contain the regular header and a set of top-level tabs (bottom-aligned on mobile) as outlined in the wireframe:
Find all existing strings and replace them with localized versions using FormattedMessage
.
Single-event page with unique URL. Should contain at least:
Main Registration Page for creating a user account in Zetkin without automatically connecting to any organization.
The actual form is described in #47.
Related to line 12 here:
app.zetkin.org/src/pages/_app.tsx
Lines 9 to 15 in f97c86a
An unnecessary effect of spreading pageProps
like this is that the page component (e.g. OrgEventsPage
) will receive the dehydratedState
property even though it doesn't need and should never use it directly. The purpose of the dehydratedState
property, created on the server by getServerSideProps()
, is to provide state to the <Hydrate>
component. Once passed to <Hydrate>
, the dehydratedState
is no longer relevant.
We should exclude dehydratedState
from pageProps
before passing it to the page component.
A neat looking way to do this would be to use the spread syntax described here (be sure to read the comments as well) to create two variables, dehydratedState
and restProps
. The former can then be passed to <Hydrate>
and ...restProps
to <Component>
.
Originally posted by @richardolsson in #4 (comment)
Add linting for integration tests, which are currently not included in the path passed to eslint
. The npm lint
command should include both relevant paths, i.e. eslint src cypress
.
The integration tests contain a bunch of errors that will need to be fixed as a part of this.
Make sure that the user is shown consistently in the header, while logged in. After logging in, the user name and avatar should be visible in the header on every page.
This page should contain a list of upcoming events that the user has signed up to, as well as call assignments that they have been assigned to.
In the future it can also contain other things that the user is expected to do, such as assigned Tasks.
Part of the organization page (#26) which retrieves and renders a list of upcoming events, on-going campaigns and other important content belonging to the organization.
To Do:
.env.development
and instructions to READMEThe survey page at /o/{org_id}/surveys/{survey_id}
does not currently render a survey form. It should interpret the data retrieved from the API and render the survey elements as defined.
Compare with how it works in today's Zetkin, e.g: https://www.zetk.in/o/1/surveys/1
The existing activist portal uses the SurveyForm
component from zetkin-common which can be used for inspiration, but it has many issues and is built using legacy React and should therefor not be considered a reference implementation.
Implement Adobe Spectrum layouts and components for:
A page under the organization page, where the user can donate to the organization.
Add Zetkin SDK and express-zetkin-auth
to this repo, using npm or yarn workspaces.
Show a tailored feed of upcoming events and other content relevant to the user.
Use org layout on all organization sub-pages (including events et c).
Add an option on OrgLayout
allowing it to be minimized, and toggle it for different pages.
Consider adding a proxy endpoint for the Zetkin API, so that requests can be made to the same host that the front-end is running on, e.g. http://localhost:3000/api/orgs/1 will proxy the request to https://api.zetk.in/v1/orgs/1.
Pros:
Cons:
A common header for all (public) pages should display the Zetkin logo and user information, or a login button if the user is not authenticated.
A form to register a user account with Zetkin, including fields for
The domain (as well as scheme/protocol and port) of the app should be externalized eventually, so that it can be run with other settings in production.
Originally posted by @richardolsson in #10 (comment)
The integration tests use cy.intercept()
to mock back-end data, but because of SSR it's not possible to intercept many of the API calls being made (from the back-end). This means that to avoid 404's the initial requests made by cy.visit()
must be for a resource that can be accessed via the live (or dev) API, which changes over time, making the tests brittle.
Consider running a small API proxy for integration testing, and substituting it by re-configuring the devserver under test. See #11 for API externalization.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.