Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ui configs #82

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
9bbb9a6
Prepare for diagram constructing
artbez Nov 2, 2016
13eb1ef
Create Scene and Pallete services
artbez Nov 3, 2016
f88ade9
Add exist method to Scene
artbez Nov 3, 2016
218c5ff
Add remove and move methods
artbez Nov 3, 2016
3a55d67
Add logging
artbez Nov 4, 2016
d4e6d8b
Add addLink method
artbez Nov 4, 2016
00ccd70
Codacy
artbez Nov 4, 2016
69b61d0
Add PropertyEditor service
artbez Nov 4, 2016
ec6feba
Add possibility to move element to any point in the scene
artbez Nov 14, 2016
a026b52
Code refactor of SceneWindow
artbez Nov 15, 2016
8bc01b9
Merge branch 'master' into diagram-gui
artbez Nov 15, 2016
3fb78a3
Create testspace for tasting
artbez Nov 22, 2016
d44c095
Fix movement bug
artbez Nov 23, 2016
a55e457
Change namespace of nodes
artbez Nov 23, 2016
60a30c6
Fix bug with property checkbox
artbez Nov 24, 2016
aaaeb59
Add HeaderPanel
artbez Nov 30, 2016
bf95628
Some experiments with JSExecutor
artbez Dec 18, 2016
8e6c356
Add Block and Coordinate classes
artbez Jan 15, 2017
970860c
Add Link and change SelenideElement to links and blocks in scene service
artbez Jan 18, 2017
1ddddf8
Code refactor
artbez Feb 12, 2017
af4b4be
Fix focus
artbez Feb 14, 2017
0b62cb2
Fix clean scene
artbez Feb 18, 2017
70e67bf
Make SceneWindow steps calculated automatically
artbez Feb 18, 2017
64e8b53
Code refactor
artbez Feb 19, 2017
6124f7a
Code refactor
artbez Feb 19, 2017
7403a31
Add class PalleteElement + code refactor
artbez Feb 19, 2017
dc0b9c2
Code refactor
artbez Feb 19, 2017
56672d0
Code refactor
artbez Feb 19, 2017
de3d452
Merge remote-tracking branch 'remotes/origin/master' into diagram-gui
artbez Feb 19, 2017
ffdfc41
Add callTomcat.sh
artbez Feb 19, 2017
b17459c
Code refactor
artbez Feb 19, 2017
65f2482
Divide editor to editor/robots and editor/bpmn
artbez Feb 23, 2017
4723a4c
Add Page as an object
artbez Feb 24, 2017
16ef59c
Remove Scene, PropertyEditor and Pallete from beans
artbez Feb 24, 2017
49765e7
Code refactor
artbez Feb 24, 2017
447413f
Add Block and Link providers
artbez Feb 24, 2017
2441162
Add additional condition for remove
artbez Feb 26, 2017
e77cadb
Make focus works by JavaScriptExecutor
artbez Feb 26, 2017
a001a6d
Add webdriver's timeouts
artbez Feb 26, 2017
e0f2193
Fix bug with movement
artbez Mar 2, 2017
d2235ef
Remove unnecessary changes
artbez Mar 3, 2017
e94789c
Merge branch 'diagram-gui' into save-open-dia-test
artbez Mar 9, 2017
3a5ea63
Add titles in pages
artbez Mar 9, 2017
ce0fee8
Remove unnecessary modal call
artbez Mar 12, 2017
3f41d7b
Add save diagram test
artbez Mar 13, 2017
7108d8d
Add equals check for diagrams
artbez Mar 14, 2017
1d89f57
Fix bug with deleting folders and some code refactor
artbez Mar 19, 2017
b2250ac
Code refactor, java doc and style guide
artbez Mar 19, 2017
6e4cb49
Merge branch 'diagram-gui' into save-open-dia-test
artbez Mar 19, 2017
fc2fa52
Code refactor, java doc and style guide
artbez Mar 19, 2017
a5badfb
Merge branch 'master' into save-open-dia-test
artbez Mar 21, 2017
dd04798
Merge branch 'master' into save-open-dia-test
artbez Mar 21, 2017
783c623
Fix bug with gesture creating
artbez Mar 21, 2017
329cbea
Merge branch 'master' into diagram-gui
artbez Mar 21, 2017
bb65fb9
Merge branch 'master' into diagram-gui
artbez Mar 21, 2017
989fb6f
Code refactor
artbez Mar 21, 2017
e380a67
Add drawing line between blocks
artbez Apr 1, 2017
cb15fbe
Add gestures support
artbez Apr 1, 2017
ef435cc
Fix bug with not catching mousemove event
artbez Apr 2, 2017
a81dde9
Code refactor
artbez Apr 2, 2017
7626b1c
Add first version of config files
artbez Apr 11, 2017
30d395d
Add configMerger and integrate opener service with selector service
artbez Apr 11, 2017
cc940c5
Add selector service
artbez Apr 27, 2017
2995bc2
Code refactor
artbez Apr 27, 2017
8176207
Merge branch 'diagram-gui' into save-open-dia-test
artbez Apr 27, 2017
184eaac
Code refactor
artbez Apr 27, 2017
a824ba4
Merge branch 'save-open-dia-test' into mouse-gestures
artbez Apr 27, 2017
db85348
Code refactor
artbez Apr 27, 2017
a5a7c3c
Merge branch 'mouse-gestures' into ui-configs
artbez Apr 27, 2017
eece7a3
Code refactor
artbez Apr 27, 2017
66f2599
Fix bug with timing
artbez Apr 27, 2017
777a26e
Merge branch 'mouse-gestures' into ui-configs
artbez Apr 27, 2017
0bc2008
Add angular service to client
artbez Apr 29, 2017
2f456d3
Add Selector Service
artbez May 1, 2017
98ab11e
Let typescript files get selectors from server
artbez May 2, 2017
c0a18bc
Integrate selectors for PropertyEditor
artbez May 2, 2017
8a953dd
Create selectors for property in PropertyEditor
artbez May 2, 2017
674e119
Integrate EditorPanelHeader.fileItem and EditorPanelHeader.saveDiagra…
artbez May 3, 2017
7c1e3f9
Integrate EditorPanelHeader.savingMenu
artbez May 3, 2017
fcb6db1
Integrate EditorPanelHeader
artbez May 4, 2017
9de0f91
Integrate all configs
artbez May 4, 2017
e8a5631
Change SelectorService interface
artbez May 4, 2017
5d671a2
Add property files
artbez May 4, 2017
1549924
Code refactor
artbez May 5, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ before_install:
- sudo rm /dev/random
- sudo mknod /dev/random c 1 9
# for gui tests
- export DBUS_SESSION_BUS_ADDRESS=/dev/null
- export CHROME_BIN=/usr/bin/google-chrome
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
Expand All @@ -33,9 +34,9 @@ before_install:

