Skip to content

Commit

Permalink
fix: fix height of proposal form
Browse files Browse the repository at this point in the history
feat: more clear redux store structure

fix: unit tests config

fix: removed useless aliases, which was moved to other folder
  • Loading branch information
Razzwan committed Dec 23, 2020
1 parent 6131b5a commit 7807cde
Show file tree
Hide file tree
Showing 66 changed files with 132 additions and 135 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,14 @@
"moduleNameMapper": {
"\\.(scss|css|less|svg|png|jpg)$": "identity-obj-proxy",
"^arc": "<rootDir>/src/arc",
"^actions/(.*)$": "<rootDir>/src/actions/$1",
"^components(.*)$": "<rootDir>/src/components$1",
"^@store(.*)$": "<rootDir>/src/@store$1",
"^data/(.*)$": "<rootDir>/data/$1",
"^genericSchemeRegistry(.*)$": "<rootDir>/src/genericSchemeRegistry$1",
"^crxRegistry(.*)$": "<rootDir>/src/crxRegistry$1",
"^layouts/(.*)$": "<rootDir>/src/layouts/$1",
"^lib/(.*)$": "<rootDir>/src/lib/$1",
"^pages": "<rootDir>/src/pages",
"^reducers/(.*)$": "<rootDir>/src/reducers/$1",
"^selectors/(.*)$": "<rootDir>/src/selectors/$1",
"^src/(.*)$": "<rootDir>/src/$1"
},
"setupFiles": [
Expand Down
6 changes: 3 additions & 3 deletions src/actions/arcActions.ts → src/@store/arc/arcActions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Address, DAO, IProposalCreateOptions, IProposalOutcome, ITransactionState, ITransactionUpdate, ReputationFromTokenScheme, Scheme } from "@daostack/arc.js";
import { IAsyncAction } from "actions/async";
import { IAsyncAction } from "@store/async";
import { toWei, getArcByDAOAddress } from "lib/util";
import { IRedemptionState } from "lib/proposalHelpers";
import { IRootState } from "reducers/index";
import { NotificationStatus, showNotification } from "reducers/notifications";
import { IRootState } from "@store/index";
import { NotificationStatus, showNotification } from "@store/notifications/notifications.reducer";
import * as Redux from "redux";
import { ThunkAction } from "redux-thunk";

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/reducers/index.ts → src/@store/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { routerReducer } from "react-router-redux";
import { combineReducers } from "redux";
import { INotificationsState, notificationsReducer } from "./notifications";
import profilesReducer, { IProfilesState } from "./profilesReducer";
import uiReducer, { IUIState } from "./uiReducer";
import web3Reducer, { IWeb3State } from "./web3Reducer";
import { INotificationsState, notificationsReducer } from "@store/notifications/notifications.reducer";
import profilesReducer, { IProfilesState } from "@store/profiles/profilesReducer";
import uiReducer, { IUIState } from "@store/ui/uiReducer";
import web3Reducer, { IWeb3State } from "@store/web3/web3Reducer";

