Commit 01dfff9b by Hellmich, Christoph

Resolve conflicts

parents 66c717a1 cecef8f5
......@@ -26,16 +26,11 @@
},
{
"fieldId": 2,
"fieldName": "description",
"fieldType": "String"
},
{
"fieldId": 3,
"fieldName": "treeRow",
"fieldType": "Integer"
},
{
"fieldId": 4,
"fieldId": 3,
"fieldName": "treeIndent",
"fieldType": "Integer"
}
......
doc/class_diagram.png

165 KB | W: | H:

doc/class_diagram.png

163 KB | W: | H:

doc/class_diagram.png
doc/class_diagram.png
doc/class_diagram.png
doc/class_diagram.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -42,7 +42,6 @@ entity Wizard {
entity Step {
name String required,
description String,
treeRow Integer,
treeIndent Integer
}
......
......@@ -27,9 +27,6 @@ public class Step implements Serializable {
@Column(name = "name", nullable = false)
private String name;
@Column(name = "description")
private String description;
@Column(name = "tree_row")
private Integer treeRow;
......@@ -68,14 +65,6 @@ public class Step implements Serializable {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getTreeRow() {
return treeRow;
}
......@@ -141,7 +130,6 @@ public class Step implements Serializable {
return "Step{" +
"id=" + id +
", name='" + name + "'" +
", description='" + description + "'" +
", treeRow='" + treeRow + "'" +
", treeIndent='" + treeIndent + "'" +
'}';
......
package org.gesis.dda.wizard.repository;
import org.gesis.dda.wizard.domain.Step;
import org.springframework.data.jpa.repository.*;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
......@@ -12,5 +11,5 @@ import java.util.List;
public interface StepRepository extends JpaRepository<Step,Long> {
List<Step> findByWizardIdOrderByTreeRowAsc(long id);
}
......@@ -31,9 +31,10 @@ public class StepService {
public Step createStep(Step step) {
log.debug("REST request to save Step : {}", step);
if (step.getTreeRow() == -1) {
if (step.getTreeRow() == null || step.getTreeRow() == -1) {
List<Step> steps = stepRepository.findByWizardIdOrderByTreeRowAsc(step.getWizard().getId());
step.setTreeRow(steps.size() + 1);
step.setTreeIndent(1);
}
return stepRepository.save(step);
......
......@@ -80,7 +80,7 @@ public class StepResource {
public List<Step> getAllSteps() {
log.debug("REST request to get all Steps");
return stepService.getAllSteps();
}
}
/**
* GET /steps/:id -> get the "id" step.
......
......@@ -24,17 +24,17 @@
<column name="name" type="varchar(255)">
<constraints nullable="false" />
</column>
<column name="description" type="varchar(255)"/>
<column name="tree_row" type="integer"/>
<column name="tree_indent" type="integer"/>
<column name="wizard_id" type="bigint"/>
<!-- jhipster-needle-liquibase-add-column - Jhipster will add columns here, do not remove-->
</createTable>
<addForeignKeyConstraint baseColumnNames="wizard_id"
baseTableName="step"
constraintName="fk_step_wizard_id"
......
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
<changeSet author="jhipster" id="20170628181142">
<dropColumn columnName="description" tableName="step"/>
</changeSet>
</databaseChangeLog>
......@@ -23,5 +23,6 @@
<include file="classpath:config/liquibase/changelog/20170531152042_update_entity_Element_Value.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20170626122627_added_entity_XmlFile.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20170629104732_added_entity_MetadataTransformer.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20170628181142_remove_entity_Step_Description.xml" relativeToChangelogFile="false"/>
<!-- jhipster-needle-liquibase-add-changelog - JHipster will add liquibase changelogs here -->
</databaseChangeLog>
......@@ -14,7 +14,28 @@ $icon-font-path: "../../bower_components/bootstrap-sass/assets/fonts/bootstrap/"
}
// /main
// wizard-runnter
.dialogCheckbox {
width: auto !important;
}
// wizard-editor
.fg-edit.row {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.fg-edit-canvas, .fg-form, .fg-edit-canvas fieldset {
height: 100%;
}
.fg-edit-canvas-area {
height: calc(100% - 70px);
}
// /wizard-editor
// wizard-runner
.my-wizard-page-slide, .my-wizard .control-label {
transition: all 0s;
opacity: 0;
......@@ -54,7 +75,7 @@ $icon-font-path: "../../bower_components/bootstrap-sass/assets/fonts/bootstrap/"
background-color: inherit;
color: inherit;
}
// /wizard-runnter
// /wizard-runner
// angular-ui-tree
.wizardCommands {
......
......@@ -20,14 +20,6 @@
</tr>
<tr>
<td>
<span>Description</span>
</td>
<td>
<span class="form-control-static">{{step.description}}</span>
</td>
</tr>
<tr>
<td>
<span>TreeRow</span>
</td>
<td>
......
......@@ -26,12 +26,6 @@
</div>
</div>
<div class="form-group">
<label class="control-label" for="field_description">Description</label>
<input type="text" class="form-control" name="description" id="field_description"
ng-model="step.description"
/>
</div>
<div class="form-group">
<label class="control-label" for="field_treeRow">TreeRow</label>
<input type="number" class="form-control" name="treeRow" id="field_treeRow"
ng-model="step.treeRow"
......
......@@ -20,7 +20,6 @@ angular.module('ddaApp')
$scope.clear = function () {
$scope.step = {
name: null,
description: null,
treeRow: null,
treeIndent: null,
id: null
......
......@@ -53,7 +53,6 @@ angular.module('ddaApp')
entity: function () {
return {
name: null,
description: null,
treeRow: null,
treeIndent: null,
id: null
......
......@@ -20,7 +20,6 @@
<tr>
<th><span>ID</span></th>
<th><span>Name</span></th>
<th><span>Description</span></th>
<th><span>TreeRow</span></th>
<th><span>TreeIndent</span></th>
<th><span>wizard</span></th>
......@@ -31,7 +30,6 @@
<tr ng-repeat="step in steps track by step.id">
<td><a ui-sref="step.detail({id:step.id})">{{step.id}}</a></td>
<td>{{step.name}}</td>
<td>{{step.description}}</td>
<td>{{step.treeRow}}</td>
<td>{{step.treeIndent}}</td>
<td>
......
'use strict';
angular.module('ddaApp').controller('WizardEditorStepDialogController', ['$scope', '$stateParams', '$uibModalInstance', 'entity', 'Step', 'Wizard', 'Element',
function($scope, $stateParams, $uibModalInstance, entity, Step, Wizard, Element) {
angular.module('ddaApp').controller('WizardEditorStepDialogController',
function ($scope, $state, $stateParams, $uibModalInstance, entity, Step, Wizard, Element, treeService) {
$scope.step = entity;
$scope.wizards = Wizard.query();
$scope.elements = Element.query();
$scope.load = function(id) {
Step.get({
id: id
}, function(result) {
$scope.step = result;
});
};
$scope.step = $state.is('wizardEditor.newSubStep') ? {} : entity;
$scope.wizards = Wizard.query();
$scope.elements = Element.query();
$scope.load = function (id) {
Step.get({
id: id
}, function (result) {
$scope.step = result;
});
};
var onSaveSuccess = function(result) {
$scope.$emit('ddaApp:stepUpdate', result);
$uibModalInstance.close(result);
result.elements = [];
$scope.isSaving = false;
};
var onSaveSuccess = function (result) {
$scope.$emit('ddaApp:stepUpdate', result);
$uibModalInstance.close(result);
result.elements = [];
$scope.isSaving = false;
};
var onSaveError = function(result) {
$scope.isSaving = false;
};
var onSaveError = function (result) {
$scope.isSaving = false;
};
$scope.save = function() {
$scope.isSaving = true;
if ($scope.step.id != null) {
Step.update($scope.step, onSaveSuccess, onSaveError);
} else {
Step.save($scope.step, onSaveSuccess, onSaveError);
}
};
$scope.save = function () {
$scope.isSaving = true;
if ($state.is('wizardEditor.newSubStep')) {
treeService.addSubStep(entity, $scope.step.name).then(onSaveSuccess);
} else if ($scope.step.id != null) {
Step.update($scope.step, onSaveSuccess, onSaveError);
} else {
Step.save($scope.step, onSaveSuccess, onSaveError);
}
};
$scope.clear = function() {
$uibModalInstance.dismiss('cancel');
};
}
]);
$scope.clear = function () {
$uibModalInstance.dismiss('cancel');
};
}
);
......@@ -20,10 +20,6 @@
</p>
</div>
</div>
<div class="form-group">
<label class="control-label" for="field_description">Description</label>
<input type="text" class="form-control" name="description" id="field_description" ng-model="step.description"/>
</div>
<div class="form-group" has-authority="ROLE_DEVELOPER">
<label class="control-label" for="field_treeRow">TreeRow</label>
<mark>dev</mark>
......
'use strict';
angular.module('ddaApp').controller('WizardEditorDialogController', ['$scope', '$stateParams', '$uibModalInstance', 'entity', 'Wizard', 'User', 'Step',
function($scope, $stateParams, $uibModalInstance, entity, Wizard, User, Step) {
$scope.wizard = entity;
$scope.users = User.query();
$scope.steps = Step.query();
$scope.load = function(id) {
Wizard.get({
id: id
}, function(result) {
$scope.wizard = result;
});
};
var onSaveSuccess = function(result) {
$scope.$emit('ddaApp:wizardUpdate', result);
$uibModalInstance.close(result);
$scope.isSaving = false;
};
var onSaveError = function(result) {
$scope.isSaving = false;
};
$scope.save = function() {
$scope.isSaving = true;
if ($scope.wizard.id != null) {
Wizard.update($scope.wizard, onSaveSuccess, onSaveError);
} else {
Wizard.save($scope.wizard, onSaveSuccess, onSaveError);
}
};
$scope.clear = function() {
$uibModalInstance.dismiss('cancel');
};
}
function ($scope, $stateParams, $uibModalInstance, entity, Wizard, User, Step) {
$scope.wizard = entity;
$scope.users = User.query();
$scope.steps = Step.query();
$scope.load = function (id) {
Wizard.get({
id: id
}, function (result) {
$scope.wizard = result;
});
};
function createStep(result) {
var step = {
'name': 'New Step',
'wizard': result
};
Step.save(step, function (step) {
closeModal(result, step);
});
}
function closeModal(result, step) {
$scope.$emit('ddaApp:wizardUpdate', result);
var param = {
'id': result.id,
'stepId': step.id
};
$uibModalInstance.close(param);
$scope.isSaving = false;
}
var onSaveSuccess = function (result) {
createStep(result);
};
var onSaveError = function (result) {
$scope.isSaving = false;
};
$scope.save = function () {
$scope.isSaving = true;
if ($scope.wizard.id != null) {
Wizard.update($scope.wizard, onSaveSuccess, onSaveError);
} else {
Wizard.save($scope.wizard, onSaveSuccess, onSaveError);
}
};
$scope.clear = function () {
$uibModalInstance.dismiss('cancel');
};
}
]);
......@@ -21,8 +21,8 @@
</div>
</div>
<div class="form-group">
<label class="control-label" for="field_active">Active</label>
<input type="checkbox" class="form-control" name="active" id="field_active" ng-model="wizard.active"/>
<label class="control-label" for="field_active">Active (Only one wizard can be active at the same time.)</label>
<input type="checkbox" class="form-control dialogCheckbox" name="active" id="field_active" ng-model="wizard.active"/>
</div>
<div class="form-group" has-authority="ROLE_DEVELOPER">
......
......@@ -49,13 +49,8 @@ angular.module('ddaApp')
$scope.loadAll();
};
$scope.addSubStep = function (scope) {
var parent = scope.$modelValue;
treeService.addSubStep(scope.$modelValue).then(function (step) { // TODO: Move logic to server
step.nodes = [];
parent.nodes.push(step);
});
$scope.editStep = function (step) {
$state.go('wizardEditor.editStep', step, {'notify': false});
};
function getWizardId() {
......
......@@ -51,11 +51,11 @@
<!-- tree -->
<!-- Nested node template -->
<script type="text/ng-template" id="nodes_renderer.html">
<div ui-tree-handle="" class="tree-node tree-node-content" ng-class="{ active: node.id === activeWizard.step.id }">
<div ui-tree-handle="" class="tree-node tree-node-content" ng-class="{ active: node.id === activeWizard.step.id }" >
<a class="btn btn-default btn-xs" ng-if="node.nodes && node.nodes.length > 0" data-nodrag="" ng-click="toggle(this)">
<span class="fa" ng-class="{ 'fa-chevron-right': collapsed, 'fa-chevron-down': !collapsed }"></span>
</a>
<a class="stepName" data-nodrag="" ui-sref="wizardEditor.selectStep({stepId:node.id})" ng-click="selectStep(this)">{{node.name}}</a>
<a class="stepName" data-nodrag="" ui-sref="wizardEditor.selectStep({stepId:node.id})" ng-click="selectStep(this)" ng-dblClick="editStep({stepId:node.id})">{{node.name}}</a>
<span class="treeItemCommands" ng-if="node.id === activeWizard.step.id">
<a class="pull-right btn btn-danger btn-xs" data-nodrag="" ui-sref="wizardEditor.deleteStep({stepId:node.id})">
<span class="fa fa-trash"></span>
......@@ -63,7 +63,7 @@
<a class="pull-right btn btn-default btn-xs" data-nodrag="" ui-sref="wizardEditor.editStep({stepId:node.id})">
<span class="fa fa-wrench"></span>
</a>
<a class="pull-right btn btn-primary btn-xs" data-nodrag="" ng-click="addSubStep(this)">
<a class="pull-right btn btn-primary btn-xs" data-nodrag="" ui-sref="wizardEditor.newSubStep({stepId:node.id})">
<span class="glyphicon glyphicon-plus"></span>
</a>
</span>
......@@ -92,7 +92,7 @@
</div>
<div class="col-md-9">
<div fg-tabs="" class="needs-some-more-space" ng-class="{'form-disable' : !activeWizard.step.name}">
<div fg-tabs="" class="needs-some-more-space" ng-class="{'hidden' : !activeWizard.step.name}">
<div class="form-overlay" ng-if="!activeWizard.step.name"></div>
<div fg-tabs-pane="Schema Editor">
......
......@@ -38,9 +38,7 @@ angular.module('ddaApp')
}
}
}).result.then(function(result) {
$state.go('wizardEditor', result, {
reload: true
});
$state.go('wizardEditor.selectStep', result, {'reload': true});
}, function() {
$state.go('wizardEditor');
});
......@@ -135,7 +133,34 @@ angular.module('ddaApp')
})
}]
})
.state('wizardEditor.selectStep', {
.state('wizardEditor.newSubStep', {
parent: 'wizardEditor',
url: '/newSubStep/{stepId}',
data: {
authorities: ['ROLE_ADMIN'],
},
onEnter: ['$stateParams', '$state', '$uibModal', function($stateParams, $state, $uibModal) {
$uibModal.open({
templateUrl: 'scripts/app/wizardEditor/wizardEditor-step-dialog.html',
controller: 'WizardEditorStepDialogController',
size: 'lg',
resolve: {
entity: ['Step', function(Step) {
return Step.get({
id: $stateParams.stepId
});
}]
}
}).result.then(function(result) {
$state.go('wizardEditor.selectStep', {'id': result.wizard.id, 'stepId': result.id}, {
reload: true
});
}, function() {
$state.go('wizardEditor');
});
}]
})
.state('wizardEditor.selectStep', {
parent: 'wizardEditor',
url: '/step/{stepId}',
// data: {
......
......@@ -11,14 +11,14 @@ angular.module('ddaApp')
'fieldName': 'checkbox',
'category': 'Checkbox fields',
'fieldOptions': {
'displayName': 'Checkbox',
'displayName': 'Yes/No Choice',
'value': 'false',
}
}, {
'fieldName': 'checkboxlist',
'category': 'Checkbox fields',
'fieldOptions': {
'displayName': 'Checkbox List',
'displayName': 'Multiple Choice',
'options': [{
'value': '1',
'text': 'Option 1'
......@@ -35,31 +35,17 @@ angular.module('ddaApp')
'3': false
}
}
}, {
'fieldName': 'paragraph',
'category': '⚠ Development',
'fieldOptions': {
'displayName': 'Paragraph',
'nolabel': true
}
}, {
'fieldName': 'headline',
'category': '⚠ Development',
'fieldOptions': {
'displayName': 'Headline',
'nolabel': true
}
}, {
}, {
'fieldName': 'helpText',
'category': 'Miscellaneous',
'category': 'Display Text',
'fieldOptions': {
'displayName': 'Hilfe',
'displayName': 'Display Help Text',
'value': '<h3>Headline</h3><p>Some <i>text</i>...<br/></p>',
'nolabel': true
}
}, {
'fieldName': 'templateImporter',
'category': 'Miscellaneous',
'category': 'Content Upload',
'fieldOptions': {
'displayName': 'Template Upload',
'placeholder': 'Open Template',
......@@ -70,7 +56,7 @@ angular.module('ddaApp')
}
}, {
'fieldName': 'oaiPmhLinkImporter',
'category': 'Miscellaneous',
'category': 'Content Upload',
'fieldOptions': {
'displayName': 'OAI-PHM-Adresse',
'placeholder': 'Beispiel: http://www.ssoar.info/OAIHandler/request',
......@@ -80,9 +66,9 @@ angular.module('ddaApp')
}
}, {
'fieldName': 'textEditor',
'category': 'Miscellaneous',
'category': 'Display Text',
'fieldOptions': {
'value': '<h3>Headline</h3><p>Some <i>text</i>...<br/></p>',
'value': '<h3>Display Text</h3><p>Some <i>text</i>...<br/></p>',
'nolabel': true,
'noInitialValueLabel': true
}
......@@ -115,7 +101,7 @@ angular.module('ddaApp')
])
.constant('validationMessages', {
// 'date' : 'Invalid date',
'oaipmhUrlInvalid' : 'Die eingegebene Adresse ist nicht gültig. Weitere Informationen finden Sie in der Hilfe.',
// 'dateMin' : 'Date value too low',
// 'dateMax' : 'Date value too high',
// 'max' : 'The value {{ field.schema && ("should be less than " + field.schema.validation.max) || field.state.$viewValue + " is too high" }}'
......
<div fg-tabs-pane="Properties">
<div fg-property-field-common="{ fieldname: true, displayname: true, placeholder: false, tooltip: false }"></div>
<div fg-property-field-value>
<textarea name="fieldValue"
class="form-control"
ng-model="field.value">
</textarea>
</div>
</div>
\ No newline at end of file
<div class="checkbox">
<label title="{{ field.schema.tooltip }}">
<h1 ng-if="field.schema.nolabel">{{ field.schema.displayName }}</h1>
<h1>{{ field.schema.value }}</h1>
</label>
</div>
......@@ -17,6 +17,7 @@ angular.module('ddaApp').controller('oaiPmhLinkImporterController', function($sc
var onSuccess = function(data, status, headers, config) {
$scope.valid = true;
$scope.field.state.$setValidity('oaipmhUrlInvalid', true, window);
$scope.identify = data;
setValidationMessage('Adresse gültig.');
......@@ -28,6 +29,7 @@ angular.module('ddaApp').controller('oaiPmhLinkImporterController', function($sc
var onError = function(data, status, headers, config) {
$scope.valid = false;
$scope.field.state.$setValidity('oaipmhUrlInvalid', false, window);
$scope.identify = null;
setValidationMessage('Prüfung fehlgeschlagen.');
};
......
<div fg-tabs-pane="Properties">
<div fg-property-field-common="{ fieldname: true, displayname: true, placeholder: true, tooltip: false }"></div>
<div fg-property-field-value>
<textarea name="fieldValue"
class="form-control"
ng-model="field.value">
</textarea>
</div>
</div>
\ No newline at end of file