From 18f7d160c8de20ce68665072520c87a764af1db2 Mon Sep 17 00:00:00 2001 From: tylercraig9332 Date: Wed, 30 May 2018 14:38:31 -0400 Subject: [PATCH 1/5] Removed the react controller files because they are already incorperated --- class/Controller/Show/Admin.php | 1 - class/Factory/React.php | 42 --------------------------------- config/react.php | 3 --- 3 files changed, 46 deletions(-) delete mode 100644 class/Factory/React.php delete mode 100644 config/react.php diff --git a/class/Controller/Show/Admin.php b/class/Controller/Show/Admin.php index 53b2ef6..24c6491 100644 --- a/class/Controller/Show/Admin.php +++ b/class/Controller/Show/Admin.php @@ -29,7 +29,6 @@ use Canopy\Request; use slideshow\Factory\NavBar; use slideshow\Factory\ShowFactory; -use slideshow\Factory\React; // Yet to be used. class Admin extends Base { diff --git a/class/Factory/React.php b/class/Factory/React.php deleted file mode 100644 index f8a759b..0000000 --- a/class/Factory/React.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -class React -{ - - public static function view($view_name) - { - static $vendor_included = false; - if (!$vendor_included) { - $script[] = self::getScript('vendor'); - $vendor_included = true; - } - $script[] = self::getScript($view_name); - $react = implode("\n", $script); - $content = << -$react -EOF; - return $content; - } - - public static function getScript($filename) - { - $root_directory = PHPWS_SOURCE_HTTP . 'mod/slideshow/javascript/'; - if (SYSTEMS_REACT_DEV) { - $path = "dev/$filename.js"; - } else { - $path = "build/$filename.js"; - } - $script = ""; - return $script; - } - -} diff --git a/config/react.php b/config/react.php deleted file mode 100644 index 55b363b..0000000 --- a/config/react.php +++ /dev/null @@ -1,3 +0,0 @@ - Date: Thu, 31 May 2018 14:19:04 -0400 Subject: [PATCH 2/5] Fixed an issue where React wasn't rebuilding the right scripts --- exports.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/exports.js b/exports.js index fb17552..a479a6a 100644 --- a/exports.js +++ b/exports.js @@ -3,9 +3,11 @@ exports.APP_DIR = exports.path.resolve(__dirname, 'javascript') exports.entry = { vendor: ['react', 'react-dom'], - /* - ShowList: exports.APP_DIR + '/ShowList/index.jsx', - SlideList: exports.APP_DIR + '/SlideList/index.jsx', - SlideEdit: exports.APP_DIR + '/SlideEdit/index.jsx', - */ + + shows: exports.APP_DIR + '/Show/index.jsx', + /*SlideEdit: exports.APP_DIR + '/Slide/edit.jsx', + Present: exports.APP_DIR + '/Show/Present.jsx', + ShowView: exports.APP_DIR + 'Show/ShowView.jsx', + ShowCard: exports.APP_DIR + 'Show/ShowCard.jsx'*/ + } From db318c69131bfadab27e87d8a5f27b16c6680e0b Mon Sep 17 00:00:00 2001 From: tylercraig9332 Date: Thu, 31 May 2018 14:20:03 -0400 Subject: [PATCH 3/5] Changed Directory for admin view of all the lists. Forgot to add this in the last commit. --- javascript/Show/index.jsx | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 javascript/Show/index.jsx diff --git a/javascript/Show/index.jsx b/javascript/Show/index.jsx new file mode 100644 index 0000000..33f5330 --- /dev/null +++ b/javascript/Show/index.jsx @@ -0,0 +1,7 @@ +'use strict' +import React from 'react' +import ReactDOM from 'react-dom' +import ShowView from './ShowView.jsx' + +ReactDOM.render( + , document.getElementById('ShowView')) From f7acd8e3903a6756ebb34655064c28e6ef2359f2 Mon Sep 17 00:00:00 2001 From: tylercraig9332 Date: Thu, 31 May 2018 14:20:52 -0400 Subject: [PATCH 4/5] Restuctured some more directories --- javascript/Show/{present.jsx => Present.jsx} | 2 +- javascript/index.jsx | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) rename javascript/Show/{present.jsx => Present.jsx} (82%) delete mode 100644 javascript/index.jsx diff --git a/javascript/Show/present.jsx b/javascript/Show/Present.jsx similarity index 82% rename from javascript/Show/present.jsx rename to javascript/Show/Present.jsx index 9f36fb7..df89f6a 100644 --- a/javascript/Show/present.jsx +++ b/javascript/Show/Present.jsx @@ -1,7 +1,7 @@ 'use strict' import React from 'react' -export default class present { +export default class Present { constructor(props) { this.state = { show: new Show(), diff --git a/javascript/index.jsx b/javascript/index.jsx deleted file mode 100644 index 066d582..0000000 --- a/javascript/index.jsx +++ /dev/null @@ -1,7 +0,0 @@ -'use strict' -import React from 'react' -import ReactDOM from 'react-dom' -import ShowView from 'ShowView.jsx' - -ReactDOM.render( - , document.getElementById('ShowList')) From 185fb45288c864b81e3ed1ddbf5344bd193cfc5d Mon Sep 17 00:00:00 2001 From: tylercraig9332 Date: Thu, 31 May 2018 14:21:58 -0400 Subject: [PATCH 5/5] Fixed some bugs with the placement React code for viewing slides. --- class/Controller/Show/Admin.php | 2 +- javascript/Show/ShowCard.jsx | 1 + javascript/Show/ShowList.jsx | 3 ++- javascript/Show/ShowView.jsx | 13 +++++++------ 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/class/Controller/Show/Admin.php b/class/Controller/Show/Admin.php index 24c6491..5fdf3fd 100644 --- a/class/Controller/Show/Admin.php +++ b/class/Controller/Show/Admin.php @@ -47,7 +47,7 @@ public function postCommand(Request $request) protected function listHtmlCommand(Request $request) { $this->createShowButton(); - return $this->factory->scriptView('ShowList'); + return $this->factory->scriptView('shows'); } protected function listJsonCommand(Request $request) diff --git a/javascript/Show/ShowCard.jsx b/javascript/Show/ShowCard.jsx index 8d96623..671699a 100644 --- a/javascript/Show/ShowCard.jsx +++ b/javascript/Show/ShowCard.jsx @@ -1,4 +1,5 @@ import React, {Component} from 'react' + export default class ShowCard extends Component { constructor() { this.state = { diff --git a/javascript/Show/ShowList.jsx b/javascript/Show/ShowList.jsx index 5dbba4f..b66df44 100644 --- a/javascript/Show/ShowList.jsx +++ b/javascript/Show/ShowList.jsx @@ -2,6 +2,7 @@ import React, {Component} from 'react' export default class ShowList extends Component{ constructor() { + super() this.state = { showsList: getShows() } @@ -18,7 +19,7 @@ export default class ShowList extends Component{ ) } else { cards = this.props.shows.map(function (id) { - return + return }.bind(this)) } diff --git a/javascript/Show/ShowView.jsx b/javascript/Show/ShowView.jsx index a0410e5..5fc7bcb 100644 --- a/javascript/Show/ShowView.jsx +++ b/javascript/Show/ShowView.jsx @@ -3,20 +3,21 @@ import React, {Component} from 'react' import ShowList from './ShowList.jsx' export default class ShowView extends Component { - constructor(props) { + constructor() { + super() this.state = {} } - } - render() [ + + render() { return (

Shows:

// TODO: ALl the current shows that are associtaed with the admin user - // will be rendered her somehow... - + // will be rendered here somehow... maybe json of slides +
) - ] + } }