diff --git a/boost/updates/update_01.00.00.sql b/boost/updates/update_01.00.00.sql index a5108725..bff583b0 100644 --- a/boost/updates/update_01.00.00.sql +++ b/boost/updates/update_01.00.00.sql @@ -1,8 +1,3 @@ - --reason for admin stop that only they see - --reason for stop that user sees - --Warning, Stop - --name to check sup on flag - --see about having this as Admin Setting CREATE TABLE intern_special_host( id INT NOT NULL, admin_message VARCHAR NOT NULL, @@ -14,20 +9,16 @@ CREATE TABLE intern_special_host( PRIMARY KEY(id) ); ---overall host name ---flag to show if a new host or one that is awaiting approval 0=not approved 1=approve 2=awaiting CREATE TABLE intern_host ( id INT NOT NULL, host_name VARCHAR NOT NULL, - host_condition INT REFERENCES intern_special_host(id), + host_condition INT DEFAULT NULL REFERENCES intern_special_host(id), host_condition_date VARCHAR, host_approve_flag INT NOT NULL DEFAULT 2, host_notes VARCHAR, PRIMARY KEY(id) ); ---sub name of host that will contain the address information ---flag to show if a new host or one that is awaiting approval 0=not approved 1=approve 2=awaiting CREATE TABLE intern_sub_host ( id INT NOT NULL, main_host_id INT REFERENCES intern_host(id), @@ -39,17 +30,16 @@ CREATE TABLE intern_sub_host ( province VARCHAR, country VARCHAR, other_name VARCHAR, - sub_condition INT REFERENCES intern_special_host(id), + sub_condition INT DEFAULT NULL REFERENCES intern_special_host(id), sub_condition_date VARCHAR, sub_approve_flag INT NOT NULL DEFAULT 2, sub_notes VARCHAR, PRIMARY KEY(id) ); ---be able to handle old and new sups CREATE TABLE intern_supervisor( id INT NOT NULL, - host_id INT REFERENCES intern_host(id), + host_id INT DEFAULT NULL REFERENCES intern_host(id), supervisor_first_name VARCHAR NULL, supervisor_last_name VARCHAR NULL, supervisor_title VARCHAR NULL, @@ -66,7 +56,6 @@ CREATE TABLE intern_supervisor( PRIMARY KEY(id) ); ---agency_id keep for old records for now ALTER TABLE intern_internship ADD COLUMN supervisor_id INT; ALTER TABLE intern_internship ADD COLUMN host_id INT; ALTER TABLE intern_internship ADD COLUMN host_sub_id INT; diff --git a/class/Command/HostRest.php b/class/Command/HostRest.php index 6cd4ecb9..8317e16f 100644 --- a/class/Command/HostRest.php +++ b/class/Command/HostRest.php @@ -58,7 +58,7 @@ public function get() { $sql = "SELECT id, host_name, host_condition, host_approve_flag FROM intern_host WHERE host_approve_flag = 2 ORDER BY host_name ASC"; } else if(isset($_REQUEST['Condition'])){ $sql = "SELECT intern_host.id, host_name, host_condition, host_approve_flag, host_condition_date, host_notes, admin_message, intern_special_host.id AS con_id - FROM intern_host JOIN intern_special_host ON intern_host.host_condition = intern_special_host.id WHERE host_condition IS NOT NULL ORDER BY host_name ASC"; + FROM intern_host LEFT JOIN intern_special_host ON intern_host.host_condition = intern_special_host.id ORDER BY host_name ASC"; } else if(isset($_REQUEST['Waiting'])){ if($_REQUEST['Waiting']){ $sql = "SELECT id, host_name, host_condition, host_approve_flag FROM intern_host WHERE host_approve_flag != 0 ORDER BY host_name ASC"; diff --git a/class/Command/SubRest.php b/class/Command/SubRest.php index 58d04d88..827a7cd5 100644 --- a/class/Command/SubRest.php +++ b/class/Command/SubRest.php @@ -56,12 +56,12 @@ public function get() { if($_REQUEST['domestic']=='true'){ $Main = $_REQUEST['main']; $State = $_REQUEST['location']; - $sql = "SELECT id, main_host_id, sub_name, sub_condition FROM intern_sub_host WHERE main_host_id = :main AND state = :state ORDER BY sub_name ASC"; + $sql = "SELECT id, main_host_id, sub_name, sub_condition FROM intern_sub_host WHERE main_host_id = :main AND state = :state AND sub_approve_flag != 0 ORDER BY sub_name ASC"; $arr = array('main' => $Main, 'state'=>$State); } else if($_REQUEST['domestic']=='false'){ $Main = $_REQUEST['main']; $Country = $_REQUEST['location']; - $sql = "SELECT id, main_host_id, sub_name, sub_condition FROM intern_sub_host WHERE main_host_id = :main AND country = :country ORDER BY sub_name ASC"; + $sql = "SELECT id, main_host_id, sub_name, sub_condition FROM intern_sub_host WHERE main_host_id = :main AND country = :country AND sub_approve_flag != 0 ORDER BY sub_name ASC"; $arr = array('main' => $Main, 'country'=>$Country); } } else if(isset($_REQUEST['Conditions'])){ diff --git a/class/EditInternshipFormView.php b/class/EditInternshipFormView.php index 8910ec49..cc824d6b 100644 --- a/class/EditInternshipFormView.php +++ b/class/EditInternshipFormView.php @@ -128,7 +128,7 @@ public function buildInternshipForm() { /********************* * Copy to Next Term * *********************/ - if($this->intern->getStateName() != 'DeniedState'){ + if($this->intern->getStateName() != 'DeniedState' && \Current_User::allow('intern', 'create_internship')){ // Get next three terms $term = TermFactory::getTermByTermCode($this->intern->getTerm()); @@ -164,6 +164,8 @@ public function buildInternshipForm() { if(sizeof($this->tpl['CONTINUE_TERM_LIST']) == 0) { $this->tpl['CONTINUE_TERM_NO_TERMS'] = 'No future terms available.'; } + } else if(!\Current_User::allow('intern', 'create_internship')){ + $this->tpl['CONTINUE_TERM_NO_TERMS'] = 'You do not have permission to create new internships.'; } else{ $this->tpl['CONTINUE_TERM_NO_TERMS'] = 'No future terms available.'; } diff --git a/class/SubHostFactory.php b/class/SubHostFactory.php index 131e5d7b..74ea6aad 100644 --- a/class/SubHostFactory.php +++ b/class/SubHostFactory.php @@ -158,8 +158,8 @@ public static function getSubHostCond($m_host_id, $state, $country) { if ($country == 'US') { $stmt = $db->prepare("SELECT ish.id, ish.sub_name FROM intern_sub_host AS ish LEFT JOIN intern_special_host AS isp ON ish.sub_condition=isp.id - WHERE ish.state=:state AND ish.main_host_id=:m_host_id - AND (ish.sub_condition IS null OR isp.stop_level<>'Stop')"); + WHERE ish.state=:state AND ish.main_host_id=:m_host_id AND ish.sub_approve_flag != 0 + AND (ish.sub_condition IS null OR isp.stop_level<>'Stop') ORDER BY ish.sub_name ASC"); $stmt->execute(array('state' => $state, 'm_host_id' => $m_host_id)); $stmt->setFetchMode(\PDO::FETCH_ASSOC); @@ -167,8 +167,8 @@ public static function getSubHostCond($m_host_id, $state, $country) { } else { $stmt = $db->prepare("SELECT ish.id, ish.sub_name FROM intern_sub_host AS ish LEFT JOIN intern_special_host AS isp ON ish.sub_condition=isp.id - WHERE ish.country=:country AND ish.main_host_id=:m_host_id - AND (ish.sub_condition IS null OR isp.stop_level<>'Stop')"); + WHERE ish.country=:country AND ish.main_host_id=:m_host_id AND ish.sub_approve_flag != 0 + AND (ish.sub_condition IS null OR isp.stop_level<>'Stop') ORDER BY ish.sub_name ASC"); $stmt->execute(array('country' => $country, 'm_host_id' => $m_host_id)); $stmt->setFetchMode(\PDO::FETCH_ASSOC); diff --git a/class/Supervisor.php b/class/Supervisor.php index d8339ab5..1909c7fd 100644 --- a/class/Supervisor.php +++ b/class/Supervisor.php @@ -132,29 +132,25 @@ public function getSupervisorFullName(){ * Get the domestic looking address of supervisor. */ public function getSuperAddress(){ - if($this->address_same_flag == 1){ - return $this->getAddress(); - }else{ - $add = array(); - if(!empty($this->supervisor_address)){ - $add[] = $this->supervisor_address . ','; - } - if(!empty($this->supervisor_city)){ - $add[] = $this->supervisor_city . ','; - } - if(!empty($this->supervisor_state)){ - $add[] = $this->supervisor_state; - } - if(!empty($this->supervisor_zip)){ - $add[] = $this->supervisor_zip; - } - - if(!empty($this->supervisor_country)){ - $add[] = $this->supervisor_country; - } - - return implode(' ', $add); + $add = array(); + if(!empty($this->supervisor_address)){ + $add[] = $this->supervisor_address . ','; } + if(!empty($this->supervisor_city)){ + $add[] = $this->supervisor_city . ','; + } + if(!empty($this->supervisor_state)){ + $add[] = $this->supervisor_state; + } + if(!empty($this->supervisor_zip)){ + $add[] = $this->supervisor_zip; + } + + if(!empty($this->supervisor_country)){ + $add[] = $this->supervisor_country; + } + + return implode(' ', $add); } public function getId(){ diff --git a/class/WorkflowState/CancelledState.php b/class/WorkflowState/CancelledState.php index 6aeb6d31..952aea7b 100644 --- a/class/WorkflowState/CancelledState.php +++ b/class/WorkflowState/CancelledState.php @@ -23,7 +23,7 @@ class CancelledState extends WorkflowState { const friendlyName = 'Cancelled'; - const sortIndex = 8; + const sortIndex = 9; public function getAllowedPermissionList(){ return array('cancel', 'reinstate'); diff --git a/class/WorkflowState/DeanApprovedGradState.php b/class/WorkflowState/DeanApprovedGradState.php index 579ebd80..dca8f76e 100644 --- a/class/WorkflowState/DeanApprovedGradState.php +++ b/class/WorkflowState/DeanApprovedGradState.php @@ -23,7 +23,7 @@ class DeanApprovedGradState extends WorkflowState { const friendlyName = 'Dean Approved / Pending Graduate School Aproval'; - const sortIndex = 10; + const sortIndex = 5; public function getAllowedPermissionList(){ return array('grad_school_approve', 'register', 'oied_certify', 'distance_ed_register'); diff --git a/class/WorkflowState/DeniedState.php b/class/WorkflowState/DeniedState.php index 0248895d..3c0f617b 100644 --- a/class/WorkflowState/DeniedState.php +++ b/class/WorkflowState/DeniedState.php @@ -23,7 +23,7 @@ class DeniedState extends WorkflowState { const friendlyName = 'Denied'; - const sortIndex = 9; + const sortIndex = 10; public function getAllowedPermissionList(){ return array('special_host'); diff --git a/class/WorkflowState/GradSchoolApprovedState.php b/class/WorkflowState/GradSchoolApprovedState.php index 9d6b2b45..7b473604 100644 --- a/class/WorkflowState/GradSchoolApprovedState.php +++ b/class/WorkflowState/GradSchoolApprovedState.php @@ -23,7 +23,7 @@ class GradSchoolApprovedState extends WorkflowState { const friendlyName = 'Graduate School Approved / Pending Registration'; - const sortIndex = 5; + const sortIndex = 6; public function getAllowedPermissionList(){ return array('grad_school_approve', 'register', 'oied_certify', 'distance_ed_register'); diff --git a/class/WorkflowState/RegisteredState.php b/class/WorkflowState/RegisteredState.php index d573e099..0c13b6e6 100644 --- a/class/WorkflowState/RegisteredState.php +++ b/class/WorkflowState/RegisteredState.php @@ -23,7 +23,7 @@ class RegisteredState extends WorkflowState { const friendlyName = 'Registered'; - const sortIndex = 6; + const sortIndex = 7; public function getAllowedPermissionList(){ return array('register'); diff --git a/class/WorkflowState/RegistrationIssueState.php b/class/WorkflowState/RegistrationIssueState.php index f8281d58..a7f98488 100644 --- a/class/WorkflowState/RegistrationIssueState.php +++ b/class/WorkflowState/RegistrationIssueState.php @@ -23,7 +23,7 @@ class RegistrationIssueState extends WorkflowState { const friendlyName = 'Registration Issue'; - const sortIndex = 7; + const sortIndex = 8; public function getAllowedPermissionList(){ return array('grad_school_approve', 'register', 'oied_certify', 'distance_ed_register'); diff --git a/contrib/importHost.php b/contrib/importHost.php index 553997b5..aee26a11 100755 --- a/contrib/importHost.php +++ b/contrib/importHost.php @@ -60,7 +60,7 @@ function createHost($name){ if($id_result){ $id_result = pg_fetch_row($id_result); $id = $id_result[0]; - $sql = "INSERT INTO intern_host (id, host_name) VALUES ($id, '$name')"; + $sql = "INSERT INTO intern_host (id, host_name, host_approve_flag) VALUES ($id, '$name', 1)"; $result = pg_query($sql); if($result === false){ echo "failed to insert host\n\n"; diff --git a/contrib/importSubHost.php b/contrib/importSubHost.php index 974fc063..e2738872 100755 --- a/contrib/importSubHost.php +++ b/contrib/importSubHost.php @@ -47,6 +47,7 @@ $values['zip'] = $line[5]; $values['province'] = $line[6]; $values['country'] = $line[7]; + $values['sub_approve_flag'] = 1; $intern_result = createSubHost($db, $values); diff --git a/contrib/importUpdateIntern.php b/contrib/importUpdateIntern.php new file mode 100755 index 00000000..437e98f5 --- /dev/null +++ b/contrib/importUpdateIntern.php @@ -0,0 +1,74 @@ +#!/usr/bin/php +. + * + * Copyright 2011-2018 Appalachian State University + */ + + +require_once('cliCommon.php'); +require_once('dbConnect.php'); + +ini_set('display_errors', 1); +ini_set('ERROR_REPORTING', E_WARNING); +error_reporting(E_ALL); + +$args = array('input_file'=>''); +$switches = array(); +check_args($argc, $argv, $args, $switches); + +// Open input and output files +$inputFile = fopen($args['input_file'], 'r'); + +if($inputFile === FALSE){ + die("Could not open input file.\n"); + exit; +} + +$db = connectToDb(); + +if(!$db){ + die('Could not connect to database.\n'); +} + +// Parse CSV input into fields line by line +while(($line = fgetcsv($inputFile, 0, '|')) !== FALSE) { + foreach($line as $key=>$element){ + $line[$key] = pg_escape_string($element); + } + $arrIn = $line[0]; + $new = explode(',', $arrIn); + $len = count($new); + $host = $new[$len-2]; + $subHost = $new[$len-1]; + array_pop($new); + array_pop($new); + $internships = implode("','",$new); + $internship = "'".$internships."'"; + + $sql = "UPDATE intern_internship SET host_id=$host, host_sub_id=$subHost WHERE id IN ($internship)"; + + $result = pg_query($sql); + + if($result === false){ + echo $sql . "\n\n"; + echo pg_last_error() . "\n\n"; + } +} + +pg_close($db); +fclose($inputFile); diff --git a/javascript/specialHost/ApproveHost.jsx b/javascript/specialHost/ApproveHost.jsx index 2801a487..c428d884 100644 --- a/javascript/specialHost/ApproveHost.jsx +++ b/javascript/specialHost/ApproveHost.jsx @@ -78,7 +78,7 @@ class ModalFormHost extends React.Component {

{this.props.main}

- +
@@ -111,14 +111,18 @@ class ModalFormHost extends React.Component {
- {conData}
-
+
@@ -276,14 +280,18 @@ class ModalFormHostCondition extends React.Component {
- {conData}
-
+
@@ -393,53 +401,23 @@ class ShowHostCon extends React.Component { this.props.handleSave(host); // Call parent's handleSave method } render(){ - let readDate = new Date(this.props.date*1000).toLocaleDateString(); + let readDate = null + if(this.props.date > 1577876400){ + readDate = new Date(this.props.date*1000).toLocaleDateString(); + } else{ readDate = ' '} + let apFlag = null + if(this.props.flag === 0){apFlag = 'Not Approved'} + else if(this.props.flag === 1){apFlag = 'Approved'} + else{apFlag = 'Waiting'} return (
  • -
    {this.props.name}
    +
    {this.props.name}
    {this.props.condition}
    {readDate}
    -
    {this.props.notes}
    -
    -
  • - - ); - } -} - -class ShowSubCon extends React.Component { - constructor(props){ - super(props); - this.state = {showModal: false}; - - this.closeModal = this.closeModal.bind(this); - this.openModal = this.openModal.bind(this); - this.handleSaveHost = this.handleSaveHost.bind(this); - } - closeModal() { - this.setState({ showModal: false }); - } - openModal() { - this.setState({ showModal: true }); - } - handleSaveHost(host){ - this.closeModal(); // Close the modal box - this.props.handleSave(host); // Call parent's handleSave method - } - render(){ - return ( -
  • - -
    -
    {this.props.main}
    -
    {this.props.name}
    -
    {this.props.address}
    -
    {this.props.city}
    -
    {this.props.state}
    -
    {this.props.condition}
    -
    {this.props.notes}
    +
    {apFlag}
    +
    {this.props.notes}
  • @@ -531,12 +509,19 @@ class AllHostList extends React.Component { this.state = { mainData: null, + mainDisplayData: null, approveData: null, hostConData: null, - subConData: null, + hostDisplayData: null, conditionData: null, hostData: null, - showAddModal: false + showAddModal: false, + searchName: '', + sortBy: '', + showFilter: '', + searchHostName: '', + sortHostBy: '', + showHostFilter: '' }; this.openAddModal = this.openAddModal.bind(this); @@ -546,10 +531,19 @@ class AllHostList extends React.Component { this.handleApproveSave = this.handleApproveSave.bind(this); this.handleSwitchSave = this.handleSwitchSave.bind(this); this.handleHostConSave = this.handleHostConSave.bind(this); + this.onSearchListChange = this.onSearchListChange.bind(this); + this.onSortByChange = this.onSortByChange.bind(this); + this.onShow = this.onShow.bind(this); + this.onSearchHostListChange = this.onSearchHostListChange.bind(this); + this.onSortByHostChange = this.onSortByHostChange.bind(this); + this.onHostShow = this.onHostShow.bind(this); + this.viewShowFilter = this.viewShowFilter.bind(this) + this.updateDisplayData = this.updateDisplayData.bind(this); } componentWillMount() { this.getData(); this.getHostConData() + this.getMainData() } openAddModal() { this.setState({ showAddModal: true }); @@ -582,18 +576,6 @@ class AllHostList extends React.Component { console.error(this.props.url, status, err.toString()); }.bind(this) }); - $.ajax({ - url: 'index.php?module=intern&action=SubRest&Conditions=true', - type: 'GET', - dataType: 'json', - success: function(data) { - this.setState({subConData: data}); - }.bind(this), - error: function(xhr, status, err) { - alert("Failed to grab sub host data.") - console.error(this.props.url, status, err.toString()); - }.bind(this) - }); $.ajax({ url: 'index.php?module=intern&action=ConditionRest', type: 'GET', @@ -606,12 +588,14 @@ class AllHostList extends React.Component { console.error(this.props.url, status, err.toString()); }.bind(this) }); + } + getMainData(){ $.ajax({ url: 'index.php?module=intern&action=SubRest', type: 'GET', dataType: 'json', success: function(data) { - this.setState({mainData: data}); + this.setState({mainData: data, mainDisplayData: data}); }.bind(this), error: function(xhr, status, err) { alert("Failed to grab all host data.") @@ -625,7 +609,7 @@ class AllHostList extends React.Component { type: 'GET', dataType: 'json', success: function(data) { - this.setState({hostConData: data}); + this.setState({hostConData: data, hostDisplayData: data}); }.bind(this), error: function(xhr, status, err) { alert("Failed to grab wating approval data.") @@ -643,9 +627,8 @@ class AllHostList extends React.Component { country: host.country, other: host.other, condition: host.condition, flag: host.flag, }), success: function(data) { - // Grabs the new data - //this.setState({mainData: data}); - },//.bind(this), + this.getMainData() + }.bind(this), error: function(xhr, status, err) { alert("Failed to save host data.") } @@ -715,6 +698,148 @@ class AllHostList extends React.Component { } }); } + onSearchListChange(e) { + var name = null; + name = e.target.value.toLowerCase(); + this.setState({searchName: name}); + this.updateDisplayData(name, this.state.sortBy, this.state.showFilter, this.state.mainData, 'mainDisplayData'); + } + onSearchHostListChange(e) { + var name = null; + name = e.target.value.toLowerCase(); + this.setState({searchHostName: name}); + this.updateDisplayData(name, this.state.sortHostBy, this.state.showHostFilter, this.state.hostConData, 'hostDisplayData'); + } + searchListByName(data, nameToSearch, display) { + var filtered = []; + // Looks for the name by filtering the mainData + for (var i = 0; i < data.length; i++) { + var item = data[i]; + // Make the item, name lowercase for easier searching + if (display === 'mainDisplayData' && item.sub_name.toLowerCase().includes(nameToSearch)) { + filtered.push(item); + } + if (display === 'hostDisplayData' && item.host_name.toLowerCase().includes(nameToSearch)) { + filtered.push(item); + } + } + return filtered; + } + onSortByChange(e) { + var sort = null; + sort = e.target.value; + this.setState({sortBy: sort}); + this.updateDisplayData(this.state.searchName, sort, this.state.showFilter, this.state.mainData, 'mainDisplayData'); + } + onSortByHostChange(e) { + var sort = null; + sort = e.target.value; + this.setState({sortHostBy: sort}); + this.updateDisplayData(this.state.searchHostName, sort, this.state.showHostFilter, this.state.hostConData, 'hostDisplayData'); + } + sortBy(unsorted, typeOfSort) { + var sorted = []; + switch(typeOfSort) { + case 'subA': + sorted = unsorted.sort(function (a, b) { + if (a.sub_name.toLowerCase() < b.sub_name.toLowerCase()) return -1; + if (a.sub_name.toLowerCase() > b.sub_name.toLowerCase()) return 1; + return 0; + }); + break; + case 'subZ': + sorted = unsorted.sort(function (a, b) { + if (a.sub_name.toLowerCase() > b.sub_name.toLowerCase()) return -1; + if (a.sub_name.toLowerCase() < b.sub_name.toLowerCase()) return 1; + return 0; + }); + break; + case 'hostA': + sorted = unsorted.sort(function (a,b) { + if (a.host_name.toLowerCase() < b.host_name.toLowerCase()) return -1; + if (a.host_name.toLowerCase() > b.host_name.toLowerCase()) return 1; + return 0; + }); + break; + case 'hostZ': + sorted = unsorted.sort(function (a,b) { + if (a.host_name.toLowerCase() > b.host_name.toLowerCase()) return -1; + if (a.host_name.toLowerCase() < b.host_name.toLowerCase()) return 1; + return 0; + }); + break; + default: + sorted = unsorted; + } + return sorted; + + } + onShow(e) { + var option = null; + option = e.target.value; + this.setState({showFilter: option}); + this.updateDisplayData(this.state.searchName, this.state.sortBy, option, this.state.mainData, 'mainDisplayData'); + + } + onHostShow(e) { + var option = null; + option = e.target.value; + this.setState({showHostFilter: option}); + this.updateDisplayData(this.state.searchHostName, this.state.sortHostBy, option, this.state.hostConData, 'hostDisplayData'); + + } + viewShowFilter(data, filter) { + var filtered = []; + for (var i = 0; i < data.length; i++) { + var item = data[i]; + if (filter === 'condition') { + if (typeof(item.sub_condition) === 'number') { + filtered.push(item); + } + } + else if (filter === 'conditions') { + if (typeof(item.host_condition) === 'number') { + filtered.push(item); + } + } + else if (filter === 'approved') { + if (item.host_approve_flag === 1) { + filtered.push(item); + } + } + else { + filtered.push(item); + } + } + return filtered; + + } + updateDisplayData(typedName, sort, showFilter, data, display) { + var filtered = []; + + // First filters data. + if (showFilter !== null) { + filtered = this.viewShowFilter(data, showFilter); + } else { + filtered = data; + } + + // Second searches list for name. + if (typedName !== null) { + filtered = this.searchListByName(filtered, typedName, display); + } + + // Third sorts list. + if (sort !== null) { + filtered = this.sortBy(filtered, sort); + } else { + filtered = this.sortBy(filtered, 'hostA'); + } + + if(display === 'mainDisplayData'){this.setState({mainDisplayData: filtered});} + else{this.setState({hostDisplayData: filtered});} + + } render() { var ApproveData = null; if (this.state.approveData != null && this.state.hostData != null && this.state.conditionData != null) { @@ -730,7 +855,7 @@ class AllHostList extends React.Component { var HostConData = null; if (this.state.hostConData != null && this.state.conditionData != null) { - HostConData = this.state.hostConData.map(function (host) { + HostConData = this.state.hostDisplayData.map(function (host) { return ( @@ -740,19 +865,6 @@ class AllHostList extends React.Component { HostConData =

    Loading Host With Conditions...

    ; } - var SubConData = null; - if (this.state.subConData != null && this.state.conditionData != null) { - SubConData = this.state.subConData.map(function (host) { - return ( - - ); - }.bind(this)); - } else { - SubConData =

    Loading Host With Conditions...

    ; - } - var ConditionData = null; if (this.state.conditionData != null) { ConditionData = this.state.conditionData.map(function (host) { @@ -767,7 +879,7 @@ class AllHostList extends React.Component { var HostData = null; if (this.state.mainData != null) { - HostData = this.state.mainData.map(function (host) { + HostData = this.state.mainDisplayData.map(function (host) { return ( {ApproveData} -

    -
    -
    -

    Hosts With Conditions

    -
    -
    -
    - - - - - - - - - -
    NameConditionCondition AddedNotes
    -
      - {HostConData} -
    -
    -

    -
    -
    -

    Sub Hosts With Conditions

    -
    -
    -
    - - - - - - - - - - - - -
    NameSubAddressCityStateConditionNotes
    -
      - {SubConData} -
    -


    @@ -857,10 +924,103 @@ class AllHostList extends React.Component { {ConditionData}
    +

    +
    +
    +

    Hosts

    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    + + + + + + + + + + +
    NameConditionCondition ChangedApprovalNotes
    +
    +
      + {HostConData} +
    +
    +


    -

    All Hosts

    +

    Sub Host

    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    +
    + + +
    @@ -877,13 +1037,18 @@ class AllHostList extends React.Component {
    -
      - {HostData} -
    +
    +
      + {HostData} +
    +
    ); } } +const containerStyle = { + overflowY: 'scroll', height: 600, scrollbarWidth: 'thin' +} ReactDOM.render(, document.getElementById('approve_host')); diff --git a/templates/style.css b/templates/style.css index f45909f0..d04f461f 100644 --- a/templates/style.css +++ b/templates/style.css @@ -179,3 +179,35 @@ tr.result-row td a { .offset-right-inline { margin-left: 73.5%; } + +.host-container { + overflowY: 'scroll'; + height: 600; + maxWidth: 210; + marginTop: 75; + scrollbarWidth: 'thin'; + marginBottom: 10; +} + +@media only screen and (max-width: 992px){ + .form-align{ + left: 2%; + width: 96.3%; + } + #small-button1{ + width: 6%; + } + #small-button2{ + width: 6%; + } +} + +.host-overflow { + overflow-y: auto; + height: auto; + max-height: 800px; + overscroll-behavior: auto; +} +.bottom-host-ul { + margin-bottom: 0 !important; +}