export interface IRootState {
notifications: INotificationsState;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { INotificationsState, INotification } from "reducers/notifications";
import { INotificationsState, INotification } from "@store/notifications/notifications.reducer";
import { createSelector } from "reselect";
import { IRootState } from "../reducers";
import { IRootState } from "@store/index";

const notifications = (state: IRootState): INotificationsState => state.notifications;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as Box from "3box";

import { AsyncActionSequence, IAsyncAction } from "actions/async";
import { AsyncActionSequence, IAsyncAction } from "@store/async";
import { getWeb3Provider } from "arc";
import Analytics from "lib/analytics";

import { NotificationStatus, showNotification } from "reducers/notifications";
import { ActionTypes, FollowType, newProfile } from "reducers/profilesReducer";
import { NotificationStatus, showNotification } from "@store/notifications/notifications.reducer";
import { ActionTypes, FollowType, newProfile } from "@store/profiles/profilesReducer";
import { arrayRemove } from "lib/util";

// Load account profile data from our database for all the "members" of the DAO
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as update from "immutability-helper";

import { AsyncActionSequence } from "actions/async";
import { AsyncActionSequence } from "@store/async";

export enum ActionTypes {
GET_PROFILE_DATA = "GET_PROFILE_DATA",
Expand Down
4 changes: 2 additions & 2 deletions src/actions/uiActions.ts → src/@store/ui/uiActions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Redux from "redux";

import { IRootState } from "reducers";
import { ActionTypes } from "reducers/uiReducer";
import { IRootState } from "@store/index";
import { ActionTypes } from "@store/ui/uiReducer";
import { ISimpleMessagePopupProps } from "components/Shared/SimpleMessagePopup";

export function showTour() {
Expand Down
File renamed without changes.
11 changes: 6 additions & 5 deletions src/actions/web3Actions.ts → src/@store/web3/web3Actions.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import * as Sentry from "@sentry/browser";
import { getProfile } from "actions/profilesActions";
import { getWeb3ProviderInfo, getProviderNetworkName } from "arc";
import * as Sentry from "@sentry/browser";
import * as Redux from "redux";

import Analytics from "lib/analytics";
import { ActionTypes, IWeb3State } from "reducers/web3Reducer";

import * as Redux from "redux";
import { IAsyncAction } from "./async";
import { IAsyncAction } from "@store/async";
import { getProfile } from "@store/profiles/profilesActions";
import { ActionTypes, IWeb3State } from "@store/web3/web3Reducer";

export type ConnectAction = IAsyncAction<"WEB3_CONNECT", void, IWeb3State>;

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/arc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NotificationStatus } from "reducers/notifications";
import { NotificationStatus } from "@store/notifications/notifications.reducer";
import { getNetworkId, getNetworkName, targetedNetwork, targetNetworks, Networks } from "./lib/util";
import { settings } from "./settings";
import { Address, Arc } from "@daostack/arc.js";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Account/AccountImage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createDataURL } from "ethereum-blockies-png";
import * as React from "react";
import { IProfileState } from "reducers/profilesReducer";
import { IProfileState } from "@store/profiles/profilesReducer";

import * as css from "./Account.scss";

Expand Down
6 changes: 3 additions & 3 deletions src/components/Account/AccountPopup.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Address, IDAOState, IMemberState } from "@daostack/arc.js";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { getProfile } from "actions/profilesActions";
import { getProfile } from "@store/profiles/profilesActions";
import AccountImage from "components/Account/AccountImage";
import AccountProfileName from "components/Account/AccountProfileName";
import Reputation from "components/Account/Reputation";
Expand All @@ -9,8 +9,8 @@ import withSubscription, { ISubscriptionProps } from "components/Shared/withSubs
import CopyToClipboard, { IconColor } from "components/Shared/CopyToClipboard";
import * as React from "react";
import { connect } from "react-redux";
import { IRootState } from "reducers";
import { IProfileState } from "reducers/profilesReducer";
import { IRootState } from "@store";
import { IProfileState } from "@store/profiles/profilesReducer";

import * as BN from "bn.js";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Account/AccountProfileName.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react";
import { Link } from "react-router-dom";

import { IProfileState } from "reducers/profilesReducer";
import { IProfileState } from "@store/profiles/profilesReducer";

import * as classNames from "classnames";

Expand Down
8 changes: 4 additions & 4 deletions src/components/Account/AccountProfilePage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IDAOState, IMemberState, DAO } from "@daostack/arc.js";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { getProfile, updateProfile } from "actions/profilesActions";
import { getProfile, updateProfile } from "@store/profiles/profilesActions";
import { enableWalletProvider } from "arc";
import classNames from "classnames";
import AccountImage from "components/Account/AccountImage";
Expand All @@ -19,9 +19,9 @@ import { BreadcrumbsItem } from "react-breadcrumbs-dynamic";
import { Helmet } from "react-helmet";
import { connect } from "react-redux";
import { RouteComponentProps } from "react-router-dom";
import { IRootState } from "reducers";
import { showNotification } from "reducers/notifications";
import { IProfileState } from "reducers/profilesReducer";
import { IRootState } from "@store";
import { showNotification } from "@store/notifications/notifications.reducer";
import { IProfileState } from "@store/profiles/profilesReducer";
import { combineLatest, of } from "rxjs";
import Loading from "components/Shared/Loading";
import * as css from "./Account.scss";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Buidlhub/Registration.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as css from "./Registration.scss";
import * as React from "react";
import {connect} from "react-redux";
import { IRootState } from "reducers";
import { IRootState } from "@store";
import cn from "classnames";
import BuidlhubClient, {IBuidlhubClient} from "./BuidlhubClient";

