Skip to content

Commit

Permalink
Merge pull request #55 from vinzdeveloper/master
Browse files Browse the repository at this point in the history
Upgraded font awesome icon version and bug fixes
  • Loading branch information
vinzdeveloper authored Dec 27, 2022
2 parents b1ad106 + dcc588e commit f07abcb
Show file tree
Hide file tree
Showing 15 changed files with 3,224 additions and 5,629 deletions.
8,773 changes: 3,177 additions & 5,596 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"@babel/preset-env": "7.20.2",
"@babel/preset-react": "7.18.6",
"@babel/runtime": "7.20.1",
"@fortawesome/fontawesome-svg-core": "6.2.1",
"@fortawesome/free-solid-svg-icons": "6.2.1",
"@fortawesome/react-fontawesome": "0.2.0",
"babel": "6.23.0",
"babel-loader": "9.1.0",
"babel-plugin-transform-class-properties": "6.24.1",
Expand Down
1 change: 0 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { render } from 'react-dom';
import configureStore from './store';
import { Provider } from 'react-redux';
import ApplicationContainer from './containers/app/app-container';
require('../node_modules/font-awesome/css/font-awesome.css');


const store = configureStore();
Expand Down
7 changes: 5 additions & 2 deletions src/components/decisions/decision-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import 'font-awesome/css/font-awesome.min.css';
import SweetAlert from 'react-bootstrap-sweetalert';
import { transformRuleToTree } from '../../utils/transform';
import ViewAttribute from '../attributes/view-attributes';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faPenToSquare, faTrash } from '@fortawesome/free-solid-svg-icons';

