#38 Project Structure modification and code splitting
Closed 2 years ago by lbrabec. Opened 3 years ago by divyanshisingh.
fedora-qa/ divyanshisingh/landingpage project-structure-modification  into  master

file modified
+1
@@ -4,6 +4,7 @@ 

    "private": true,

    "homepage": ".",

    "dependencies": {

+     "@reduxjs/toolkit": "^1.5.1",

      "bootstrap": "^4.4.1",

      "dateformat": "^3.0.3",

      "react": "^16.5.2",

file modified
+2 -2
@@ -3,8 +3,8 @@ 

  import { Route, Switch } from 'react-router';

  import { BrowserRouter } from 'react-router-dom'

  

- import Wizard from './wizard/Wizard';

- import LandingPage from './landingpage/LandingPage';

+ import Wizard from './Containers/Wizard';

+ import LandingPage from './Containers/LandingPage';

  import NotFound from './NotFound';

  

  

@@ -0,0 +1,61 @@ 

+ import React, { Component } from "react";

+ import { Row } from "reactstrap";

+ import SourceLink from "../SourceLinks";

+ import Header from "../Header";

+ import Table from "../Table";

+ 

+ class Blockers extends Component {

+   constructor(props) {

+     super(props);

+     this.state = { blockerbugs: {}, release: 0 };

+   }

+ 

+   render() {

+     const { data } = this.props;

+     const tableContentBeta = [

+       ["Proposed Blockers", data.beta_blockers_proposed],

+       ["Accepted Blockers", data.beta_blockers],

+       ["Proposed FEs", data.beta_fe_proposed],

+       ["Accepted FEs", data.beta_fe]

+     ];

+ 

+     const tableContentFinal = [

+       ["Proposed Blockers", data.final_blockers_proposed],

+       ["Accepted Blockers", data.final_blockers],

+       ["Proposed FEs", data.final_fe_proposed],

+       ["Accepted FEs", data.final_fe]

+     ];

+     if (this.props.data)

+       return (

+         <div>

+           <Header

+             headerText={`Fedora ${this.props.release} blockers and FEs`}

+             headerLink="https://qa.fedoraproject.org/blockerbugs/"

+             headerClass="padded"

+           />

+ 

+           <Row>

+             <div className="col-md-6">

+ 							<Table 

+ 								className="events"

+ 								tableHead={['Beta']}

+ 								tableContent={tableContentBeta} 

+ 								customClass="bugscount"

+ 							/>

+             </div>

+ 

+             <div className="col-md-6">

+               <Table

+ 								className="events"

+ 								tableHead={['Final']}

+ 								tableContent={tableContentFinal}

+ 								customClass="bugscount"

+ 							/>

+             </div>

+           </Row>

+         </div>

+       );

+   }

+ }

+ 

+ export default Blockers;

@@ -0,0 +1,15 @@ 

+ import React from 'react';

+ 

+ const EventItems = ({ start, summary, link, info }) => {

+   return (

+     <li key={start + summary}>

+       <b>{start}</b>

+       <br />

+       <a target="_blank" rel="noopener noreferrer" href={link}>

+         {summary}

+       </a>

+       <br />

+     </li>

+   );

+ };

+ export default EventItems;

@@ -0,0 +1,47 @@ 

+ import React, { Component } from "react";

+ import dateFormat from "dateformat";

+ import Header from "../Header";

+ import EventItems from "../EventItems";

+ 

+ class Events extends Component {

+   constructor(props) {

+     super(props);

+     this.state = { meetings: [] };

+   }

+ 

+   render() {

+     const meetings = this.props.data.map(meeting => {

+       const old = new Date(meeting.start);

+       var meeting_start = dateFormat(

+         new Date(old.getTime() - old.getTimezoneOffset() * 60000),

+         "d mmm yyyy - HH:MM"

+       );

+       if (meeting.fullday) {

+         meeting_start = meeting_start.slice(0, -5) + "All day";

+       }

+       return (

+         <EventItems

+           key={meeting_start + meeting.summary}

+           start={meeting_start}

+           summary={meeting.summary}

+           link={meeting.link}

+           info={meeting.info}

+         />

+       );

+     });

+     return (

+       <div>

+         <Header

+           headerText="Meetings and testdays in the next 7 days"

+           headerLink="https://apps.fedoraproject.org/calendar/QA/"

+         />

+ 

+         <ul className="events">{meetings}</ul>

+       </div>

+     );

+   }

+ }

+ 

+ 

+ 

+ export default Events;

@@ -0,0 +1,12 @@ 

+ import React from "react";

+ import SourceLink from "../SourceLinks";

+ 

+ const Header = ({ headerText, headerLink }) => {

+   return (

+     <h1 className="padded">

+       {headerText}

+       {headerLink && <SourceLink href={headerLink} />}

+     </h1>

+   );

+ };

+ export default Header;

src/Components/Hideable/index.js src/landingpage/Hideable.js
file renamed
file was moved with no change to the file
@@ -0,0 +1,17 @@ 

+ import React, {Component} from 'react';

+ 

+ const Line = ({ color, strokeWidth }) => {

+     const lineStyle={

+     stroke: color,

+     strokeWidth,

+ 

+ };

+ 

+       return (

+         <svg width="150" height="20" version="1.1">

+           <line x1="0" y1="50%" x2="100%" y2="50%" style={lineStyle} />

+           <circle cx="50%" cy="50%" r="4" style={lineStyle} fill="#f8f9fa" />

+         </svg>

+       );

+ };

+ export default Line;   

\ No newline at end of file

src/Components/Minutes/index.js src/landingpage/Minutes.js
file renamed
+12 -7
@@ -1,13 +1,18 @@ 

  import React, { Component } from "react"

+ import Header from "../Header";

  

- class Events extends Component {

-   render() {

+ const Minutes = ( props ) => {

+   

      return (

        <div>

-         <h1 className="padded">Fedora QA Meeting Minutes</h1>

+           <Header

+             headerText="Fedora QA Meeting Minutes"

+             headerClass="padded"

+             />

+         

          <div className="events">

-           <a target="_blank" href={this.props.data.link} rel="noopener noreferrer">

-             Latest minutes from {this.props.data.date}

+           <a target="_blank" href={props.data.link} rel="noopener noreferrer">

+             Latest minutes from {props.data.date}

            </a>

            <br />

            Visit{" "}
@@ -22,7 +27,7 @@ 

          </div>

        </div>

      )

-   }

+   

  }

  

- export default Events

+ export default Minutes;

src/Components/SourceLinks/index.js src/landingpage/SourceLink.js
file renamed
file was moved with no change to the file
@@ -0,0 +1,27 @@ 

+ import React from "react";

+ 

+ const Table = ({ className, tableHead, tableContent, customClass }) => {

+   return (

+     <table className={className}>

+       <thead>

+         <tr>

+           {tableHead.map((item, index) => (

+             <td colSpan="2" key={index}>

+               <b>{item}</b>

+             </td>

+           ))}

+         </tr>

+       </thead>

+       <tbody>

+         {tableContent.map((columns, i) => (

+           <tr key={i}>

+             {columns.map(column => (

+               <td className={customClass}>{column}</td>

+             ))}

+           </tr>

+         ))}

+       </tbody>

+     </table>

+   );

+ };

+ export default Table;

src/Components/Timeline/index.js src/landingpage/Timeline.js
file renamed
+10 -32
@@ -1,5 +1,8 @@ 

  import React, { Component } from "react"

- import SourceLink from './SourceLink'

+ import SourceLink from '../SourceLinks'

+ import { get_title } from "./utils";

+ import Line from "../Line";

+ 

  

  class Timeline extends Component {

    constructor(props) {
@@ -7,28 +10,17 @@ 

      this.state = { schedule: [] }

    }

  

-   get_title(summary) {

-     summary = summary.toLowerCase()

-     if (summary.includes("freeze"))

-       return "At the milestone freeze, pushes from the updates-testing to the stable repository are suspended until the release candidate is accepted."

-     if (summary === "rawhide")

-       return "Next Fedora release hasn't been branched yet from rolling release branch."

-     if (summary.includes("branch"))

-       return "Next version of Fedora that was 'branched' from the rolling Rawhide tree and in the future will become the next stable Fedora release."

-     if (summary.includes("release"))

-       return "Release candidate was accepted (violating no milestone criteria) and was released."

-   }

- 

    render() {

-     const line = this.props.data.map((milestone) => {

+     const { data } = this.props;

+     const line = data.map((milestone) => {

        return (

          <td key={"line" + milestone.summary}>

-           <Line color={milestone.current ? "#2371ae" : "#dcdcdc"} />

+           <Line color={milestone.current ? "#2371ae" : "#dcdcdc"} strokeWidth='3' />

          </td>

        )

      })

  

-     const dates = this.props.data.map((milestone) => {

+     const dates = data.map((milestone) => {

        return (

          <td key={"dates" + milestone.summary} width="150">

            <b>{milestone.date}</b>
@@ -36,11 +28,11 @@ 

        )

      })

  

-     const schedule = this.props.data.map((milestone) => {

+     const schedule = data.map((milestone) => {

        return (

          <td

            key={"schedule" + milestone.summary}

-           title={this.get_title(milestone.summary)}

+           title={get_title(milestone.summary)}

            width="150">

            {milestone.summary} <i className="fas fa-question-circle light"></i>

          </td>
@@ -66,19 +58,5 @@ 

    }

  }

  

- class Line extends Component {

-   render() {

-     const lineStyle = {

-       stroke: this.props.color,

-       strokeWidth: "3",

-     }

-     return (

-       <svg width="150" height="20" version="1.1">

-         <line x1="0" y1="50%" x2="100%" y2="50%" style={lineStyle} />

-         <circle cx="50%" cy="50%" r="4" style={lineStyle} fill="#f8f9fa" />

-       </svg>

-     )

-   }

- }

  

  export default Timeline

@@ -0,0 +1,11 @@ 

+ export const get_title = (summary) => {

+     summary = summary.toLowerCase()

+     if (summary.includes("freeze"))

+       return "At the milestone freeze, pushes from the updates-testing to the stable repository are suspended until the release candidate is accepted."

+     if (summary === "rawhide")

+       return "Next Fedora release hasn't been branched yet from rolling release branch."

+     if (summary.includes("branch"))

+       return "Next version of Fedora that was 'branched' from the rolling Rawhide tree and in the future will become the next stable Fedora release."

+     if (summary.includes("release"))

+       return "Release candidate was accepted (violating no milestone criteria) and was released."

+   } 

\ No newline at end of file

@@ -0,0 +1,14 @@ 

+ import { loadData, loadDataResp } from "./reducer";

+ import { fetchAPI } from "../../api/api.common";

+ 

+ export const fetchLandingPageData = () =>  async dispatch => {

+     dispatch(loadData());

+     try{

+         const url = window.env.ORACULUM_API_URL_v1 + "landing_page";

+         const data = await fetchAPI(url);

+         dispatch(loadDataResp(data))

+     } catch(err) {

+         console.error(err);

+     }

+     

+ } 

\ No newline at end of file

src/Containers/LandingPage/index.js src/landingpage/LandingPage.js
file renamed
+8 -8
@@ -1,17 +1,17 @@ 

  import React, { Component } from "react"

  import { Container, Row } from "reactstrap"

  import { Link } from "react-router-dom"

- import Layout from "../layout/Layout"

- import Timeline from "./Timeline"

- import Events from "./Events"

- import Blockers from "./Blockers"

- import Minutes from "./Minutes"

- import Hideable from "./Hideable"

+ import Layout from "../../layout/Layout"

+ import Timeline from "../../Components/Timeline"

+ import Events from "../../Components/Events"

+ import Blockers from "../../Components/Blockers"

+ import Minutes from "../../Components/Minutes"

+ import Hideable from "../../Components/Hideable"

  

  import _ from "lodash"

  

  import { connect } from "react-redux"

- import { loadData } from "../actions/reduxActions"

+ import { fetchLandingPageData } from "./actions"

  

  import Cookies from "universal-cookie"

  
@@ -38,7 +38,7 @@ 

    }

  

    componentDidMount() {

-     this.props.dispatch(loadData())

+     this.props.dispatch(fetchLandingPageData())

    }

  

    toggle_config_mode(e) {

@@ -0,0 +1,28 @@ 

+ import { createSlice } from "@reduxjs/toolkit";

+ 

+ const landingPageReducer = createSlice({

+   name: "landing_page",

+   initialState: {

+     blockerbugs: {},

+     devel: 0,

+     meetings: [],

+     schedule: [],

+     last_qa_meeting: {},

+     stable: 0,

+     config_mode: false,

+     enabled_components: ["events", "blockers", "minutes"],

+ 

+     loading: false

+   },

+   reducers: {

+     loadData(state, action) {

+       if (!state.loading) state.loading = true;

+     },

+     loadDataResp(state, action) {

+       state.loading = false;

+       Object.assign(state, { ...action.payload });

+     }

+   }

+ });

+ export const { loadData, loadDataResp } = landingPageReducer.actions;

+ export default landingPageReducer.reducer;

@@ -0,0 +1,14 @@ 

+ import { loadWizardDataResp, loadWizardData } from './reducer';

+ import { fetchAPI } from '../../api/api.common';

+ 

+ export const fetchWizardData = () => async dispatch => {

+     dispatch(loadWizardData())

+     try{

+         const url = window.env.ORACULUM_API_URL_v1 + "actions/all";

+         const data = await fetchAPI(url);

+         dispatch(loadWizardDataResp(data))

+     } catch(err) {

+         console.error(err);

+     }

+ }

+ 

src/Containers/Wizard/index.js src/wizard/Wizard.js
file renamed
+6 -6
@@ -1,12 +1,12 @@ 

  import React, { Component } from "react"

- import WizardForm from "./WizardForm"

- import Layout from "../layout/Layout"

- import { oraculumApiUrl_v1 } from "../config"

- import Actions from "./Actions"

+ import WizardForm from "../../wizard/WizardForm"

+ import Layout from "../../layout/Layout"

+ import { oraculumApiUrl_v1 } from "../../config"

+ import Actions from "../../wizard/Actions"

  import { Container, Row } from "reactstrap"

  

  import { connect } from "react-redux"

- import { loadWizardData } from "../actions/reduxActions"

+ import { fetchWizardData } from "./actions"

  

  class Wizard extends Component {

    constructor(props) {
@@ -26,7 +26,7 @@ 

          })

        })

  

-     this.props.dispatch(loadWizardData())

+     this.props.dispatch(fetchWizardData())

    }

  

    show_actions(actions) {

@@ -0,0 +1,24 @@ 

+ import { createSlice } from "@reduxjs/toolkit";

+ 

+ const wizardReducer = createSlice({

+   name: "wizard",

+   initialState: {

+     actions: [],

+     providers: [],

+     all_actions: [],

+ 

+     loading: false

+   },

+   reducers: {

+     loadWizardData(state, action) {

+       if (!state.loading) state.loading = true;

+     },

+     loadWizardDataResp(state, action) {

+       state.loading = false;

+       state.providers = action.payload.providers;

+       state.all_actions = action.payload.actions;

+     }

+   }

+ });

+ export const { loadWizardData, loadWizardDataResp } = wizardReducer.actions;

+ export default wizardReducer.reducer;

@@ -0,0 +1,9 @@ 

+ export default class HttpApiCallError extends Error {

+     constructor(message, statusCode) {

+     super(message);

+     this.message = message;

+     this.statusCode = statusCode;

+     this.stack = new Error(message).stack;

+     this.name = 'HttpApiCallError';

+     }

+ } 

\ No newline at end of file

@@ -1,43 +0,0 @@ 

- import ActionTypes from '../constants';

- 

- export const loadDataResp = payload => ({

-     type: ActionTypes.LOAD_DATA_RESP,

-     payload: payload

- })

- 

- export const loadData = payload => dispatch => {

-     dispatch({

-         type: ActionTypes.LOAD_DATA,

-         payload: payload

-     });

- 

-     fetch(window.env.ORACULUM_API_URL_v1 + "landing_page")

-     .then(blob => blob.json())

-     .then(data => {

-         dispatch(loadDataResp(data))

-     })

-     .catch((error) => {

-         console.error('Error:', error);

-     });

- }

- 

- export const loadWizardDataResp = payload => ({

-     type: ActionTypes.LOAD_WIZARD_DATA_RESP,

-     payload: payload

- })

- 

- export const loadWizardData = payload => dispatch => {

-     dispatch({

-         type: ActionTypes.LOAD_WIZARD_DATA,

-         payload: payload

-     });

- 

-     fetch(window.env.ORACULUM_API_URL_v1 + "actions/all")

-     .then(blob => blob.json())

-     .then(data => {

-         dispatch(loadWizardDataResp(data))

-     })

-     .catch((error) => {

-         console.error('Error:', error);

-     });

- }

@@ -0,0 +1,13 @@ 

+ import HttpApiCallError from "../Errors/HttpApiCallError";

+ 

+ export const fetchAPI = async url => {

+     const response = await fetch(url);

+     const responseBody = await response.json();

+     const isSuccess = response.status === 200;

+     if ( isSuccess ) {

+         return responseBody;

+     } 

+     const error = HttpApiCallError(response.statusText, response.status);

+     error.response = response;

+     throw error;

+ } 

\ No newline at end of file

@@ -0,0 +1,19 @@ 

+ import { configureStore, combineReducers } from '@reduxjs/toolkit';

+ import logger from 'redux-logger';

+ import thunkMiddleware from 'redux-thunk';

+ import landingPageReducer from './reducers/landingPageSlice';

+ import wizardReducer from './reducers/wizardSlice';

+ 

+ const reducer = combineReducers({

+     landing_page: landingPageReducer,

+     wizard: wizardReducer

+ })

+ 

+ export default function configureAppStore() {

+     const store = configureStore({

+         reducer,

+         middleware: [ thunkMiddleware, logger ],

+         devTools: process.env.NODE_ENV !== 'production',

+     })

+     return store;

+ }

file modified
+1 -1
@@ -82,7 +82,7 @@ 

  }

  

  .bugscount {

-   padding-left: 2em;

+   padding-right: 2em;

  }

  

  .smallsuper {

file modified
+3 -10
@@ -9,17 +9,10 @@ 

  import App from './App';

  import * as serviceWorker from './serviceWorker';

  

- import { createStore, applyMiddleware } from 'redux'

- import thunkMiddleware from 'redux-thunk'

- import { createLogger } from 'redux-logger'

- import { Provider } from 'react-redux'

- import reducer from './reducers'

+ import { Provider } from 'react-redux';

+ import configureAppStore from './configureStore';

  

- const loggerMiddleware = createLogger();

- const store = createStore(reducer, applyMiddleware(

-   thunkMiddleware,

-   loggerMiddleware

- ));

+ const store= configureAppStore();

  

  ReactDOM.render(

      <React.StrictMode>

@@ -1,85 +0,0 @@ 

- import React, { Component } from "react"

- import { Row } from "reactstrap"

- import SourceLink from "./SourceLink"

- 

- class Blockers extends Component {

-   constructor(props) {

-     super(props)

-     this.state = { blockerbugs: {}, release: 0 }

-   }

- 

-   render() {

-     if (this.props.data)

-       return (

-         <div>

-           <h1 className="padded">

-             Fedora {this.props.release} blockers and FEs{" "}

-             <SourceLink href="https://qa.fedoraproject.org/blockerbugs/" />

-           </h1>

-           <Row>

-             <div className="col-md-6">

-               <table className="events">

-                 <thead>

-                   <tr>

-                     <td colSpan="2">

-                       <b>Beta</b>

-                     </td>

-                   </tr>

-                 </thead>

-                 <tbody>

-                   <tr>

-                     <td>Proposed Blockers</td>

-                     <td className="bugscount">{this.props.data.beta_blockers_proposed}</td>

-                   </tr>

-                   <tr>

-                     <td>Accepted Blockers</td>

-                     <td className="bugscount">{this.props.data.beta_blockers}</td>

-                   </tr>

-                   <tr>

-                     <td>Proposed FEs</td>

-                     <td className="bugscount">{this.props.data.beta_fe_proposed}</td>

-                   </tr>

-                   <tr>

-                     <td>Accepted FEs</td>

-                     <td className="bugscount">{this.props.data.beta_fe}</td>

-                   </tr>

-                 </tbody>

-               </table>

-             </div>

- 

-             <div className="col-md-6">

-               <table className="events">

-                 <thead>

-                   <tr>

-                     <td colSpan="2">

-                       <b>Final</b>

-                     </td>

-                   </tr>

-                 </thead>

-                 <tbody>

-                   <tr>

-                     <td>Proposed Blockers</td>

-                     <td className="bugscount">{this.props.data.final_blockers_proposed}</td>

-                   </tr>

-                   <tr>

-                     <td>Accepted Blockers</td>

-                     <td className="bugscount">{this.props.data.final_blockers}</td>

-                   </tr>

-                   <tr>

-                     <td>Proposed FEs</td>

-                     <td className="bugscount">{this.props.data.final_fe_proposed}</td>

-                   </tr>

-                   <tr>

-                     <td>Accepted FEs</td>

-                     <td className="bugscount">{this.props.data.final_fe}</td>

-                   </tr>

-                 </tbody>

-               </table>

-             </div>

-           </Row>

-         </div>

-       )

-   }

- }

- 

- export default Blockers

@@ -1,58 +0,0 @@ 

- import React, { Component } from "react"

- import dateFormat from "dateformat"

- import SourceLink from './SourceLink'

- 

- class Events extends Component {

-   constructor(props) {

-     super(props)

-     this.state = { meetings: [] }

-   }

- 

-   render() {

-     const meetings = this.props.data.map((meeting) => {

-       const old = new Date(meeting.start)

-       var meeting_start = dateFormat(

-         new Date(old.getTime() - old.getTimezoneOffset() * 60000),

-         "d mmm yyyy - HH:MM"

-       )

-       if (meeting.fullday) {

-         meeting_start = meeting_start.slice(0, -5) + "All day"

-       }

-       return (

-         <Event

-           key={meeting_start + meeting.summary}

-           start={meeting_start}

-           summary={meeting.summary}

-           link={meeting.link}

-           info={meeting.info}

-         />

-       )

-     })

-     return (

-       <div>

-         <h1 className="padded">

-           Meetings and testdays in the next 7 days{" "}

-           <SourceLink href="https://apps.fedoraproject.org/calendar/QA/" />

-         </h1>

-         <ul className="events">{meetings}</ul>

-       </div>

-     )

-   }

- }

- 

- class Event extends Component {

-   render() {

-     return (

-       <li key={this.props.start + this.props.summary}>

-         <b>{this.props.start}</b>

-         <br />

-         <a target="_blank" rel="noopener noreferrer" href={this.props.link}>

-           {this.props.summary}

-         </a>

-         <br />

-       </li>

-     )

-   }

- }

- 

- export default Events

file removed
-44
@@ -1,44 +0,0 @@ 

- import ActionTypes from "../constants"

- 

- const defaultState = {

-   landing_page: {

-     blockerbugs: {},

-     devel: 0,

-     meetings: [],

-     schedule: [],

-     last_qa_meeting: {},

-     stable: 0,

-     config_mode: false,

-     enabled_components: ["events", "blockers", "minutes"],

-   },

-   wizard: {

-     actions: [],

-     providers: [],

-     all_actions: [],

-   },

- }

- 

- export default (state = defaultState, action) => {

-   switch (action.type) {

-     case ActionTypes.LOAD_DATA_RESP:

-       return {

-         ...state,

-         landing_page: action.payload,

-       }

- 

-     case ActionTypes.LOAD_WIZARD_DATA_RESP:

-       return {

-         ...state,

-         wizard: {

-           ...state.wizard,

-           providers: action.payload.providers,

-           all_actions: action.payload.actions,

-         },

-       }

- 

-     default:

-       return {

-         ...state,

-       }

-   }

- }

@@ -0,0 +1,28 @@ 

+ import { createSlice } from "@reduxjs/toolkit";

+ 

+ const landingPageReducer = createSlice({

+   name: "landing_page",

+   initialState: {

+     blockerbugs: {},

+     devel: 0,

+     meetings: [],

+     schedule: [],

+     last_qa_meeting: {},

+     stable: 0,

+     config_mode: false,

+     enabled_components: ["events", "blockers", "minutes"],

+ 

+     loading: false

+   },

+   reducers: {

+     loadData(state, action) {

+       if (!state.loading) state.loading = true;

+     },

+     loadDataResp(state, action) {

+       state.loading = false;

+       Object.assign(state, { ...action.payload });

+     }

+   }

+ });

+ export const { loadData, loadDataResp } = landingPageReducer.actions;

+ export default landingPageReducer.reducer;

@@ -0,0 +1,24 @@ 

+ import { createSlice } from "@reduxjs/toolkit";

+ 

+ const wizardReducer = createSlice({

+   name: "wizard",

+   initialState: {

+     actions: [],

+     providers: [],

+     all_actions: [],

+ 

+     loading: false

+   },

+   reducers: {

+     loadWizardData(state, action) {

+       if (!state.loading) state.loading = true;

+     },

+     loadWizardDataResp(state, action) {

+       state.loading = false;

+       state.providers = action.payload.providers;

+       state.all_actions = action.payload.actions;

+     }

+   }

+ });

+ export const { loadWizardData, loadWizardDataResp } = wizardReducer.actions;

+ export default wizardReducer.reducer;

file modified
+21 -1
@@ -1359,6 +1359,16 @@ 

    resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b"

    integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==

  

+ "@reduxjs/toolkit@^1.5.1":

+   version "1.5.1"

+   resolved "https://registry.yarnpkg.com/@reduxjs/toolkit/-/toolkit-1.5.1.tgz#05daa2f6eebc70dc18cd98a90421fab7fa565dc5"

+   integrity sha512-PngZKuwVZsd+mimnmhiOQzoD0FiMjqVks6ituO1//Ft5UEX5Ca9of13NEjo//pU22Jk7z/mdXVsmDfgsig1osA==

+   dependencies:

+     immer "^8.0.1"

+     redux "^4.0.0"

+     redux-thunk "^2.3.0"

+     reselect "^4.0.0"

+ 

  "@svgr/babel-plugin-add-jsx-attribute@^4.2.0":

    version "4.2.0"

    resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-4.2.0.tgz#dadcb6218503532d6884b210e7f3c502caaa44b1"
@@ -5236,6 +5246,11 @@ 

    resolved "https://registry.yarnpkg.com/immer/-/immer-1.10.0.tgz#bad67605ba9c810275d91e1c2a47d4582e98286d"

    integrity sha512-O3sR1/opvCDGLEVcvrGTMtLac8GJ5IwZC4puPrLuRj3l7ICKvkmA0vGuU9OW8mV9WIBRnaxp5GJh9IEAaNOoYg==

  

+ immer@^8.0.1:

+   version "8.0.4"

+   resolved "https://registry.yarnpkg.com/immer/-/immer-8.0.4.tgz#3a21605a4e2dded852fb2afd208ad50969737b7a"

+   integrity sha512-jMfL18P+/6P6epANRvRk6q8t+3gGhqsJ9EuJ25AXE+9bNTYtssvzeYbEd0mXRYWCmmXSIbnlpz6vd6iJlmGGGQ==

+ 

  import-cwd@^2.0.0:

    version "2.1.0"

    resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9"
@@ -8837,7 +8852,7 @@ 

    resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622"

    integrity sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw==

  

- redux@^4.0.5:

+ redux@^4.0.0, redux@^4.0.5:

    version "4.0.5"

    resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.5.tgz#4db5de5816e17891de8a80c424232d06f051d93f"

    integrity sha512-VSz1uMAH24DM6MF72vcojpYPtrTUu3ByVWfPL1nPfVRb5mZVTve5GnNCUV53QM/BZ66xfWrm0CTWoM+Xlz8V1w==
@@ -9017,6 +9032,11 @@ 

    resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"

    integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=

  

+ reselect@^4.0.0:

+   version "4.0.0"

+   resolved "https://registry.yarnpkg.com/reselect/-/reselect-4.0.0.tgz#f2529830e5d3d0e021408b246a206ef4ea4437f7"

+   integrity sha512-qUgANli03jjAyGlnbYVAV5vvnOmJnODyABz51RdBN7M4WaVu8mecZWgyQNkG8Yqe3KRGRt0l4K4B3XVEULC4CA==

+ 

  resolve-cwd@^2.0.0:

    version "2.0.0"

    resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"

In continuation to my PR https://pagure.io/fedora-qa/landingpage/pull-request/31, this PR addresses the following issues as mentioned by me in (#8) https://pagure.io/fedora-qa/landingpage/issue/8#comment-724084
1) Implemented reusable components to clean up the parent components.
2) Changed folder structure.

1 new commit added

  • common api function, http error handling
3 years ago

1 new commit added

  • wizard component
3 years ago

Hey, @lbrabec can you please review this structure and give me your feedback.

Metadata Update from @lbrabec:
- Pull-request tagged with: review in progress

3 years ago

Project structure looks good.

Please rebase this branch so it uses the commit 8388eaf from #31

2 new commits added

  • rebased
  • redux toolkit implemented
3 years ago

@divyanshisingh Hi, it seems like you got a bit overzealous with the rebasing and commit history restructuring.

I suspect this somewhat comes from the way Pagure throws the wrench into things, combined with the fact that your previous that this one is supposed to be "build upon" PR (#31) is not yet merged.

After carefully inspecting your code, it looks fine, but the commits are just terribly intermingled.

Based on the way your GIT repo looks (here in pagure, not sure about your local machine, of coutse), I suggest following these steps to get a reasonable, working PR:

In your terminal/git bash/whatever console you use for git, go to the directory your git checkout of the landingpage project and run the following:

git checkout  redux-toolkit-reducer-config
git checkout -b project-structure-modification-cleanup
git checkout project-structure-modification
git diff redux-toolkit-reducer-config > ./psmchanges.diff
git checkout project-structure-modification-cleanup
git apply ./psmchanges.diff
rm ./psmchanges.diff
git add -A
git commit -m "Project Structure modification and code splitting"
git push --set-upstream origin project-structure-modification-cleanup

That should give you a new branch in your repo called project-structure-modification-cleanup with the changes from this PR neatly squashed into one commit, and based on the code from the #31.

Once you have that, create a new PR and close this one.

Thanks!

Thanks for PR.

I'll close this one as it incompatible with current code base.

Pull-Request has been closed by lbrabec

2 years ago
Metadata
Changes Summary 31
+1 -0
file changed
package.json
+2 -2
file changed
src/App.js
+61
file added
src/Components/Blockers/index.js
+15
file added
src/Components/EventItems/index.js
+47
file added
src/Components/Events/index.js
+12
file added
src/Components/Header/index.js
+0 -0
file renamed
src/landingpage/Hideable.js
src/Components/Hideable/index.js
+17
file added
src/Components/Line/index.js
+12 -7
file renamed
src/landingpage/Minutes.js
src/Components/Minutes/index.js
+0 -0
file renamed
src/landingpage/SourceLink.js
src/Components/SourceLinks/index.js
+27
file added
src/Components/Table/index.js
+10 -32
file renamed
src/landingpage/Timeline.js
src/Components/Timeline/index.js
+11
file added
src/Components/Timeline/utils.js
+14
file added
src/Containers/LandingPage/actions.js
+8 -8
file renamed
src/landingpage/LandingPage.js
src/Containers/LandingPage/index.js
+28
file added
src/Containers/LandingPage/reducer.js
+14
file added
src/Containers/Wizard/actions.js
+6 -6
file renamed
src/wizard/Wizard.js
src/Containers/Wizard/index.js
+24
file added
src/Containers/Wizard/reducer.js
+9
file added
src/Errors/HttpApiCallError.js
-43
file removed
src/actions/reduxActions.js
+13
file added
src/api/api.common.js
+19
file added
src/configureStore.js
+1 -1
file changed
src/index.css
+3 -10
file changed
src/index.js
-85
file removed
src/landingpage/Blockers.js
-58
file removed
src/landingpage/Events.js
-44
file removed
src/reducers/index.js
+28
file added
src/reducers/landingPageSlice.js
+24
file added
src/reducers/wizardSlice.js
+21 -1
file changed
yarn.lock