install:
#install and run tests and run style checking
- mvn install -P travis
- mvn clean install -P travis
- cd ui-testing
- mvn install -DskipTests
- mvn clean install -DskipTests
- cd ..

script:
Expand Down Expand Up @@ -66,9 +67,12 @@ script:
- mvn tomcat7:run-war-only -P travis &
- sleep 30

- cd ../ui-testing
- mvn test -P travis &
- cd ../selector-service
- mvn spring-boot:run &
- sleep 30

- cd ../ui-testing
- mvn test -P travis

notifications:
slack: qreal-web:sT5qgA4qZZ9eyLI0yy2Mp81E
47 changes: 47 additions & 0 deletions Travis/callTomcat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash
iter=1
all=120
until [ "$(curl --silent --show-error --connect-timeout 1 -I http://localhost:"${1:-"8080"}"/auth | grep '302 Found')" != "" ];
do
if [ "$iter" -lt "$all" ]
then
echo "--- sleeping for 10 seconds"
sleep 10
let iter=$iter+1
else
echo "Server didn't return 302 found for long time"
exit 1
fi
done
echo "auth-service found"
iter=1
all=120
until [ "$(curl --silent --show-error --connect-timeout 1 -I http://localhost:"${2:-"8082"}"/dashboard | grep '302 Found')" != "" ];
do
if [ "$iter" -lt "$all" ]
then
echo "--- sleeping for 10 seconds"
sleep 10
let iter=$iter+1
else
echo "Server didn't return 302 found for long time"
exit 1
fi
done
echo "dashboard-service found"
iter=1
all=120
until [ "$(curl --silent --show-error --connect-timeout 1 -I http://localhost:"${3:-"8081"}"/editor | grep '302 Found')" != "" ];
do
if [ "$iter" -lt "$all" ]
then
echo "--- sleeping for 10 seconds"
sleep 10
let iter=$iter+1
else
echo "Server didn't return 302 found for long time"
exit 1
fi
done
echo "editor-service found"
exit 0
45 changes: 24 additions & 21 deletions Travis/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

<module name="TreeWalker">

<module name="SeparatorWrap" />
<module name="SeparatorWrap">
<property name="tokens" value="COMMA"/>
</module>

<!-- Checks that the outer type name and the file name match. For example, the class Foo must be in a file named Foo.java -->
<module name="OuterTypeFilename"/>
Expand Down Expand Up @@ -68,9 +70,9 @@
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<message key="ws.notFollowed"
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
<message key="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
<message key="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
</module>
<!--Only one statement per line-->
<module name="OneStatementPerLine"/>
Expand All @@ -90,60 +92,60 @@
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern"
value="Package name ''{0}'' must match pattern ''{1}''."/>
value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="TypeName">
<message key="name.invalidPattern"
value="Type name ''{0}'' must match pattern ''{1}''."/>
value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/>
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ParameterName">
<property name="format" value="^([a-z][a-zA-Z0-9]+)|[e]$"/>
<message key="name.invalidPattern"
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LocalVariableName">
<property name="tokens" value="VARIABLE_DEF"/>
<property name="format" value="^([a-z][a-zA-Z0-9]+)|[e]$"/>
<property name="allowOneCharVarInForLoop" value="true"/>
<message key="name.invalidPattern"
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Class type name ''{0}'' must match pattern ''{1}''."/>
value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Method type name ''{0}'' must match pattern ''{1}''."/>
value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="InterfaceTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>

