@plusscommunities/pluss-maintenance-app 1.0.11 → 1.1.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,26 +1,32 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-maintenance-app",
3
- "version": "1.0.11",
3
+ "version": "1.1.2-beta.0",
4
4
  "description": "Extension package to enable maintenance on Pluss Communities Platform",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
7
+ "precore": "npm i @plusscommunities/pluss-core-app@beta",
7
8
  "core": "npm i @plusscommunities/pluss-core-app@latest",
8
- "upload": "npm version patch && npm publish --access public && rm -rf node_modules",
9
- "deploy": "npm run core && npm run upload",
10
- "test": "echo \"Error: no test specified\" && exit 1"
9
+ "prepatch": "npm version prepatch --preid=beta",
10
+ "patch": "npm version patch",
11
+ "preupload": "npm publish --access public --tag beta && rm -rf node_modules",
12
+ "preupload:p": "npm run prepatch && npm run preupload",
13
+ "preupload:cp": "npm run precore && npm run upload:p",
14
+ "upload": "npm publish --access public && rm -rf node_modules",
15
+ "upload:p": "npm run patch && npm run upload",
16
+ "upload:cp": "npm run core && npm run upload:p"
11
17
  },
12
18
  "author": "Phillip Suh",
13
19
  "license": "ISC",
14
20
  "dependencies": {
15
- "@plusscommunities/pluss-core-app": "^1.1.2",
21
+ "@plusscommunities/pluss-core-app": "^1.4.2-beta.0",
16
22
  "axios": "^0.16.2",
17
23
  "lodash": "^4.17.4",
18
24
  "moment": "^2.18.1",
19
- "react": "16.13.1",
20
- "react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
25
+ "react": "17.0.1",
26
+ "react-native": "0.64.3",
21
27
  "react-native-elements": "^0.17.0",
22
28
  "react-native-iphone-x-helper": "^1.3.1",
23
- "react-native-webview": "11.2.3",
29
+ "react-native-webview": "11.15.0",
24
30
  "react-redux": "^5.0.5"
25
31
  },
