Commit 3af52cec503cad66976f164002dcf759fe76f6d1

Authored by Ali B
1 parent 4db99cdc

Working on login, implemented login on the client side to send a request to the …

…API, now i need to implement it on the server side and make databse changes
Risiko/.idea/caches/build_file_checksums.ser
No preview for this file type
Risiko/.idea/misc.xml
... ... @@ -5,11 +5,12 @@
5 5 <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
6 6 <option name="myNullables">
7 7 <value>
8   - <list size="4">
  8 + <list size="5">
9 9 <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
10 10 <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
11   - <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
12   - <item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
  11 + <item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
  12 + <item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
  13 + <item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
13 14 </list>
14 15 </value>
15 16 </option>
... ...
Risiko/.idea/vcs.xml deleted
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<project version="4">
3   - <component name="VcsDirectoryMappings">
4   - <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
5   - </component>
6   -</project>
7 0 \ No newline at end of file
Risiko/app/src/main/java/activity/MainPage.java
1 1 package activity;
2 2  
  3 +import android.content.BroadcastReceiver;
  4 +import android.content.Context;
3 5 import android.content.Intent;
4 6 import android.support.v7.app.AppCompatActivity;
5 7 import android.os.Bundle;
  8 +import android.text.TextUtils;
6 9 import android.view.View;
7 10 import android.widget.Button;
  11 +import android.widget.EditText;
  12 +import android.widget.TextView;
8 13  
9 14 import com.risiko.risiko.R;
10 15  
  16 +import api.APILoginService;
  17 +