<!-- Whitespaces for < and > -->
<module name="GenericWhitespace">
<message key="ws.followed"
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded"
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow"
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded"
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded"
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow"
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded"
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
</module>

<module name="Indentation" />
Expand All @@ -170,7 +172,7 @@
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>

<module name="JavadocMethod">
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
Expand All @@ -187,5 +189,6 @@

<!--Comments are indeneted at the same level as surrounding code-->
<module name="CommentsIndentation"/>

</module>
</module>
4 changes: 3 additions & 1 deletion Travis/pmd/pmd-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

<rule ref="rulesets/java/braces.xml"/>

<rule ref="rulesets/java/codesize.xml"/>
<rule ref="rulesets/java/codesize.xml">
<exclude name="TooManyMethods" />
</rule>

<rule ref="rulesets/java/empty.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.security.web.savedrequest.HttpSessionRequestCache;
import org.springframework.security.web.savedrequest.SavedRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.client.RestTemplate;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Expand All @@ -20,10 +24,16 @@
* Controller of register page.
* Pages: /log (GET) (login page), /logErr (GET) (login error page)
*/

@Configuration
@PropertySource("classpath:selectors.properties")
@Controller
public class LoginController {

private static final Logger logger = LoggerFactory.getLogger(LoginController.class);

@Value("${selectors.url}")
private String selectorServiceUrl;

/**
* Used to retrieve inital request which could be intercepted by SpringSec.
Expand Down Expand Up @@ -56,6 +66,11 @@ public String login(@RequestParam(value = "error", required = false) String erro
redirectUrl);
}

model.addAttribute("selectors", getConfig());
return "anonymous/loginView";
}

private String getConfig() {
return new RestTemplate().getForObject(selectorServiceUrl, String.class);
}
}
1 change: 1 addition & 0 deletions auth-service/src/main/resources/selectors.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
selectors.url=http://localhost:7070/selectors/authform
15 changes: 11 additions & 4 deletions auth-service/src/main/webapp/WEB-INF/views/anonymous/loginView.jsp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%@ page import="org.codehaus.jettison.json.JSONObject" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
Expand All @@ -13,6 +14,9 @@
</head>

<body>
<%
JSONObject object = new JSONObject(request.getAttribute("selectors").toString());
%>
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4 col-md-offset-4">
Expand All @@ -22,9 +26,12 @@
src="https://cdn4.iconfinder.com/data/icons/mechanical-cogs-and-gear-wheel/500/cogwheel_configuration_configure_control_gear_gears_gearwheel_mechanics_pinion_rackwheel_screw-wheel_settings_tool_steel_machinery-512.png"
alt="">
<form class="form-signin" action="login" method="post">
<input type="text" name="username" class="form-control" placeholder="Email:" required autofocus>
<input type="password" name="password" class="form-control" placeholder="Password:" required>
<button class="btn btn-lg btn-primary btn-block" type="submit">
<input id="<%=object.getJSONObject("usernameInput").getString("id")%>"
type="text" name="username" class="form-control" placeholder="Email:" required autofocus>
<input id="<%=object.getJSONObject("passwordInput").getString("id")%>"
type="password" name="password" class="form-control" placeholder="Password:" required>
<button id="<%=object.getJSONObject("submitButton").getString("id")%>"
class="btn btn-lg btn-primary btn-block" type="submit">
Sign in
</button>
<input type="hidden" name="${_csrf.parameterName}"
Expand All @@ -33,7 +40,7 @@
</div>

<c:if test="${error}">
<h2 class="text-center login-title">Password or login wrong</h2>
<h2 id="<%=object.getJSONObject("wrongAuthLabel").getString("id")%>" class="text-center login-title">Password or login wrong</h2>
</c:if>
<a href="register" class="text-center new-account">Create an account </a>
<p class="text-center">or</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public ModelAndView home(HttpSession session) {
model.setViewName("dashboard/index");

logger.info("For user {} main page was created", AuthenticatedUser.getUserName());

return model;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ public void deleteFolder(Long folderId) throws AbortedException {
DiagramDaoImpl.class.getName());
}
Folder folder = (Folder) session.get(Folder.class, folderId);
for (Folder child : folder.getChildrenFolders()) {
deleteFolder(child.getId());
}
folder.remove();
session.delete(folder);

logger.trace("deleteFolder() successfully deleted a folder with id {}", folderId);
Expand Down
Loading