26
32
  "peerDependencies": {
@@ -1,9 +1,7 @@
1
1
  // import axios from 'axios';
2
2
  // import { getUrl } from './helper';
3
3
  // import { authedFunction } from '../js';
4
- import { PlussCore } from '../feature.config';
5
-
6
- const { Helper, Session } = PlussCore;
4
+ import { Helper, Session } from '../core.config';
7
5
 
8
6
  export const generalActions = {
9
7
  getJob: (site, jobId) => {
@@ -7,9 +7,7 @@ import { generalActions } from '../apis';
7
7
  import { jobsLoaded } from '../actions';
8
8
  import MaintenanceListItem from '../components/MaintenanceListItem';
9
9
  import StatusSelectorPopup from './StatusSelectorPopup';
10
- import { PlussCore } from '../feature.config';
11
-
12
- const { Components, Colours, Config } = PlussCore;
10
+ import { Components, Colours, Config } from '../core.config';
13
11
 
14
12
  const SHOW_ALL_STATUS = 'Show All';
15
13
 
@@ -201,4 +199,4 @@ const mapStateToProps = state => {
201
199
  };
202
200
  };
203
201
 
204
- export default connect(mapStateToProps, { jobsLoaded }, null, { withRef: true })(MaintenanceList);
202
+ export default connect(mapStateToProps, { jobsLoaded }, null, { forwardRef: true })(MaintenanceList);
@@ -17,9 +17,8 @@ import moment from 'moment';
17
17
  // } from '../../js';
18
18
  // import NavigationService from '../../js/NavigationService';
19
19
  import { getJobStatusProps, jobStatusOptions } from '../helper';
20
- import { PlussCore, Services } from '../feature.config';
21
-
22
- const { Helper, Colours } = PlussCore;
20
+ import { Services } from '../feature.config';
21
+ import { Helper, Colours } from '../core.config';
23
22
 
24
23
  class MaintenanceListItem extends Component {
25
24
  onPressJob = () => {
@@ -5,9 +5,8 @@ import { Icon } from 'react-native-elements';
5
5
  import moment from 'moment';
6
6
  import _ from 'lodash';
7
7
  import { getJobStatusProps, jobStatusOptions } from '../helper';
8
- import { PlussCore, Services } from '../feature.config';
9
-
10
- const { Colours, Helper } = PlussCore;
8
+ import { Services } from '../feature.config';
9
+ import { Colours, Helper } from '../core.config';
11
10
 
12
11
  class MaintenanceWidgetItem extends Component {
13
12
  onPressJob = () => {
@@ -2,9 +2,7 @@ import React, { PureComponent } from 'react';
2
2
  import { View, StyleSheet, TouchableOpacity, Text } from 'react-native';
3
3
  import { connect } from 'react-redux';
4
4
  import { jobStatusOptions, getJobStatusColour } from '../helper';
5
- import { PlussCore } from '../feature.config';
6
-
7
- const { Components, Colours } = PlussCore;
5
+ import { Components, Colours } from '../core.config';
8
6
 
9
7
  class StatusSelectorPopup extends PureComponent {
10
8
  render() {
@@ -5,9 +5,8 @@ import _ from 'lodash';
5
5
  import { generalActions } from '../apis';
6
6
  import { jobsLoaded } from '../actions';
7
7
  import MaintenanceWidgetItem from './MaintenanceWidgetItem';
8
- import { PlussCore, Services } from '../feature.config';
9
-
10
- const { Colours, Components, Config } = PlussCore;
8
+ import { Services } from '../feature.config';
9
+ import { Colours, Components, Config } from '../core.config';
11
10
 
12
11
  const MAX_ITEMS = 10;
13
12
 
@@ -147,4 +146,4 @@ const mapStateToProps = state => {
147
146
  };
148
147
  };
149
148
 
150
- export default connect(mapStateToProps, { jobsLoaded }, null, { withRef: true })(WidgetSmall);
149
+ export default connect(mapStateToProps, { jobsLoaded }, null, { forwardRef: true })(WidgetSmall);
@@ -0,0 +1,5 @@
1
+ // import * as PlussCore from '../../pluss-core/src';
2
+ import * as PlussCore from '@plusscommunities/pluss-core-app';
3
+
4
+ const { Apis, Fonts, Actions, ActionTypes, Config, Components, Styles, Session, Helper, Constants, Colours } = PlussCore;
5
+ export { Apis, Fonts, Actions, ActionTypes, Config, Components, Styles, Session, Helper, Constants, Colours };
@@ -1,8 +1,6 @@
1
1
  // import * as PlussCore from '../../pluss-core/src';
2
2
  import * as PlussCore from '@plusscommunities/pluss-core-app';
3
3
 
4
- export { PlussCore };
5
-
6
4
  export const Services = {
7
5
  navigation: null,
8
6
  };
package/src/helper.js CHANGED
@@ -1,6 +1,4 @@
1
- import { PlussCore } from './feature.config';
2
-
3
- const { Colours } = PlussCore;
1
+ import { Colours } from './core.config';
4
2
 
5
3
  const jobStatusOptions = [
6
4
  {
@@ -1,9 +1,8 @@
1
1
  /* eslint-disable no-param-reassign */
2
- import { REHYDRATE } from 'redux-persist/constants';
2
+ import { REHYDRATE } from 'redux-persist';
3
3
  import { JOBS_LOADED, JOB_ADDED } from '../actions/types';
4
- import { PlussCore } from '../feature.config';
4
+ import { ActionTypes } from '../core.config';
5
5
 
6
- const { ActionTypes } = PlussCore;
7
6
  const REDUCER_KEY = 'jobs';
8
7
 
9
8
  const INITIAL_STATE = {
@@ -30,6 +29,7 @@ export default (state = INITIAL_STATE, action) => {
30
29
  }
31
30
  return { ...state, jobs: updateJobs };
32
31
  case REHYDRATE:
32
+ if (!action.payload) return state;
33
33
  if (action.payload[REDUCER_KEY]) {
34
34
  if (action.payload[REDUCER_KEY].jobs == null) {
35
35
  action.payload[REDUCER_KEY].jobs = [];
@@ -3,9 +3,8 @@ import _ from 'lodash';
3
3
  import { TouchableOpacity, View, ScrollView, Text } from 'react-native';
4
4
  import { connect } from 'react-redux';
5
5
  import { Icon } from 'react-native-elements';
6
- import { PlussCore, Services } from '../feature.config';
7
-
8
- const { Components, Colours } = PlussCore;
6
+ import { Services } from '../feature.config';
7
+ import { Components, Colours } from '../core.config';
9
8
 
10
9
  class JobTypePicker extends Component {
11
10
  state = {
@@ -3,9 +3,8 @@ import { View, StyleSheet } from 'react-native';
3
3
  import { connect } from 'react-redux';
4
4
  import _ from 'lodash';
5
5
  import MaintenanceList from '../components/MaintenanceList';
6
- import { PlussCore, Services, BaseComponents } from '../feature.config';
7
-
8
- const { Components, Helper, Styles, Config } = PlussCore;
6
+ import { Services, BaseComponents } from '../feature.config';
7
+ import { Components, Helper, Styles, Config } from '../core.config';
9
8
 
10
9
  class MaintenancePage extends Component {
11
10
  constructor(props) {
@@ -9,9 +9,8 @@ import { generalActions } from '../apis';
9
9
  import { jobAdded } from '../actions';
10
10
  import StatusSelectorPopup from '../components/StatusSelectorPopup';
11
11
  import { jobStatusOptions, getJobStatusProps } from '../helper';
12
- import { PlussCore, Services } from '../feature.config';
13
-
14
- const { Colours, Helper, Components, Config } = PlussCore;
12
+ import { Services } from '../feature.config';
13
+ import { Colours, Helper, Components, Config } from '../core.config';
15
14
 
16
15
  class RequestDetail extends Component {
17
16
  constructor(props) {
@@ -431,6 +430,7 @@ class RequestDetail extends Component {
431
430
  scrollView={this.scrollView}
432
431
  entityType="maintenancerequest"
433
432
  entityId={this.props.job.id}
433
+ entityName={this.props.job.title}
434
434
  site={this.state.job.site || this.state.job.location}
435
435
  // noScroll={true}
436
436
  // style={{ position: 'absolute', bottom: 0, left: 0, right: 0 }}
@@ -7,9 +7,8 @@ import moment from 'moment';
7
7
  import { jobAdded } from '../actions';
8
8
  import { generalActions } from '../apis';
9
9
  import { getBottomSpace } from 'react-native-iphone-x-helper';
10
- import { PlussCore, Services } from '../feature.config';
11
-
12
- const { Components, Colours, Helper } = PlussCore;
10
+ import { Services } from '../feature.config';
11
+ import { Components, Colours, Helper } from '../core.config';
13
12
 
14
13
  class RequestNotes extends Component {
15
14
  constructor(props) {
@@ -17,9 +17,8 @@ import { Icon } from 'react-native-elements';
17
17
  import { connect } from 'react-redux';
18
18
  import { jobAdded } from '../actions';
19
19
  import { generalActions } from '../apis';
20
- import { PlussCore, Services } from '../feature.config';
21
-
22
- const { Components, Colours, Helper, Config } = PlussCore;
20
+ import { Services } from '../feature.config';
21
+ import { Components, Colours, Helper, Config } from '../core.config';
23
22
 
24
23
  const PHOTO_SIZE = (Dimensions.get('window').width - 64) / 3;
25
24
 
@@ -206,7 +205,7 @@ class MaintenanceRequest extends Component {
206
205
  if (this.state.uploadingImage || this.state.submitting) {
207
206
  return;
208
207
  }
209
- this.imageUploader.getWrappedInstance().showUploadMenu();
208
+ this.imageUploader.showUploadMenu();
210
209
  };
211
210
 
212
211
  submit = async () => {