Skip to content

Commit

Permalink
(Most of the) changed requested by Daan
Browse files Browse the repository at this point in the history
To be done:
- Padding/marging with bootstrap
- Vue global
- Shrinking of FontAwesome
- Colorpalette to Dependency manager
  • Loading branch information
jsvdvis committed May 5, 2018
1 parent bd9b6dc commit 50e68f3
Show file tree
Hide file tree
Showing 26 changed files with 31,280 additions and 42,973 deletions.
60 changes: 47 additions & 13 deletions app/Http/Controllers/DesignerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public function index()
}

/**
* Fetch model from Evidencio based on its id.
* Returns a JSON-structure of this model, contains things like the title, description, author, variables, etc.
*
* Fetch model from Evidencio based on its id, used for designer to retrieve variables.
* @param HTTP|Request -> WorkflowId
* @return JSON -> Evidencio model data
*/
public function fetchVariables(Request $request)
{
Expand All @@ -39,8 +39,9 @@ public function fetchVariables(Request $request)

/**
* Saves the workflow in the database. Should the workflowId be given, that workflow will be updated.
* @param HTTP|Request, ,workflowID]
* @return Object with workflowId, [stepIds], [variableIds], [optionIds]
* @param HTTP|Request -> Workflow data (title/description, steps, variables, etc.)
* @param Number -> workflowId
* @return Array -> Arraywith workflowId, [stepIds], [variableIds], [optionIds]
*/
public function saveWorkflow(Request $request, $workflowId = null)
{
Expand Down Expand Up @@ -73,6 +74,8 @@ public function saveWorkflow(Request $request, $workflowId = null)

/**
* Saves the loaded evimodels of a workflow, is required for the designer side.
* @param Array -> IDs of loaded Evidencio models
* @param App|Workflow -> Database Model of current workflow
*/
private function saveLoadedEvidencioModels($modelIds, $workflow)
{
Expand All @@ -87,8 +90,10 @@ private function saveLoadedEvidencioModels($modelIds, $workflow)

/**
* Saves the steps and variables in the database, deletes variables if they are removed.
* @param [steps], [variables], App|Workflow
* @return Object with [stepIds], [variableIds], [optionIds]
* @param Array -> Steps of workflow
* @param Array -> Variables of workflow
* @param App|Workflow -> Database Model of current workflow
* @return Array -> Array with [stepIds], [variableIds], [optionIds]
*/
private function saveSteps($steps, $variables = [], $workflow)
{
Expand Down Expand Up @@ -121,8 +126,10 @@ private function saveSteps($steps, $variables = [], $workflow)

/**
* Saves the variables connected to a step
* @param App|Step, Object Step, [variables]
* @return Object with [variableIds], [optionIds]
* @param App|Step -> Database Model of step
* @param Array -> Array containing data of step
* @param Array -> Array of variables of workflow
* @return Array -> Array with [variableIds], [optionIds], the IDs of the saved variables and options in the database.
*/
private function saveFields($dbStep, $step, $variables)
{
Expand Down Expand Up @@ -157,7 +164,8 @@ private function saveFields($dbStep, $step, $variables)

/**
* Updates the information of a single step
* @param App|Step, Object step
* @param App|Step -> Database Model of step
* @param Array -> Array containing data of step
*/
private function saveSingleStep($dbStep, $step)
{
Expand All @@ -169,7 +177,8 @@ private function saveSingleStep($dbStep, $step)

/**
* Updates the information of a single variable
* @param App|Field, Object field
* @param App|Field -> Database Model of field (variable)
* @param Array -> Array containing data of field (variable)
*/
private function saveSingleField($dbField, $field)
{
Expand All @@ -186,8 +195,9 @@ private function saveSingleField($dbField, $field)

/**
* Saves/updates the options belonging to a categorical variable.
* @param App|Field, Array options
* @return [optionIds]
* @param App|Field -> Database Model of Field (variable)
* @param Array -> Array of options
* @return Array -> Array filled with the database IDs of the saved options.
*/
private function saveCategoricalOptions($dbField, $options)
{
Expand All @@ -210,4 +220,28 @@ private function saveCategoricalOptions($dbField, $options)
});
return $optionIds;
}

public function loadWorkflow($workflowId)
{
$retObj = [];
$workflow = Auth::user()->createdWorkflows()->where('id', '=', $workflowId)->first();
if ($workflow == null) {
$retObj['success'] = false;
return $retObj;
}
$retObj['success'] = true;
$retObj['title'] = $workflow->title;
$retObj['description'] = $workflow->description;
$retObj['languageCode'] = $workflow->languageCode;

$retObj['steps'] = [];
$counter = 0;
$steps = $workflow->steps()->get();
foreach ($steps as $step) {
$retObj['steps'][$counter] = [];
$retObj['steps'][$counter]['title'] = $step->title;
$counter++;
}
return $retObj;
}
}
49 changes: 0 additions & 49 deletions public/css/navbar-scrollable.css

This file was deleted.

1 change: 0 additions & 1 deletion public/css/navbar-scrollable.css.map

This file was deleted.

49 changes: 0 additions & 49 deletions public/css/navtab-scrollable.css

This file was deleted.

1 change: 0 additions & 1 deletion public/css/navtab-scrollable.css.map

This file was deleted.

Loading

0 comments on commit 50e68f3

Please sign in to comment.