Expand Down
8 changes: 4 additions & 4 deletions src/components/Dao/DaoContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IDAOState, Member, Scheme } from "@daostack/arc.js";
import { getProfilesForAddresses } from "actions/profilesActions";
import { getProfilesForAddresses } from "@store/profiles/profilesActions";
import CreateProposalPage from "components/Proposal/Create";
import ProposalDetailsPage from "components/Proposal/ProposalDetailsPage";
import SchemeContainer from "components/Scheme/SchemeContainer";
Expand All @@ -11,9 +11,9 @@ import { Helmet } from "react-helmet";
import { connect } from "react-redux";
import { Route, RouteComponentProps, Switch } from "react-router-dom";
import { ModalRoute } from "react-router-modal";
import { IRootState } from "reducers";
import { showNotification } from "reducers/notifications";
import { IProfileState } from "reducers/profilesReducer";
import { IRootState } from "@store";
import { showNotification } from "@store/notifications/notifications.reducer";
import { IProfileState } from "@store/profiles/profilesReducer";
import DetailsPageRouter from "components/Scheme/ContributionRewardExtRewarders/DetailsPageRouter";
import { combineLatest, Subscription } from "rxjs";
import DaoSchemesPage from "./DaoSchemesPage";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dao/DaoMember.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import withSubscription, { ISubscriptionProps } from "components/Shared/withSubs
import { fromWei } from "lib/util";
import * as React from "react";
import { Link } from "react-router-dom";
import { IProfileState } from "reducers/profilesReducer";
import { IProfileState } from "@store/profiles/profilesReducer";
import * as css from "./Dao.scss";

interface IProps extends ISubscriptionProps<IMemberState> {
Expand Down
6 changes: 3 additions & 3 deletions src/components/Dao/DaoMembersPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IDAOState, Member } from "@daostack/arc.js";
import { getProfile } from "actions/profilesActions";
import { getProfile } from "@store/profiles/profilesActions";
import Loading from "components/Shared/Loading";
import withSubscription, { ISubscriptionProps } from "components/Shared/withSubscription";
import Analytics from "lib/analytics";
Expand All @@ -10,8 +10,8 @@ import InfiniteScroll from "react-infinite-scroll-component";
import { connect } from "react-redux";
import { RouteComponentProps } from "react-router-dom";
import * as Sticky from "react-stickynode";
import { IRootState } from "reducers";
import { IProfilesState } from "reducers/profilesReducer";
import { IRootState } from "@store";
import { IProfilesState } from "@store/profiles/profilesReducer";

import DaoMember from "./DaoMember";
import * as css from "./Dao.scss";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dao/DaoSchemesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { RouteComponentProps } from "react-router-dom";
import * as Sticky from "react-stickynode";
import { CSSTransition, TransitionGroup } from "react-transition-group";
import { connect } from "react-redux";
import { showNotification } from "reducers/notifications";
import { showNotification } from "@store/notifications/notifications.reducer";
import { combineLatest, Observable, of } from "rxjs";
import { mergeMap } from "rxjs/operators";
import * as css from "./DaoSchemesPage.scss";
Expand Down
2 changes: 1 addition & 1 deletion src/components/DaoCreator/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react";
import { connect } from "react-redux";
import { Prompt } from "react-router-dom";
import { showNotification } from "reducers/notifications";
import { showNotification } from "@store/notifications/notifications.reducer";
import { enableWalletProvider, getWeb3Provider } from "arc";
import { getNetworkName } from "lib/util";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Daos/DaosPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { BreadcrumbsItem } from "react-breadcrumbs-dynamic";
import InfiniteScroll from "react-infinite-scroll-component";
import { connect } from "react-redux";
import { Link } from "react-router-dom";
import { IRootState } from "reducers";
import { IRootState } from "@store";
import { combineLatest, of } from "rxjs";
import { first } from "rxjs/operators";
import cn from "classnames";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Notification/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as classNames from "classnames";
import { copyToClipboard } from "lib/util";
import * as React from "react";
import Linkify from "react-linkify";
import { NotificationStatus, showNotification } from "reducers/notifications";
import { NotificationStatus, showNotification } from "@store/notifications/notifications.reducer";
import Tooltip from "rc-tooltip";
import * as css from "./Notification.scss";

