Skip to content

Commit

Permalink
Merge 4.3.11 to master (#527)
Browse files Browse the repository at this point in the history
* Building project icon (#526)
* building construction icon
* new package-lock.json
* fix typo in capital projects details which removed estimated construction timeframe label
* npm audit fixes and comment out firebase issues
* bump version number
  • Loading branch information
fruiz7 authored Aug 26, 2019
1 parent c406239 commit 0499857
Show file tree
Hide file tree
Showing 10 changed files with 2,263 additions and 5,565 deletions.
2 changes: 1 addition & 1 deletion buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ phases:
commands:
- aws cloudfront create-invalidation --distribution-id "${DASHBOARDS_DIST_ID}" --paths '/*'
- aws cloudfront create-invalidation --distribution-id "${SIMPLICITY_DIST_ID}" --paths '/*'
- aws cloudfront create-invalidation --distribution-id "${SIMPLICITY2_DIST_ID}" --paths '/*'
- aws cloudfront create-invalidation --distribution-id "${SIMPLICITY2_DIST_ID}" --paths '/*'
7,647 changes: 2,168 additions & 5,479 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simplicity2",
"version": "4.3.10",
"version": "4.3.11",
"description": "Version 2 of SimpliCity",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -34,7 +34,7 @@
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.16.0",
"css-loader": "^0.28.1",
"css-loader": "^3.2.0",
"eslint": "^4.18.2",
"eslint-config-airbnb": "^16.1.0",
"eslint-loader": "^2.1.0",
Expand All @@ -47,7 +47,7 @@
"sass-loader": "^6.0.3",
"style-loader": "^0.20.3",
"webpack": "3.11.0",
"webpack-cli": "^2.0.12",
"webpack-cli": "^3.3.7",
"webpack-dev-server": "^2.4.5",
"webpack-livereload-plugin": "^2.1.1"
},
Expand Down Expand Up @@ -79,8 +79,8 @@
"data-tree": "^1.2.4",
"dotenv-webpack": "^1.5.4",
"file-loader": "^1.1.11",
"firebase": "^4.3.1",
"firebaseui": "^2.3.0",
"firebase": "^6.4.0",
"firebaseui": "^4.1.0",
"google-maps": "^3.2.1",
"graphql": "0.13.2",
"graphql-tag": "^2.6.1",
Expand Down
109 changes: 55 additions & 54 deletions src/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ const displayNavbar = (hideNavbar) => {
return <CityInfoBar />;
};

const authProviders = [
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
//const authProviders = [
// firebase.auth.GoogleAuthProvider.PROVIDER_ID,
// firebase.auth.EmailAuthProvider.PROVIDER_ID,
];
//];

const initializeFirebaseAuthUI = () => {
// Initialize the FirebaseUI Widget using Firebase.
const authUi = new firebaseui.auth.AuthUI(firebase.auth());
// const initializeFirebaseAuthUI = () => {
// // Initialize the FirebaseUI Widget using Firebase.
// const authUi = new firebaseui.auth.AuthUI(firebase.auth());

// The start method will wait until the DOM is loaded.
authUi.start('#firebaseui-auth-container', {
signInSuccessUrl: '/',
signInOptions: authProviders,
signInFlow: 'popup',
// TODO: Terms of service url.
tosUrl: '<your-tos-url>',
});
};
// // The start method will wait until the DOM is loaded.
// authUi.start('#firebaseui-auth-container', {
// signInSuccessUrl: '/',
// signInOptions: authProviders,
// signInFlow: 'popup',
// // TODO: Terms of service url.
// tosUrl: '<your-tos-url>',
// });
// };

class Main extends React.Component {
constructor(props) {
Expand All @@ -51,47 +51,47 @@ class Main extends React.Component {
}

componentDidMount() {
firebase.initializeApp({
apiKey: 'AIzaSyAEwpGQsTfOhwxUXaLX43FNAPA7BfL4SQ0',
authDomain: 'simplicityii-878be.firebaseapp.com',
databaseURL: 'https://simplicityii-878be.firebaseio.com',
storageBucket: 'simplicityii-878be.appspot.com',
});
// firebase.initializeApp({
// apiKey: 'AIzaSyAEwpGQsTfOhwxUXaLX43FNAPA7BfL4SQ0',
// authDomain: 'simplicityii-878be.firebaseapp.com',
// databaseURL: 'https://simplicityii-878be.firebaseio.com',
// storageBucket: 'simplicityii-878be.appspot.com',
// });

firebase.auth().onAuthStateChanged((user) => {
if (user) {
user.getIdToken().then(
(token) => {
localStorage.setItem('token', token);
this.props.updateUser({
variables: {
loggedIn: true,
privilege: user.email.endsWith('ashevillenc.gov') ? 2 : 1,
name: user.displayName,
email: user.email,
provider: user.providerData[0].providerId,
},
});
},
(error) => {
console.log(`TOKEN ERROR: ${JSON.stringify(error)}`);
}
);
} else {
const defaultUser = defaultAuthState.user;
this.props.updateUser({
variables: {
loggedIn: defaultUser.loggedIn,
privilege: defaultUser.privilege,
name: defaultUser.name,
email: defaultUser.email,
provider: defaultUser.provider,
},
});
}
// firebase.auth().onAuthStateChanged((user) => {
// if (user) {
// user.getIdToken().then(
// (token) => {
// localStorage.setItem('token', token);
// this.props.updateUser({
// variables: {
// loggedIn: true,
// privilege: user.email.endsWith('ashevillenc.gov') ? 2 : 1,
// name: user.displayName,
// email: user.email,
// provider: user.providerData[0].providerId,
// },
// });
// },
// (error) => {
// console.log(`TOKEN ERROR: ${JSON.stringify(error)}`);
// }
// );
// } else {
const defaultUser = defaultAuthState.user;
this.props.updateUser({
variables: {
loggedIn: defaultUser.loggedIn,
privilege: defaultUser.privilege,
name: defaultUser.name,
email: defaultUser.email,
provider: defaultUser.provider,
},
});
// }
// });

initializeFirebaseAuthUI();
// initializeFirebaseAuthUI();
}

render() {
Expand All @@ -108,7 +108,8 @@ class Main extends React.Component {
</ErrorBoundary>
</div>
{!this.props.location.query.hideNavbar && <Footer />}
<AuthProviderModal />
{ //<AuthProviderModal />
}
</LanguageProvider>
</div>
);
Expand Down
4 changes: 4 additions & 0 deletions src/app/capital_projects/CategoryDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
LI_BOLD,
IM_INFO,
IM_DROPLET,
IM_HAMMER,
} from '../../shared/iconConstants';
import LoadingAnimation from '../../shared/LoadingAnimation';
import Error from '../../shared/Error';
Expand Down Expand Up @@ -56,6 +57,8 @@ const getIcon = (type, bond) => {
return <Icon path={IM_SHIELD3} size={25} color="#4077a5" />;
case 'Water':
return <Icon path={IM_DROPLET} size={25} color="#4077a6" />;
case 'Building Construction':
return <Icon path={IM_HAMMER} size={25} color="#4077a6" />;
case 'Other':
return (
<svg
Expand Down Expand Up @@ -180,6 +183,7 @@ const CategoryDetails = props => (
'Housing Program',
'Parks & Recreation',
'Water',
'Building Construction',
'Other'].map((cat, index) => {
if (categories.includes(cat)) {
return (
Expand Down
3 changes: 3 additions & 0 deletions src/app/capital_projects/ProjectsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
IM_BUS,
LI_BOLD,
IM_DROPLET,
IM_HAMMER,
} from '../../shared/iconConstants';
import expandingRows from '../../shared/react_table_hoc/ExpandingRows';
import createFilterRenderer from '../../shared/FilterRenderer';
Expand All @@ -36,6 +37,8 @@ const getIcon = (category, isExpanded) => {
return <Icon path={IM_SHIELD3} size={25} color={isExpanded ? '#fff' : '#4077a5'} />;
case 'Water':
return <Icon path={IM_DROPLET} size={25} color={isExpanded ? '#fff' : '#4077a5'} />;
case 'Building Construction':
return <Icon path={IM_HAMMER} size={25} color={isExpanded ? '#fff' : '#4077a5'} />;
default:
return <svg xmlns="http://www.w3.org/2000/svg" height="25px" transform="translate(0,4)" version="1.1" viewBox="0 0 16 16" width="25px"><g fill="none" fillRule="evenodd" id="Icons with numbers" stroke="none" strokeWidth="1"><g fill={isExpanded ? '#fff' : '#4077a5'} id="Group" transform="translate(-528.000000, -576.000000)"><path d="M536,592 C531.581722,592 528,588.418278 528,584 C528,579.581722 531.581722,576 536,576 C540.418278,576 544,579.581722 544,584 C544,588.418278 540.418278,592 536,592 Z M541,586 C542.10457,586 543,585.10457 543,584 C543,582.89543 542.10457,582 541,582 C539.89543,582 539,582.89543 539,584 C539,585.10457 539.89543,586 541,586 Z M531,586 C532.10457,586 533,585.10457 533,584 C533,582.89543 532.10457,582 531,582 C529.89543,582 529,582.89543 529,584 C529,585.10457 529.89543,586 531,586 Z M536,586 C537.10457,586 538,585.10457 538,584 C538,582.89543 537.10457,582 536,582 C534.89543,582 534,582.89543 534,584 C534,585.10457 534.89543,586 536,586 Z M536,586" id="Oval 12 copy" /></g></g></svg>;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/capital_projects/english.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const english = {
contact_email: 'Contact email',
contact_phone: 'Contact phone',
data_info: 'Some explanation of the data and limitations of the data',
estimated_contruction_timeframe: 'Estimated construction timeframe',
estimated_construction_timeframe: 'Estimated construction timeframe',
funding_info: 'projects within the City’s General Capital Improvement Program (CIP) are funded with a combination of general tax revenue, municipal debt and external grants or partnerships.',
housing_bond_info: 'Housing Bond projects for housing affordability provide additional support for the Housing Trust Fund and other programs that assist in creating diverse and affordable housing choices. The projects also include support in the development of affordable housing on key City-owned sites.',
include_only_bond_projects: 'Include only bond projects',
Expand Down
44 changes: 22 additions & 22 deletions src/gqlClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,27 @@ if (process.env.USE_LOCAL_API === 'true') {

const httpLink = createHttpLink({ uri: SERVER_URL, fetch });

const authLink = setContext(
request =>
new Promise((success, fail) => {
const signedInUser = firebase.auth().currentUser;
if (signedInUser) {
signedInUser.getIdToken(true)
.then((idToken) => {
localStorage.setItem('token', idToken);
success({ headers: {
authorization: idToken,
} });
fail(Error(request.statusText));
});
} else {
success({ headers: {
authorization: localStorage.getItem('token') || null,
} });
fail(Error(request.statusText));
}
})
);
// const authLink = setContext(
// request =>
// new Promise((success, fail) => {
// const signedInUser = firebase.auth().currentUser;
// if (signedInUser) {
// signedInUser.getIdToken(true)
// .then((idToken) => {
// localStorage.setItem('token', idToken);
// success({ headers: {
// authorization: idToken,
// } });
// fail(Error(request.statusText));
// });
// } else {
// success({ headers: {
// authorization: localStorage.getItem('token') || null,
// } });
// fail(Error(request.statusText));
// }
// })
// );

const fragmentMatcher = new IntrospectionFragmentMatcher({
introspectionQueryResultData: fragmentTypes,
Expand All @@ -57,7 +57,7 @@ const stateLink = withClientState({
const aClient = new ApolloClient({
link: ApolloLink.from([
stateLink,
authLink,
//authLink,
httpLink,
]),
cache,
Expand Down
2 changes: 1 addition & 1 deletion src/shared/iconConstants.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ module.exports = {
{
loader: 'css-loader',
options: {
modules: true,
localIdentName: '[path][name]__[local]--[hash:base64:5]',
modules: {
localIdentName: '[path][name]__[local]--[hash:base64:5]',
},
},
},
],
Expand Down

0 comments on commit 0499857

Please sign in to comment.