From 017692f9a4664923b42a97c7fd271434c30385ea Mon Sep 17 00:00:00 2001 From: Alex Komoroske Date: Thu, 27 Dec 2018 14:47:42 -0800 Subject: [PATCH] /changes --> /recent. Part of #50. --- src/actions/app.js | 4 ++-- src/actions/{changes.js => recent.js} | 8 ++++---- src/components/compendium-app.js | 4 ++-- src/components/recent-changes-view.js | 10 +++++----- src/reducers/{changes.js => recent.js} | 10 +++++----- 5 files changed, 18 insertions(+), 18 deletions(-) rename src/actions/{changes.js => recent.js} (85%) rename src/reducers/{changes.js => recent.js} (75%) diff --git a/src/actions/app.js b/src/actions/app.js index af0c7d57..bd1d18fb 100644 --- a/src/actions/app.js +++ b/src/actions/app.js @@ -37,7 +37,7 @@ export const navigatePathTo = (path, silent) => (dispatch, getState) => { export const navigateToChangesNumDays = (numDays) => (dispatch) => { if (!numDays) numDays = 1; - dispatch(navigatePathTo('/changes/' + numDays + '/days')); + dispatch(navigatePathTo('/recent/' + numDays + '/days')); } export const navigateToNextCard = () => (dispatch, getState) => { @@ -102,7 +102,7 @@ const loadPage = (pathname) => (dispatch) => { // navigating to view1 after my-view1.js is loaded. }); break; - case 'changes': + case 'recent': import('../components/recent-changes-view.js'); break; case 'maintenance': diff --git a/src/actions/changes.js b/src/actions/recent.js similarity index 85% rename from src/actions/changes.js rename to src/actions/recent.js index fa53df62..bddce632 100644 --- a/src/actions/changes.js +++ b/src/actions/recent.js @@ -1,5 +1,5 @@ -export const UPDATE_CHANGES_CARDS= 'UPDATE_CHANGES_CARDS'; -export const CHANGES_FETCHING='CHANGES_FETCHING'; +export const UPDATE_RECENT_CARDS= 'UPDATE_RECENT_CARDS'; +export const RECENT_FETCHING='RECENT_FETCHING'; import { db, @@ -8,7 +8,7 @@ import { const fetching = (isFetching) => { return { - type: CHANGES_FETCHING, + type: RECENT_FETCHING, isFetching } } @@ -45,7 +45,7 @@ export const fetchRecentChanges = (numDays) => (dispatch, getState) => { const updateChangesCards = (cardsBySection) => { return { - type: UPDATE_CHANGES_CARDS, + type: UPDATE_RECENT_CARDS, cardsBySection } } \ No newline at end of file diff --git a/src/components/compendium-app.js b/src/components/compendium-app.js index 249edb82..3af93779 100644 --- a/src/components/compendium-app.js +++ b/src/components/compendium-app.js @@ -183,7 +183,7 @@ class CompendiumApp extends connect(store)(LitElement) { `)}` : html`Loading...` } - Recent Changes + Recent
${this._devMode ? html`DEVMODE` : ""} @@ -195,7 +195,7 @@ class CompendiumApp extends connect(store)(LitElement) {
- +
diff --git a/src/components/recent-changes-view.js b/src/components/recent-changes-view.js index 56e24b92..2b749eca 100644 --- a/src/components/recent-changes-view.js +++ b/src/components/recent-changes-view.js @@ -5,14 +5,14 @@ import { connect } from 'pwa-helpers/connect-mixin.js'; // This element is connected to the Redux store. import { store } from '../store.js'; -import changes from '../reducers/changes.js'; +import recent from '../reducers/recent.js'; store.addReducers({ - changes + recent }); import { fetchRecentChanges -} from '../actions/changes.js'; +} from '../actions/recent.js'; import { navigateToChangesNumDays, @@ -188,9 +188,9 @@ class RecentChangesView extends connect(store)(PageViewElement) { stateChanged(state) { this._numDays = this.extractPageExtra(state.app.pageExtra); - this._cardsBySection = state.changes.cardsBySection; + this._cardsBySection = state.recent.cardsBySection; this._sections = state.data.sections; - this._fetching = state.changes.fetching; + this._fetching = state.recent.fetching; } updated(changedProps) { diff --git a/src/reducers/changes.js b/src/reducers/recent.js similarity index 75% rename from src/reducers/changes.js rename to src/reducers/recent.js index 6557c45e..fb456ecd 100644 --- a/src/reducers/changes.js +++ b/src/reducers/recent.js @@ -1,7 +1,7 @@ import { - UPDATE_CHANGES_CARDS, - CHANGES_FETCHING -} from '../actions/changes.js'; + UPDATE_RECENT_CARDS, + RECENT_FETCHING +} from '../actions/recent.js'; const INITIAL_STATE = { cardsBySection: {}, @@ -10,13 +10,13 @@ const INITIAL_STATE = { const app = (state = INITIAL_STATE, action) => { switch (action.type) { - case UPDATE_CHANGES_CARDS: + case UPDATE_RECENT_CARDS: return { ...state, cardsBySection: action.cardsBySection, fetching: false } - case CHANGES_FETCHING: + case RECENT_FETCHING: return { ...state, fetching: action.isFetching