Expand Down
8 changes: 4 additions & 4 deletions src/components/Proposal/ActionButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Address, IDAOState, IProposalOutcome, IProposalStage, IProposalState, IRewardState, Token } from "@daostack/arc.js";
import { executeProposal, redeemProposal, executeCalls } from "actions/arcActions";
import { executeProposal, redeemProposal, executeCalls } from "@store/arc/arcActions";
import { enableWalletProvider } from "arc";
import classNames from "classnames";
import { ActionTypes, default as PreTransactionModal } from "components/Shared/PreTransactionModal";
Expand All @@ -9,9 +9,9 @@ import { Page } from "pages";
import Tooltip from "rc-tooltip";
import * as React from "react";
import { connect } from "react-redux";
import { IRootState } from "reducers";
import { showNotification } from "reducers/notifications";
import { IProfileState } from "reducers/profilesReducer";
import { IRootState } from "@store";
import { showNotification } from "@store/notifications/notifications.reducer";
import { IProfileState } from "@store/profiles/profilesReducer";
import withSubscription, { ISubscriptionProps } from "components/Shared/withSubscription";
import { of, combineLatest, Observable } from "rxjs";
import * as css from "./ActionButton.scss";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react";
import { connect } from "react-redux";
import { IDAOState, ISchemeState, Address } from "@daostack/arc.js";
import { createProposal } from "actions/arcActions";
import { createProposal } from "@store/arc/arcActions";
import { enableWalletProvider } from "arc";
import { ErrorMessage, Field, Form, Formik, FormikProps } from "formik";
import withSubscription, { ISubscriptionProps } from "components/Shared/withSubscription";
Expand All @@ -10,7 +10,7 @@ import TagsSelector from "components/Proposal/Create/SchemeForms/TagsSelector";
import TrainingTooltip from "components/Shared/TrainingTooltip";
import Analytics from "lib/analytics";
import { baseTokenName, supportedTokens, toBaseUnit, tokenDetails, toWei, isValidUrl, isAddress, getArcByDAOAddress, getNetworkByDAOAddress } from "lib/util";
import { showNotification, NotificationStatus } from "reducers/notifications";
import { showNotification, NotificationStatus } from "@store/notifications/notifications.reducer";
import { exportUrl, importUrlValues } from "lib/proposalUtils";
import * as css from "components/Proposal/Create/CreateProposal.scss";
import MarkdownField from "./MarkdownField";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ISchemeState } from "@daostack/arc.js";
import { createProposal } from "actions/arcActions";
import { createProposal } from "@store/arc/arcActions";
import { enableWalletProvider } from "arc";
import { ErrorMessage, Field, Form, Formik, FormikProps, FieldArray } from "formik";
import Analytics from "lib/analytics";
import * as React from "react";
import { connect } from "react-redux";
import { showNotification, NotificationStatus } from "reducers/notifications";
import { showNotification, NotificationStatus } from "@store/notifications/notifications.reducer";
import { baseTokenName, isValidUrl, isAddress, linkToEtherScan, getContractName, toWei, getNetworkByDAOAddress, getArcByDAOAddress, Networks} from "lib/util";
import { exportUrl, importUrlValues } from "lib/proposalUtils";
import TagsSelector from "components/Proposal/Create/SchemeForms/TagsSelector";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import Interweave from "interweave";

import { Action, ActionField, GenericSchemeInfo } from "genericSchemeRegistry";

import { IRootState } from "reducers";
import { NotificationStatus, showNotification } from "reducers/notifications";
import * as arcActions from "actions/arcActions";
import { IRootState } from "@store";
import { NotificationStatus, showNotification } from "@store/notifications/notifications.reducer";
import * as arcActions from "@store/arc/arcActions";