11 18 public class MainPage extends AppCompatActivity {
12 19 Button toMainMenu;
  20 + private EditText mUsernameView;
  21 + private EditText mPasswordView;
13 22  
14 23 @Override
15 24 protected void onCreate(Bundle savedInstanceState) {
... ... @@ -24,4 +33,113 @@ public class MainPage extends AppCompatActivity {
24 33 startActivity(intent);
25 34 }
26 35  
  36 + /**
  37 + * This it the "login" method. It has a simple input check.
  38 + *
  39 + * First it checks the string values in password and username. If they pass the test the progress "loading" icon will be shown and the information will be sent to the LoginService.
  40 + *
  41 + */
  42 + private void attemptLogin() {
  43 +
  44 + mUsernameView.setError(null);
  45 + mPasswordView.setError(null);
  46 +
  47 + String username = mUsernameView.getText().toString();
  48 + String password = mPasswordView.getText().toString();
  49 +
  50 + boolean cancel = false;
  51 + View focusView = null;
  52 +
  53 + // Checking password input
  54 + if (TextUtils.isEmpty(password) && !isPasswordValid(password)) {
  55 + mPasswordView.setError(getString(R.string.error_invalid_password));
  56 + focusView = mPasswordView;
  57 + cancel = true;
  58 + }
  59 +
  60 + // Checking username input.
  61 + if (TextUtils.isEmpty(username)) {
  62 + mUsernameView.setError(getString(R.string.error_field_required));
  63 + focusView = mUsernameView;
  64 + cancel = true;
  65 + } else if (!isUsernameValid(username)) {
  66 + mUsernameView.setError(getString(R.string.error_invalid_username));
  67 + focusView = mUsernameView;
  68 + cancel = true;
  69 + }
  70 +
  71 + if (cancel) {
  72 + focusView.requestFocus();
  73 + } else {
  74 + //Connecting to server and checking login credentials.
  75 + APILoginService.startActionLogin(this, mPasswordView.getText().toString(), mUsernameView.getText().toString());
  76 + }
  77 + }
  78 +
  79 + /**
  80 + * This is the Broadcast receiver for login. The LoginService will send a broadcast when the login credentials has been checked.'
  81 + * The onReceive will check the response and act accordingly.
  82 + */
  83 + public class BroadCastReceiverLogin extends BroadcastReceiver {
  84 + public static final String USER_LOGIN = "risiko.USER_LOGIN";
  85 +
  86 + @Override
  87 + public void onReceive(Context context, Intent intent) {
  88 + onResponse(intent.getIntExtra("responseCode", 400));
  89 + }
  90 +
  91 + // Reacting on the server answer.
  92 + private void onResponse(int responseCode){
  93 + TextView tvSomethingWentWrong = findViewById(R.id.tv_wrongMessageLogin);
  94 + switch (responseCode) {
  95 +
  96 + // Something went wrong with login
  97 + case 400:
  98 + tvSomethingWentWrong.setVisibility(View.VISIBLE);
  99 + tvSomethingWentWrong.setText(R.string.something_went_wrong_with_login);
  100 + break;
  101 +
  102 + // Code for success
  103 + case 201:
  104 + //TODO: Success, go to main menu
  105 + break;
  106 +
  107 + // Error from php server.
  108 + case 500:
  109 + tvSomethingWentWrong.setVisibility(View.VISIBLE);
  110 + tvSomethingWentWrong.setText(R.string.server_error);
  111 +
  112 + // Wrong password or username.
  113 + case 403:
  114 + tvSomethingWentWrong.setVisibility(View.VISIBLE);
  115 + tvSomethingWentWrong.setText(R.string.wrong_password_or_username);
  116 + break;
  117 + }
  118 + }
  119 + }
  120 +
  121 +
  122 +
  123 + /**
  124 + * @param password String password to check
  125 + *
  126 + * Simple password validation check
  127 + *
  128 + * @return true if password is valid.
  129 + */
  130 + public static boolean isPasswordValid(String password) {
  131 + return password.length() > 5;
  132 + }
  133 +
  134 + /**
  135 + * @param username
  136 + *
  137 + * Checks length of username, other checks can be added later if needed
  138 + *
  139 + * @return true if it is valid.
  140 + */
  141 + public static boolean isUsernameValid(String username) {
  142 + return username.length() > 5;
  143 + }
  144 +
27 145 }
28 146 \ No newline at end of file
... ...
Risiko/app/src/main/java/api/APILoginService.java 0 → 100644
  1 +package api;
  2 +
  3 +import android.app.IntentService;
  4 +import android.content.Context;
  5 +import android.content.Intent;
  6 +import android.content.SharedPreferences;
  7 +import android.support.v4.content.LocalBroadcastManager;
  8 +
  9 +import com.risiko.risiko.R;
  10 +
  11 +import java.io.BufferedReader;
  12 +import java.io.IOException;
  13 +import java.io.InputStreamReader;
  14 +import java.io.OutputStreamWriter;
  15 +import java.net.HttpURLConnection;
  16 +import java.net.URL;
  17 +
  18 +import activity.MainPage;
  19 +
  20 +
  21 +/**
  22 + * Service for login.
  23 + * Makes contact with API on stored URL. API checks for correct password and email.
  24 + * Sends broadcast with response. Does not handle repsonse in class.
  25 + */
  26 +public class APILoginService extends IntentService {
  27 +
  28 + private static final String ACTION_LOGIN = "prosjekt.rapporteringsapp.Services.action.LOGIN";
  29 + private static final String EXTRA_PASSWORD = "prosjekt.rapporteringsapp.Services.extra.PASSWORD";
  30 + private static final String EXTRA_EMAIL = "prosjekt.rapporteringsapp.Services.extra.EMAIL";
  31 +
  32 + public APILoginService() {
  33 + super("APIServiceLogin");
  34 + }
  35 +
  36 + public static void startActionLogin(Context context, String password, String email) {
  37 + Intent intent = new Intent(context, APILoginService.class);
  38 + intent.setAction(ACTION_LOGIN);
  39 + intent.putExtra(EXTRA_PASSWORD, password);
  40 + intent.putExtra(EXTRA_EMAIL, email);
  41 + context.startService(intent);
  42 + }
  43 +
  44 + @Override
  45 + protected void onHandleIntent(Intent intent) {
  46 + if (intent != null) {
  47 + final String action = intent.getAction();
  48 + if (ACTION_LOGIN.equals(action)) {
  49 + final String password = intent.getStringExtra(EXTRA_PASSWORD);
  50 + final String email = intent.getStringExtra(EXTRA_EMAIL);
  51 + handleActionLogin(password, email);
  52 + }
  53 + }
  54 + }
  55 +
  56 + /**
  57 + * @param password Password to account to check
  58 + * @param email User email.
  59 + * @throws NullPointerException
  60 + *
  61 + * This method makes connection to API and sends request to check password and email.
  62 + * If correct it will send back a token, and response cod 201.
  63 + * If not correct it will only send back a response code.
  64 + */
  65 + private void handleActionLogin(String password, String email) throws NullPointerException {
  66 +
  67 + HttpURLConnection urlConnection = null;
  68 + URL url = null;
  69 + BufferedReader reader;
  70 + OutputStreamWriter writer = null;
  71 +
  72 + try {
  73 +
  74 + // Sending the post request with email and password to the server.
  75 + url = new URL(getString(R.string.api_login_link));
  76 + urlConnection = (HttpURLConnection) url.openConnection();
  77 +
  78 + urlConnection.setRequestMethod("POST");
  79 + urlConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
  80 + urlConnection.setRequestProperty("charset", "utf-8");
  81 + urlConnection.setDoOutput(true);
  82 + writer = new OutputStreamWriter(urlConnection.getOutputStream());
  83 + writer.write("email="+email+"&password="+password);
  84 + writer.flush();
  85 + writer.close();
  86 +
  87 + // The response code from the server.
  88 + int responseCode = urlConnection.getResponseCode();
  89 +
  90 + // If correct email and password. Get the token from the server, encrypt it and store it in shared preferences.
  91 + if(responseCode == 201) {
  92 + reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
  93 + String token = reader.readLine();
  94 + reader.close();
  95 +
  96 + SharedPreferences sharedPref = getSharedPreferences(getString(R.string.packageName), Context.MODE_PRIVATE);
  97 + SharedPreferences.Editor edit = sharedPref.edit();
  98 + edit.clear();
  99 + edit.putString(getString(R.string.preference_name_token), encryptToken(token));
  100 + edit.commit();
  101 + sendBroadcast(responseCode);
  102 + }else{
  103 + // In case of other answer than 201. Will be handled in the broadcast receiver.
  104 + sendBroadcast(responseCode);
  105 + }
  106 +
  107 + } catch (IOException e) {
  108 + e.printStackTrace();
  109 + }
  110 + }
  111 +
  112 + /**
  113 + * @param responseCode Response code from server
  114 + * Code 201: Correct password and Username
  115 + * Code 403: Wrong username or password
  116 + * Code 401: Unautorhized user (user not activated)
  117 + * Code 500: Error from php server
  118 + * Code 400: Something went wrong with login
  119 + *
  120 + * Sends broadcast when connection finished.
  121 + */
  122 + private void sendBroadcast(int responseCode){
  123 + Intent broadCastIntent = new Intent(MainPage.BroadCastReceiverLogin.USER_LOGIN);
  124 + broadCastIntent.putExtra("responseCode", responseCode);
  125 + LocalBroadcastManager.getInstance(this).sendBroadcast(broadCastIntent);
  126 + }
  127 +
  128 + /**
  129 + * @param token String token to encrypt
  130 + * @return returns encrypted string.
  131 + *
  132 + * This method encrypts given string with DESede algorithm. With key stored in strings value.
  133 + */
  134 + private String encryptToken(String token){
  135 + MyEncryption encrypter = new MyEncryption();
  136 + return encrypter.encrypt(token, getString(R.string.encryption_key));
  137 + }
  138 +}
  139 +
... ...
Risiko/app/src/main/java/api/Endpoints.java
... ... @@ -33,6 +33,8 @@ public interface Endpoints {
33 33 //ØYVIN FIX
34 34 //String BASEURL ="http://risikoapi.harm.no/";
35 35  
  36 + @POST
  37 + Call<String> login(@Field("username") String username, @Field("password") String password);
36 38  
37 39 @GET("evaluation")
38 40 Call<List<Evaluation>> getAllEvaluations();
... ...
Risiko/app/src/main/java/api/MyEncryption.java 0 → 100644
  1 +package api;
  2 +
  3 +import android.util.Base64;
  4 +
  5 +import java.io.UnsupportedEncodingException;
  6 +import java.security.GeneralSecurityException;
  7 +import java.security.spec.KeySpec;
  8 +
  9 +import javax.crypto.Cipher;
  10 +import javax.crypto.SecretKey;
  11 +import javax.crypto.SecretKeyFactory;
  12 +import javax.crypto.spec.DESedeKeySpec;
  13 +
  14 +
  15 +/**
  16 + * Class for encrypting and decrypting login token. With given key.
  17 + */
  18 +public class MyEncryption {
  19 +
  20 + // Empty constructor
  21 + public MyEncryption(){}
  22 +
  23 + /**
  24 + * @param stringToEncrypt The string you want to encrypt.
  25 + * @param key The encryption key.
  26 + * @return Returns encrypted string
  27 + *
  28 + * This method encrypts given string with DESede algorithm and with given key.
  29 + */
  30 + public String encrypt(String stringToEncrypt, String key) {
  31 + try {
  32 + KeySpec keySpec = new DESedeKeySpec(key.getBytes());
  33 + SecretKey secretKey = SecretKeyFactory.getInstance("DESede").generateSecret(keySpec);
  34 +
  35 + Cipher ecipher = Cipher.getInstance(secretKey.getAlgorithm());
  36 + ecipher.init(Cipher.ENCRYPT_MODE, secretKey);
  37 +
  38 + String charset = "UTF-8";
  39 + byte[] in = stringToEncrypt.getBytes(charset);
  40 + byte[] out = ecipher.doFinal(in);
  41 +
  42 + return new String(Base64.encode(out, Base64.NO_WRAP));
  43 + } catch (GeneralSecurityException | UnsupportedEncodingException e) {
  44 + e.printStackTrace();
  45 + }
  46 + return "";
  47 + }
  48 +
  49 + /**
  50 + * @param stringToDecrypt The string you want to decrypt
  51 + * @param key The decryption key. Stored in strings.
  52 + * @return Returns decrypted string.
  53 + *
  54 + * This decrypts a string with given key. The algorithm used is DESede.
  55 + */
  56 + public String decrypt(String stringToDecrypt, String key){
  57 + try{
  58 + KeySpec keySpec = new DESedeKeySpec(key.getBytes());
  59 + SecretKey secretKey = SecretKeyFactory.getInstance("DESede").generateSecret(keySpec);
  60 +
  61 + Cipher dcipher = Cipher.getInstance(secretKey.getAlgorithm());
  62 + dcipher.init(Cipher.DECRYPT_MODE, secretKey);
  63 +
  64 + byte[] encryptedTextBytes = Base64.decode(stringToDecrypt, Base64.NO_WRAP);
  65 + byte[] deCryptedBytes = dcipher.doFinal(encryptedTextBytes);
  66 + String charSet = "UTF-8";
  67 + return new String(deCryptedBytes, charSet);
  68 + } catch (GeneralSecurityException | UnsupportedEncodingException e) {
  69 + e.printStackTrace();
  70 + }
  71 + return "";
  72 + }
  73 +}
... ...
Risiko/app/src/main/res/layout/activity_main_page.xml
... ... @@ -7,6 +7,21 @@
7 7 tools:context="com.risiko.risiko.activity.Startside">
8 8  
9 9 <TextView
  10 + android:id="@+id/tv_wrongMessageLogin"
  11 + android:layout_width="wrap_content"
  12 + android:layout_height="wrap_content"
  13 + android:layout_marginBottom="8dp"
  14 + android:layout_marginEnd="8dp"
  15 + android:layout_marginStart="8dp"
  16 + android:layout_marginTop="8dp"
  17 + android:textColor="@color/red"
  18 + android:visibility="invisible"
  19 + app:layout_constraintBottom_toBottomOf="parent"
  20 + app:layout_constraintEnd_toEndOf="parent"
  21 + app:layout_constraintStart_toStartOf="parent"
  22 + app:layout_constraintTop_toBottomOf="@+id/btn_to_main_menu" />
  23 +
  24 + <TextView
10 25 android:id="@+id/app_name"
11 26 android:layout_marginTop="50dp"
12 27 android:layout_width="wrap_content"
... ...
Risiko/app/src/main/res/values/colors.xml
... ... @@ -8,4 +8,5 @@
8 8 <color name="colorLightGray">#E0E0E0</color>
9 9 <color name="colorWhite">#ffffff</color>
10 10 <color name="background_material_light">#e3e8e8e8</color>
  11 + <color name="red">#ff0000</color>
11 12 </resources>
... ...
Risiko/app/src/main/res/values/strings.xml
... ... @@ -39,6 +39,16 @@
39 39 <string name="no">Nei</string>
40 40 <string name="areYouSureEvent">Er du sikker på at du vil slette denne hendelsen?</string>
41 41 <string name="added_by">Lagt til av:</string>
  42 + <string name="api_login_link">http://192.168.84.67:3000/login</string>
  43 + <string name="encryption_key">0123456789abcdef0123456789abcdef0123456789abcdef</string>
  44 + <string name="preference_name_token">api-token</string>
  45 + <string name="packageName">api</string>
  46 + <string name="something_went_wrong_with_login">Noe gikk galt</string>
  47 + <string name="server_error">Server feil</string>
  48 + <string name="wrong_password_or_username">Feil brukernavn eller passord</string>
  49 + <string name="error_invalid_password">Feil passord</string>
  50 + <string name="error_field_required">Dette feltet er påkrevd</string>
  51 + <string name="error_invalid_username">Uvalid brukernavn</string>
42 52  
43 53  
44 54 </resources>
... ...
Thumbs.db
No preview for this file type
restApi/.idea/workspace.xml
... ... @@ -2,11 +2,20 @@
2 2 <project version="4">
3 3 <component name="ChangeListManager">
4 4 <list default="true" id="0e20d303-9de8-4113-bfd9-019e72b304dc" name="Default" comment="">
5   - <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/Incident.java" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/Incident.java" />
6   - <change beforePath="$PROJECT_DIR$/api/routes/routes.js" afterPath="$PROJECT_DIR$/api/routes/routes.js" />
  5 + <change beforePath="$PROJECT_DIR$/../Risiko/.idea/caches/build_file_checksums.ser" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/.idea/caches/build_file_checksums.ser" afterDir="false" />
  6 + <change beforePath="$PROJECT_DIR$/../Risiko/.idea/gradle.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/.idea/gradle.xml" afterDir="false" />
  7 + <change beforePath="$PROJECT_DIR$/../Risiko/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/.idea/misc.xml" afterDir="false" />
  8 + <change beforePath="$PROJECT_DIR$/../Risiko/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/.idea/modules.xml" afterDir="false" />
  9 + <change beforePath="$PROJECT_DIR$/../Risiko/.idea/runConfigurations.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/.idea/runConfigurations.xml" afterDir="false" />
  10 + <change beforePath="$PROJECT_DIR$/../Risiko/.idea/vcs.xml" beforeDir="false" />
  11 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/MainPage.java" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/MainPage.java" afterDir="false" />
  12 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/res/layout/activity_main_page.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/res/layout/activity_main_page.xml" afterDir="false" />
  13 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/res/values/colors.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/res/values/colors.xml" afterDir="false" />
  14 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/res/values/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/res/values/strings.xml" afterDir="false" />
  15 + <change beforePath="$PROJECT_DIR$/../Thumbs.db" beforeDir="false" afterPath="$PROJECT_DIR$/../Thumbs.db" afterDir="false" />
  16 + <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
7 17 </list>
8 18 <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
9   - <option name="TRACKING_ENABLED" value="true" />
10 19 <option name="SHOW_DIALOG" value="false" />
11 20 <option name="HIGHLIGHT_CONFLICTS" value="true" />
12 21 <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
... ... @@ -18,8 +27,9 @@
18 27 <counts>
19 28 <entry key="project.closed" value="2" />
20 29 <entry key="project.open.time.1" value="1" />
  30 + <entry key="project.open.time.24" value="1" />
21 31 <entry key="project.open.time.31" value="1" />
22   - <entry key="project.opened" value="2" />
  32 + <entry key="project.opened" value="3" />
23 33 </counts>
24 34 </usages-collector>
25 35 <usages-collector id="statistics.file.extensions.edit">
... ... @@ -48,22 +58,20 @@
48 58 </component>
49 59 <component name="FileEditorManager">
50 60 <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
51   - <file leaf-file-name="routes.js" pinned="false" current-in-tab="true">
  61 + <file pinned="false" current-in-tab="true">
52 62 <entry file="file://$PROJECT_DIR$/api/routes/routes.js">
53 63 <provider selected="true" editor-type-id="text-editor">
54   - <state relative-caret-position="424">
55   - <caret line="263" column="4" lean-forward="true" selection-start-line="263" selection-start-column="4" selection-end-line="263" selection-end-column="4" />
56   - <folding />
  64 + <state relative-caret-position="1809">
  65 + <caret line="367" column="1" lean-forward="true" selection-start-line="367" selection-start-column="1" selection-end-line="367" selection-end-column="1" />
57 66 </state>
58 67 </provider>
59 68 </entry>
60 69 </file>
61   - <file leaf-file-name="package.json" pinned="false" current-in-tab="false">
  70 + <file pinned="false" current-in-tab="false">
62 71 <entry file="file://$PROJECT_DIR$/package.json">
63 72 <provider selected="true" editor-type-id="text-editor">
64   - <state relative-caret-position="120">
65   - <caret line="8" column="48" lean-forward="false" selection-start-line="8" selection-start-column="48" selection-end-line="8" selection-end-column="48" />
66   - <folding />
  73 + <state relative-caret-position="153">
  74 + <caret line="9" column="4" selection-start-line="9" selection-start-column="4" selection-end-line="9" selection-end-column="4" />
67 75 </state>
68 76 </provider>
69 77 </entry>
... ... @@ -102,27 +110,16 @@
102 110 <path value="$PROJECT_DIR$/package.json" />
103 111 </packageJsonPaths>
104 112 </component>
105   - <component name="ProjectFrameBounds" fullScreen="true">
106   - <option name="y" value="23" />
107   - <option name="width" value="1440" />
108   - <option name="height" value="873" />
  113 + <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
  114 + <component name="ProjectFrameBounds" extendedState="6">
  115 + <option name="width" value="1920" />
  116 + <option name="height" value="1080" />
109 117 </component>
110 118 <component name="ProjectView">
111   - <navigator currentView="ProjectPane" proportions="" version="1">
112   - <flattenPackages />
113   - <showMembers />
114   - <showModules />
115   - <showLibraryContents />
116   - <hideEmptyPackages />
117   - <abbreviatePackageNames />
118   - <autoscrollToSource />
119   - <autoscrollFromSource />
120   - <sortByType />
121   - <manualOrder />
  119 + <navigator proportions="" version="1">
122 120 <foldersAlwaysOnTop value="true" />
123 121 </navigator>
124 122 <panes>
125   - <pane id="Scope" />
126 123 <pane id="ProjectPane">
127 124 <subPane>
128 125 <expand>
... ... @@ -151,7 +148,7 @@
151 148 <select />
152 149 </subPane>
153 150 </pane>
154   - <pane id="Scratches" />
  151 + <pane id="Scope" />
155 152 </panes>
156 153 </component>
157 154 <component name="PropertiesComponent">
... ... @@ -171,7 +168,9 @@
171 168 </option>
172 169 </component>
173 170 <component name="RunManager" selected="npm.debug">
174   - <configuration name="server.js" type="NodeJSConfigurationType" factoryName="Node.js" temporary="true" path-to-js-file="server.js" working-dir="$PROJECT_DIR$" />
  171 + <configuration name="server.js" type="NodeJSConfigurationType" factoryName="Node.js" temporary="true" path-to-js-file="server.js" working-dir="$PROJECT_DIR$">
  172 + <method v="2" />
  173 + </configuration>
175 174 <configuration name="api" type="js.build_tools.npm" factoryName="npm" temporary="true" nameIsGenerated="true">
176 175 <package-json value="$PROJECT_DIR$/package.json" />
177 176 <command value="run" />
... ... @@ -180,6 +179,7 @@
180 179 </scripts>
181 180 <node-interpreter value="project" />
182 181 <envs />
  182 + <method v="2" />
183 183 </configuration>
184 184 <configuration name="debug" type="js.build_tools.npm" factoryName="npm" temporary="true" nameIsGenerated="true">
185 185 <package-json value="$PROJECT_DIR$/package.json" />
... ... @@ -189,23 +189,21 @@
189 189 </scripts>
190 190 <node-interpreter value="project" />
191 191 <envs />
  192 + <method v="2" />
192 193 </configuration>
193   - <list size="3">
194   - <item index="0" class="java.lang.String" itemvalue="Node.js.server.js" />
195   - <item index="1" class="java.lang.String" itemvalue="npm.api" />
196   - <item index="2" class="java.lang.String" itemvalue="npm.debug" />
  194 + <list>
  195 + <item itemvalue="Node.js.server.js" />
  196 + <item itemvalue="npm.api" />
  197 + <item itemvalue="npm.debug" />
197 198 </list>
198 199 <recent_temporary>
199   - <list size="3">
200   - <item index="0" class="java.lang.String" itemvalue="npm.debug" />
201   - <item index="1" class="java.lang.String" itemvalue="npm.api" />
202   - <item index="2" class="java.lang.String" itemvalue="Node.js.server.js" />
  200 + <list>
  201 + <item itemvalue="npm.debug" />
  202 + <item itemvalue="npm.api" />
  203 + <item itemvalue="Node.js.server.js" />
203 204 </list>
204 205 </recent_temporary>
205 206 </component>
206   - <component name="ShelveChangesManager" show_recycled="false">
207   - <option name="remove_strategy" value="false" />
208   - </component>
209 207 <component name="SvnConfiguration">
210 208 <configuration />
211 209 </component>
... ... @@ -223,35 +221,38 @@
223 221 <workItem from="1541681303243" duration="9060000" />
224 222 <workItem from="1542189792461" duration="7537000" />
225 223 <workItem from="1542881688157" duration="125000" />
  224 + <workItem from="1542894129000" duration="445000" />
  225 + <workItem from="1543239135040" duration="874000" />
226 226 </task>
227 227 <servers />
228 228 </component>
229 229 <component name="TimeTrackingManager">
230   - <option name="totallyTimeSpent" value="29444000" />
  230 + <option name="totallyTimeSpent" value="30763000" />
231 231 </component>
232 232 <component name="ToolWindowManager">
233   - <frame x="0" y="0" width="1440" height="900" extended-state="6" />
  233 + <frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
234 234 <editor active="true" />
235 235 <layout>
236   - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.20014094" sideWeight="0.70495766" order="0" side_tool="false" content_ui="combo" />
237   - <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
238   - <window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
239   - <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="10" side_tool="true" content_ui="tabs" />
240   - <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3277635" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
241   - <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
242   - <window_info id="npm" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.20014094" sideWeight="0.29504234" order="2" side_tool="true" content_ui="tabs" />
243   - <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
244   - <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
245   - <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39903265" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
246   - <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" />
247   - <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
248   - <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
249   - <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
250   - <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
251   - <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
252   - <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
253   - <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
254   - <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
  236 + <window_info content_ui="combo" id="Project" order="0" sideWeight="0.69739693" visible="true" weight="0.19968387" />
  237 + <window_info id="Structure" order="1" weight="0.25" />
  238 + <window_info id="npm" order="2" sideWeight="0.30260304" side_tool="true" visible="true" weight="0.19968387" />
  239 + <window_info id="Favorites" order="3" side_tool="true" />
  240 + <window_info anchor="bottom" id="Message" order="0" />
  241 + <window_info anchor="bottom" id="Find" order="1" />
  242 + <window_info anchor="bottom" id="Run" order="2" weight="0.3277635" />
  243 + <window_info anchor="bottom" id="Debug" order="3" weight="0.39903265" />
  244 + <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
  245 + <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
  246 + <window_info anchor="bottom" id="TODO" order="6" />
  247 + <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
  248 + <window_info anchor="bottom" id="Version Control" order="8" />
  249 + <window_info anchor="bottom" id="Terminal" order="9" />
  250 + <window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
  251 + <window_info anchor="bottom" id="Messages" order="11" />
  252 + <window_info anchor="right" id="Commander" order="0" weight="0.4" />
  253 + <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
  254 + <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
  255 + <window_info anchor="right" id="Database" order="3" />
255 256 </layout>
256 257 </component>
257 258 <component name="TypeScriptGeneratedFilesManager">
... ... @@ -260,47 +261,25 @@
260 261 <component name="VcsContentAnnotationSettings">
261 262 <option name="myLimit" value="2678400000" />
262 263 </component>
263   - <component name="XDebuggerManager">
264   - <breakpoint-manager />
265   - <watches-manager />
266   - </component>
267 264 <component name="editorHistoryManager">
268   - <entry file="file://$PROJECT_DIR$/api/routes/routes.js">
269   - <provider selected="true" editor-type-id="text-editor">
270   - <state relative-caret-position="0">
271   - <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
272   - <folding />
273   - </state>
274   - </provider>
275   - </entry>
276   - <entry file="file://$PROJECT_DIR$/package.json">
277   - <provider selected="true" editor-type-id="text-editor">
278   - <state relative-caret-position="120">
279   - <caret line="8" column="48" lean-forward="false" selection-start-line="8" selection-start-column="48" selection-end-line="8" selection-end-column="48" />
280   - <folding />
281   - </state>
282   - </provider>
283   - </entry>
284 265 <entry file="file://$PROJECT_DIR$/node_modules/cassandra-driver/lib/requests.js">
285 266 <provider selected="true" editor-type-id="text-editor">
286 267 <state relative-caret-position="190">
287   - <caret line="106" column="9" lean-forward="false" selection-start-line="106" selection-start-column="9" selection-end-line="106" selection-end-column="9" />
  268 + <caret line="106" column="9" selection-start-line="106" selection-start-column="9" selection-end-line="106" selection-end-column="9" />
288 269 </state>
289 270 </provider>
290 271 </entry>
291 272 <entry file="file://$PROJECT_DIR$/api/routes/routes.js">
292 273 <provider selected="true" editor-type-id="text-editor">
293   - <state relative-caret-position="424">
294   - <caret line="263" column="4" lean-forward="true" selection-start-line="263" selection-start-column="4" selection-end-line="263" selection-end-column="4" />
295   - <folding />
  274 + <state relative-caret-position="1809">
  275 + <caret line="367" column="1" lean-forward="true" selection-start-line="367" selection-start-column="1" selection-end-line="367" selection-end-column="1" />
296 276 </state>
297 277 </provider>
298 278 </entry>
299 279 <entry file="file://$PROJECT_DIR$/package.json">
300 280 <provider selected="true" editor-type-id="text-editor">
301   - <state relative-caret-position="120">
302   - <caret line="8" column="48" lean-forward="false" selection-start-line="8" selection-start-column="48" selection-end-line="8" selection-end-column="48" />
303   - <folding />
  281 + <state relative-caret-position="153">
  282 + <caret line="9" column="4" selection-start-line="9" selection-start-column="4" selection-end-line="9" selection-end-column="4" />
304 283 </state>
305 284 </provider>
306 285 </entry>
... ...