class DecisionDetails extends Component {

Expand Down Expand Up @@ -127,13 +129,14 @@ class DecisionDetails extends Component {
}

renderConditions = (conditions, decisionIndex) => {

const transformedData = transformRuleToTree(conditions);

return (<div className="rule-flex-container">
{ transformedData && transformedData.map((data, caseIndex) => (<div className="decision-box" key={`case - ${caseIndex} - ${decisionIndex}`}>
<div className="tool-flex">
<div><a href="" onClick={(e) => this.editCondition(e, data.index)}><span className="fa fa-edit" /></a></div>
<div><a href="" onClick={((e) => this.handleRemoveCondition(e, data.index))}><span className="fa fa-trash-o" /></a></div>
<div><a href="" onClick={(e) => this.editCondition(e, data.index)}><FontAwesomeIcon icon={faPenToSquare} /></a></div>
<div><a href="" onClick={((e) => this.handleRemoveCondition(e, data.index))}><FontAwesomeIcon icon={faTrash} /></a></div>
</div>
<Tree treeData={data.node} count={data.depthCount}/>
{ data.event.params && <div className="view-params-container">
Expand Down
2 changes: 2 additions & 0 deletions src/components/navigation/navigation-link.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { createHashHistory } from 'history';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

const NavLinks = (props) => {
const { links } = props;
Expand Down Expand Up @@ -31,6 +32,7 @@ const NavParentLink = ({ link, onConfirm, index, visible }) => {
<li className={link.linkClass} onClick={(e) => onConfirm(e, index, link.navigate)}>
<a href="" className={`link ${visible ? 'active': ''}`} >
<span className={link.iconClass} />
{link.fontIcons && <FontAwesomeIcon icon={link.fontIcons} />}
<span className="text">{link.name}</span>
</a>
</li>);
Expand Down
12 changes: 8 additions & 4 deletions src/components/navigation/navigation-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import { createHashHistory } from 'history';
import FooterLinks from '../footer/footer';
import footerLinks from '../../data-objects/footer-links.json';
import AppearanceContext from '../../context/apperance-context';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faBars, faSquarePlus, faCloudArrowUp, faSliders } from '@fortawesome/free-solid-svg-icons';

const navmenu = [{ name: 'Create Rules', navigate: './create-ruleset', iconClass: "icon fa fa-plus-square-o", linkClass: 'navmenu'},
{ name: 'Upload Rules', navigate: './home', iconClass: "icon fa fa-cloud-upload", linkClass: 'navmenu' },
{ name: 'Appearance', navigate: './appearance', iconClass: "icon fa fa-sliders", linkClass: 'navmenu'} ];
const navmenu = [{ name: 'Create Rules', navigate: './create-ruleset', iconClass: "icon", fontIcons: faSquarePlus, linkClass: 'navmenu'},
{ name: 'Upload Rules', navigate: './home', iconClass: "icon", fontIcons: faCloudArrowUp, linkClass: 'navmenu' },
{ name: 'Appearance', navigate: './appearance', iconClass: "icon", fontIcons: faSliders, linkClass: 'navmenu'} ];
class NavigationPanel extends Component {

constructor(props) {
Expand Down Expand Up @@ -44,7 +46,9 @@ class NavigationPanel extends Component {
return (
<div className={`nav-container ${closedState ? 'closed': 'open'} ${appctx.background}`}>
<div className="menu-bar">
<a href="" onClick={(e) => { e.preventDefault(); this.props.updateState(sideNav)}}> <span className="close-icon fa fa-reorder" ></span></a>
<a href="" onClick={(e) => { e.preventDefault(); this.props.updateState(sideNav)}}>
<FontAwesomeIcon className="close-icon" icon={faBars}></FontAwesomeIcon>
</a>
</div>
{!closedState && <div className="links-section">
<div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/title/page-title.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'

const PageTitle = ({name, titleFlag}) => {

Expand All @@ -25,7 +26,7 @@ PageTitle.propTypes = {
export const TitleIcon = ({iconClass}) => {

return (<div className="icon-card">
<span className={iconClass} />
<FontAwesomeIcon icon={iconClass} />
</div>);
};

Expand Down
2 changes: 1 addition & 1 deletion src/containers/app/app-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ApplicationContainer extends Component {
document.body.className = value;
this.setState({ theme });
}
this.state = {theme: { background: 'md-blue', toggleBackground: this.toggleBackground }};
this.state = {theme: { background: 'light', toggleBackground: this.toggleBackground }};
}

componentDidMount() {
Expand Down
3 changes: 2 additions & 1 deletion src/containers/home/home-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { includes } from 'lodash/collection';
import Notification from '../../components/notification/notification';
import { RULE_AVAILABLE_UPLOAD, RULE_UPLOAD_ERROR } from '../../constants/messages';
import ApperanceContext from '../../context/apperance-context';
import { faCloudArrowUp } from '@fortawesome/free-solid-svg-icons'


function readFile(file, cb) {
Expand Down Expand Up @@ -137,7 +138,7 @@ class HomeContainer extends Component {
return <div className="home-container">
<div className="single-panel-container">
{ (fileExist || uploadError) && <Notification body={message.body} heading={message.heading} type={message.type} /> }
<TitlePanel title={title} titleClass="fa fa-cloud-upload">
<TitlePanel title={title} titleClass={faCloudArrowUp}>
<div className="upload-panel">
<div className={`drop-section ${appctx.background}`} onDrop={this.drop} onDragOver={this.allowDrop}>
<div><label htmlFor="uploadFile">Choose Ruleset directory<input id="uploadFile" type="file" onChange={this.chooseDirectory} webkitdirectory="true" multiple/></label> or Drop Files</div>
Expand Down
3 changes: 2 additions & 1 deletion src/containers/ruleset/create-ruleset-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { createHashHistory } from 'history';
import { addRuleset } from '../../actions/ruleset';
import Notification from '../../components/notification/notification';
import { RULE_AVAILABLE_CREATE } from '../../constants/messages';
import { faSquarePlus } from '@fortawesome/free-solid-svg-icons'

class CreateRulesetContainer extends Component {

Expand Down Expand Up @@ -43,7 +44,7 @@ class CreateRulesetContainer extends Component {
return (
<div className="single-panel-container">
{ fileExist && <Notification body={message.body} heading={message.heading} type={message.type} /> }
<TitlePanel title="Create Rules" titleClass="fa fa-plus-square-o">
<TitlePanel title="Create Rules" titleClass={faSquarePlus}>
<form>
<div className="upload-panel">
<InputField label="Name" onChange={this.onChangeName} value={this.state.name} error={this.state.error.name} />
Expand Down
10 changes: 10 additions & 0 deletions src/sass/components/attributes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ td.attributes-header {
padding: 10px;
}

.md-blue {
.view-attribute {
color: $form-label-color-drk;
}
}

.dark {
color: $form-label-color-drk;
}

.view-params-container {
width: 40%;
color: $dark-color;
Expand Down
4 changes: 4 additions & 0 deletions src/sass/theme/dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ body.dark
color: $page-title-color-dark;
}

h4 {
color: $title-color-drk;
}

a {
color: $form-label-color-drk;
}
Expand Down
4 changes: 4 additions & 0 deletions src/sass/theme/light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ body.light {
color: $page-title-color;
}

h4 {
color: $form-label-color;
}

.tab {
color: $form-label-color;

Expand Down
4 changes: 4 additions & 0 deletions src/sass/theme/md-blue.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ body.md-blue
color: $page-title-color-dark;
}

h4 {
color: $form-label-color-drk;
}

a {
color: $form-label-color-drk;
}
Expand Down
22 changes: 0 additions & 22 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,6 @@ module.exports = (env, arg) => ({
use: ['babel-loader'],
exclude: /node_modules/,
},
/* {
test: /\.(jpe|jpg)(\?.*$|$)/,
loader: 'file-loader',
options: {
name: '[path][name].[ext]',
}
},
/*{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: [{
loader: "url-loader",
options: {
limit: 10000,
mimetype: 'application/font-woff',
name: '[path][name].[ext]'
}
}]
// loader: "url-loader?limit=10000&mimetype=application/font-woff",
// options: {
// name: '[path][name].[ext]',
// }
}, */
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "url-loader",
Expand Down

0 comments on commit f07abcb

Please sign in to comment.