Skip to content

Commit

Permalink
resolve conflicts with master
Browse files Browse the repository at this point in the history
  • Loading branch information
ashfahan committed Dec 16, 2020
2 parents f2919e4 + 4da7a8c commit 17e8c5b
Show file tree
Hide file tree
Showing 77 changed files with 8,801 additions and 371 deletions.
1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@opensrp/server-service": "^0.0.12",
"@opensrp/store": "^0.0.7",
"@opensrp/user-management": "^0.1.9",
"@opensrp/form-config": "^0.0.6",
"antd": "^4.6.3",
"bootstrap": "^4.5.2",
"client-oauth2": "^4.3.3",
Expand Down
85 changes: 85 additions & 0 deletions client/src/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ import {
URL_LOCATION_UNIT_GROUP_ADD,
URL_LOCATION_UNIT_GROUP_EDIT,
URL_LOCATION_UNIT_EDIT,
URL_UPLOAD_JSON_VALIDATOR,
URL_JSON_VALIDATOR_LIST,
URL_UPLOAD_DRAFT_FILE,
URL_DRAFT_FILE_LIST,
URL_MANIFEST_RELEASE_LIST,
} from '../constants';
import { providers } from '../configs/settings';
import ConnectedHeader from '../containers/ConnectedHeader';
Expand Down Expand Up @@ -69,6 +74,14 @@ import {
URL_USER_CREATE,
URL_USER_CREDENTIALS,
} from '@opensrp/user-management';
import {
AntdUploadForm,
AntdFilesList,
ROUTE_PARAM_FORM_ID,
AntdDraftFileList,
AntdReleaseList,
ROUTE_PARAM_FORM_VERSION,
} from '@opensrp/form-config';
import ConnectedHomeComponent from '../containers/pages/Home/Home';
import './App.css';
import ConnectedSidebar from '../containers/ConnectedSidebar';
Expand All @@ -81,6 +94,12 @@ import {
import '@opensrp/product-catalogue/dist/index.css';
import {
productCatalogueProps,
jsonValidatorListProps,
jsonValidatorFormProps,
draftFormProps,
draftListProps,
releaseListProps,
releaseViewProps,
plansListProps,
planEditProps,
planCreateProps,
Expand All @@ -89,6 +108,7 @@ import {
completedPlansListStatusProp,
trashPlansListStatusProp,
} from './utils';

import '@opensrp/plan-form/dist/index.css';

const { Content } = Layout;
Expand Down Expand Up @@ -291,6 +311,71 @@ const App: React.FC = () => {
path={`${URL_USER_CREDENTIALS}/:${ROUTE_PARAM_USER_ID}`}
component={ConnectedUserCredentials}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
component={LocationUnitView}
path={URL_UPLOAD_JSON_VALIDATOR}
component={AntdUploadForm.UploadForm}
{...jsonValidatorFormProps}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={`${URL_UPLOAD_JSON_VALIDATOR}/:${ROUTE_PARAM_FORM_ID}`}
component={AntdUploadForm.UploadForm}
{...jsonValidatorFormProps}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={URL_JSON_VALIDATOR_LIST}
component={AntdFilesList.FileList}
{...jsonValidatorListProps}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={URL_UPLOAD_DRAFT_FILE}
component={AntdUploadForm.UploadForm}
{...draftFormProps}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={`${URL_UPLOAD_DRAFT_FILE}/:${ROUTE_PARAM_FORM_ID}`}
component={AntdUploadForm.UploadForm}
{...draftFormProps}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={URL_DRAFT_FILE_LIST}
component={AntdDraftFileList.DrafFileList}
{...draftListProps}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={URL_MANIFEST_RELEASE_LIST}
component={AntdReleaseList.ReleaseList}
{...releaseListProps}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={`${URL_MANIFEST_RELEASE_LIST}/:${ROUTE_PARAM_FORM_VERSION}`}
component={AntdFilesList.FileList}
{...releaseViewProps}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
Expand Down
39 changes: 38 additions & 1 deletion client/src/App/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import {
URL_UPLOAD_JSON_VALIDATOR,
URL_JSON_VALIDATOR_LIST,
URL_DRAFT_FILE_LIST,
URL_UPLOAD_DRAFT_FILE,
URL_MANIFEST_RELEASE_LIST,
} from '../constants';
import { interventionType, status, activities, PlanStatus } from '@opensrp/plan-form-core';
import { PlanFormFieldsKeys } from '@opensrp/plan-form';

Expand All @@ -17,6 +24,36 @@ export const productCatalogueProps = {
baseURL: OPENSRP_API_BASE_URL,
};

export const jsonValidatorListProps = {
uploadFileURL: URL_UPLOAD_JSON_VALIDATOR,
isJsonValidator: true,
};

export const jsonValidatorFormProps = {
isJsonValidator: true,
onSaveRedirectURL: URL_JSON_VALIDATOR_LIST,
};

export const draftFormProps = {
isJsonValidator: false,
onSaveRedirectURL: URL_DRAFT_FILE_LIST,
};

export const draftListProps = {
uploadFileURL: URL_UPLOAD_DRAFT_FILE,
onMakeReleaseRedirectURL: URL_MANIFEST_RELEASE_LIST,
};

export const releaseListProps = {
uploadFileURL: URL_UPLOAD_DRAFT_FILE,
viewReleaseURL: URL_MANIFEST_RELEASE_LIST,
};

export const releaseViewProps = {
uploadFileURL: URL_UPLOAD_DRAFT_FILE,
isJsonValidator: false,
};

export const plansListProps = {
baseURL: OPENSRP_API_BASE_URL,
};
Expand Down Expand Up @@ -45,7 +82,7 @@ export const planCreateProps = {
export const planEditProps = {
...planCreateEditProps,
hiddenFields: [interventionType, activities],
}
};
export const activePlansListStatusProp = {
allowedPlanStatus: PlanStatus.ACTIVE,
};
Expand Down
41 changes: 33 additions & 8 deletions client/src/components/page/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ import {
URL_TEAMS,
URL_LOCATION_UNIT,
USER_MANAGEMENT,
URL_JSON_VALIDATOR_LIST,
URL_DRAFT_FILE_LIST,
URL_MANIFEST_RELEASE_LIST,
FORM_CONFIGURATIONS,
MANIFEST_RELEASES,
DRAFT_FILES,
JSON_VALIDATORS,
LOCATIONS,
USERS,
ADMIN,
ACTIVE,
Expand All @@ -28,7 +36,12 @@ import {
MISSIONS,
} from '../../../constants';
import { CATALOGUE_LIST_VIEW_URL } from '@opensrp/product-catalogue';
import { ENABLE_LOCATIONS, ENABLE_PLANS, ENABLE_PRODUCT_CATALOGUE } from '../../../configs/env';
import {
ENABLE_FORM_CONFIGURATION,
ENABLE_PLANS,
ENABLE_LOCATIONS,
ENABLE_PRODUCT_CATALOGUE,
} from '../../../configs/env';
import {
ACTIVE_PLANS_LIST_VIEW_URL,
DRAFT_PLANS_LIST_VIEW_URL,
Expand Down Expand Up @@ -108,13 +121,6 @@ export const SidebarComponent: React.FC<SidebarProps> = (props: SidebarProps) =>
</Link>
</Menu.Item>
)}
{ENABLE_PLANS && (
<Menu.Item key="plans">
<Link to={PLANS_LIST_VIEW_URL} className="admin-link">
{PLANS}
</Link>
</Menu.Item>
)}
{ENABLE_LOCATIONS && (
<Menu.SubMenu key="admin-locations" title="Locations">
<Menu.Item key="locations-unit">
Expand All @@ -129,6 +135,25 @@ export const SidebarComponent: React.FC<SidebarProps> = (props: SidebarProps) =>
</Menu.Item>
</Menu.SubMenu>
)}
{ENABLE_FORM_CONFIGURATION && (
<Menu.SubMenu key="admin-form-config" title={FORM_CONFIGURATIONS}>
<Menu.Item key="admin-form-config-releases">
<Link to={URL_MANIFEST_RELEASE_LIST} className="admin-link">
{MANIFEST_RELEASES}
</Link>
</Menu.Item>
<Menu.Item key="admin-form-config-drafts">
<Link to={URL_DRAFT_FILE_LIST} className="admin-link">
{DRAFT_FILES}
</Link>
</Menu.Item>
<Menu.Item key="admin-form-config-json-validators">
<Link to={URL_JSON_VALIDATOR_LIST} className="admin-link">
{JSON_VALIDATORS}
</Link>
</Menu.Item>
</Menu.SubMenu>
)}
</Menu.SubMenu>
</Menu>
</Layout.Sider>
Expand Down
3 changes: 3 additions & 0 deletions client/src/configs/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ export const ACTION_UUID_NAMESPACE =
export const DEFAULT_PLAN_VERSION = process.env.REACT_APP_DEFAULT_PLAN_VERSION || '1';

export const TASK_GENERATION_STATUS = process.env.REACT_APP_TASK_GENERATION_STATUS || 'internal';

/** Activate form configuration */
export const ENABLE_FORM_CONFIGURATION = process.env.REACT_APP_ENABLE_FORM_CONFIGURATION === 'true';
9 changes: 9 additions & 0 deletions client/src/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export const LOCATIONS_UNIT = 'Locations unit';
export const LOCATIONS_UNIT_GROUP = 'Locations unit group';
export const PRODUCT_CATALOGUE = 'Product Catalogue';
export const ERROR_OCCURRED = 'An error occurred';
export const MANIFEST_RELEASES = 'Manifest Releases';
export const DRAFT_FILES = 'Draft Files';
export const JSON_VALIDATORS = 'JSON Validators';
export const FORM_CONFIGURATIONS = 'Form Configurations';
export const PLANS = 'Plans';
export const ACTIVE = 'Active';
export const DRAFT = 'Draft';
Expand All @@ -34,3 +38,8 @@ export const URL_LOCATION_UNIT_EDIT = '/location/unit/edit/:id';
export const URL_LOCATION_UNIT_GROUP = '/location/group';
export const URL_LOCATION_UNIT_GROUP_ADD = '/location/group/add';
export const URL_LOCATION_UNIT_GROUP_EDIT = '/location/group/edit/:id';
export const URL_UPLOAD_JSON_VALIDATOR = '/json-validators/upload';
export const URL_JSON_VALIDATOR_LIST = '/json-validators';
export const URL_DRAFT_FILE_LIST = '/drafts';
export const URL_UPLOAD_DRAFT_FILE = '/drafts/upload';
export const URL_MANIFEST_RELEASE_LIST = '/releases';
Loading

0 comments on commit 17e8c5b

Please sign in to comment.