import Analytics from "lib/analytics";
import { isValidUrl, getArcByDAOAddress, getNetworkByDAOAddress } from "lib/util";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import withSubscription, { ISubscriptionProps } from "components/Shared/withSubs
import TagsSelector from "components/Proposal/Create/SchemeForms/TagsSelector";
import TrainingTooltip from "components/Shared/TrainingTooltip";

import { createProposal } from "actions/arcActions";
import { showNotification, NotificationStatus } from "reducers/notifications";
import { createProposal } from "@store/arc/arcActions";
import { showNotification, NotificationStatus } from "@store/notifications/notifications.reducer";
import Analytics from "lib/analytics";
import { isValidUrl, getNetworkByDAOAddress, getArcByAddress, getArcByDAOAddress } from "lib/util";
import { GetSchemeIsActiveActions, getSchemeIsActive, REQUIRED_SCHEME_PERMISSIONS, schemeNameAndAddress, SchemePermissions, schemeNameFromAddress } from "lib/schemeUtils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ISchemeState } from "@daostack/arc.js";
import { createProposal } from "actions/arcActions";
import { createProposal } from "@store/arc/arcActions";
import { enableWalletProvider } from "arc";
import { ErrorMessage, Field, Form, Formik, FormikProps } from "formik";
import Analytics from "lib/analytics";
import * as React from "react";
import { connect } from "react-redux";
import { showNotification, NotificationStatus } from "reducers/notifications";
import { showNotification, NotificationStatus } from "@store/notifications/notifications.reducer";
import { baseTokenName, isValidUrl, getNetworkByDAOAddress, getArcByDAOAddress } from "lib/util";
import { exportUrl, importUrlValues } from "lib/proposalUtils";
import TagsSelector from "components/Proposal/Create/SchemeForms/TagsSelector";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Proposal/Create/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { History } from "history";
import { connect } from "react-redux";
import { RouteComponentProps } from "react-router-dom";
import { IRootState } from "reducers";
import { IRootState } from "@store";
import { of } from "rxjs";

import { Address } from "@daostack/arc.js";
Expand Down
4 changes: 2 additions & 2 deletions src/components/Proposal/ProposalData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import withSubscription, { ISubscriptionProps } from "components/Shared/withSubs
import * as moment from "moment";
import * as React from "react";
import { connect } from "react-redux";
import { IRootState } from "reducers";
import { IRootState } from "@store";
import { closingTime } from "lib/proposalHelpers";
import { IProfileState } from "reducers/profilesReducer";
import { IProfileState } from "@store/profiles/profilesReducer";
import { combineLatest, concat, of, Observable } from "rxjs";
import { map, mergeMap } from "rxjs/operators";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { IDAOState, IProposalState, IProposalType } from "@daostack/arc.js";
import classNames from "classnames";
import { GenericSchemeRegistry } from "genericSchemeRegistry";
import * as React from "react";
import { IProfileState } from "reducers/profilesReducer";
import { IProfileState } from "@store/profiles/profilesReducer";
import * as css from "./ProposalSummary.scss";
import ProposalSummaryContributionReward from "./ProposalSummaryContributionReward";
import ProposalSummaryKnownGenericScheme from "./ProposalSummaryKnownGenericScheme";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import classNames from "classnames";
import AccountPopup from "components/Account/AccountPopup";
import AccountProfileName from "components/Account/AccountProfileName";
import * as React from "react";
import { IProfileState } from "reducers/profilesReducer";
import { IProfileState } from "@store/profiles/profilesReducer";
import RewardsString from "../RewardsString";

import * as css from "./ProposalSummary.scss";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { GenericSchemeInfo } from "genericSchemeRegistry";
import { linkToEtherScan, formatTokens, truncateWithEllipses, getNetworkByDAOAddress } from "lib/util";
import CopyToClipboard from "components/Shared/CopyToClipboard";
import * as React from "react";
import { IProfileState } from "reducers/profilesReducer";
import { IProfileState } from "@store/profiles/profilesReducer";
import * as css from "./ProposalSummary.scss";
import ProposalSummaryDutchX from "./ProposalSummaryDutchX";
import ProposalSummaryStandardBounties from "./ProposalSummaryStandardBounties";
Expand Down
Loading

0 comments on commit 7807cde

Please sign in to comment.