From 8c434b812cf708fa3cf18f099f1db94b53ef0016 Mon Sep 17 00:00:00 2001 From: Josef Skladanka Date: Jan 11 2019 11:32:49 +0000 Subject: Easyfix wizard - basic structure --- diff --git a/src/ActionItems.js b/src/ActionItems.js index a9c969a..6b5a263 100644 --- a/src/ActionItems.js +++ b/src/ActionItems.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { FedoraManualTesting} from './Actions'; +import { FedoraManualTesting, Easyfix} from './Actions'; import { Card, CardHeader, CardBody, UncontrolledCollapse, Button } from 'reactstrap'; class FedoraManualTestingItemsList_sub3 extends Component { @@ -65,7 +65,7 @@ class FedoraManualTestingItemsList_sub1 extends Component { {l1} - Show me the testcases! + Show me! @@ -83,6 +83,85 @@ class FedoraManualTestingItemsList extends Component { } } + +class EasyfixItemsList_sub3 extends Component { + render() { + return(this.props.data.map(action => (
  • ))) + } +} + + +class EasyfixItemsList_sub1 extends Component { + render() { + var subsections = Object.keys(this.props.data); + var title = this.props.title; + if (subsections.length > 1){ + subsections = Object.keys(this.props.data).map(k => { + + var subtoggler = "subtoggler_"+title+"_"+k; + subtoggler = subtoggler.replace(/[\W_]+/g,"_"); + + return( + + + {k} + Show me! + + + + {this.props.data[k][0].extra_data.description} +
      + +
    +
    +
    +
    ); + } + ); + } + else{ + title = title + '/' + subsections[0]; + subsections = Object.keys(this.props.data).map(k => ( +
    + {this.props.data[k][0].extra_data.description} +
      + +
    +
    + ) + ); + } + + var toggler="toggle_"+title; + toggler = toggler.replace(/[\W_]+/g,"_"); + + return( + + + {title} + Show me! + + + + {subsections} + + + ); + } +} + + +class EasyfixItemsList extends Component { + render() { + let sections = Object.keys(this.props.data).map(k => ()); + return(
    {sections}
    ) + } +} + + + + export { - FedoraManualTestingItemsList + FedoraManualTestingItemsList, + EasyfixItemsList } diff --git a/src/WizardForm.js b/src/WizardForm.js index 484e9a0..0942443 100644 --- a/src/WizardForm.js +++ b/src/WizardForm.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Easyfix, durationString } from './Actions'; -import { FedoraManualTestingItemsList} from './ActionItems'; +import { FedoraManualTestingItemsList, EasyfixItemsList} from './ActionItems'; import { Form, FormGroup, Label, Input, Button } from 'reactstrap'; import { groupBy } from 'lodash'; @@ -87,10 +87,6 @@ class WizardForm extends Component { }) } - render_action(action) { - if (action.provider === "easyfix") return () - } - render_actions(){ var grouped = groupBy(this.state.actions, action => action.provider); var outdata = []; @@ -105,17 +101,18 @@ class WizardForm extends Component { console.log(s); outdata.push(); } + else if (k === 'easyfix'){ + var s = {}; + var by_repo_org = groupBy(grouped[k], action => action.extra_data.repo_org); + for (let l in by_repo_org){ + var by_project = groupBy(by_repo_org[l], action => action.extra_data.repo_name); + s[l] = by_project; + } + console.log(s); + outdata.push(); + } else{ - outdata.push( -
      - { - this.state.actions.map(a => { - return (
    • {this.render_action(a)}
    • ) - } - ) - } -
    - ) + outdata.push(No activities found for the defined filter) } } return outdata