Commit 70b54cf89856e2950be07bc4255fbe1a3cb09459

Authored by Ali B
1 parent 5dd26f1c

The app is now complete. User is now fetched from database and used where a user…

… is required like when creating a new incident and in the logs. Usergroups now working properly, a user can choose which group a new incident can be viewed by and the incident will be invisible if the a user is not in that access group. Updated the database and dataclasses with new fields to support everything we need. Also created som test users with different groups for testing.
Risiko/app/src/main/java/activity/Accesslog.java
... ... @@ -39,7 +39,7 @@ public class Accesslog extends AppCompatActivity {
39 39 System.out.println("ASSOSIATED INCIDENT" + assosiatedincident);
40 40  
41 41  
42   - Api.get().getAccesslog(assosiatedincident).enqueue(new Callback<List<dataclasses.Accesslog>>() {
  42 + Api.getInstance().getAccesslog(assosiatedincident).enqueue(new Callback<List<dataclasses.Accesslog>>() {
43 43 @Override
44 44 public void onResponse(Call<List<dataclasses.Accesslog>> call, Response<List<dataclasses.Accesslog>> response) {
45 45 if (response.isSuccessful()) {
... ...
Risiko/app/src/main/java/activity/Activities.java
... ... @@ -81,9 +81,7 @@ public class Activities extends AppCompatActivity {
81 81 public boolean onOptionsItemSelected(MenuItem item) {
82 82 switch (item.getItemId()) {
83 83 case R.id.action_logout:
84   - //TODO: LEGG TIL LOGG-UT-FUNKSJON
85   - Toast.makeText(Activities.this, "Logger ut",
86   - Toast.LENGTH_LONG).show();
  84 + TokenEncrypter.logOut(this);
87 85 return true;
88 86  
89 87 case R.id.action_home:
... ...
Risiko/app/src/main/java/activity/EditEvaluation.java
... ... @@ -22,6 +22,7 @@ import java.util.Set;
22 22 import java.util.TreeSet;
23 23  
24 24 import api.Api;
  25 +import api.TokenEncrypter;
25 26 import dataclasses.*;
26 27 import retrofit2.Call;
27 28 import retrofit2.Callback;
... ... @@ -34,6 +35,7 @@ public class EditEvaluation extends AppCompatActivity {
34 35 private Spinner spinnerConsequence, spinnerProbability;
35 36 Button editEvaluation;
36 37 String allFieldsChanged, titleChanged, measuresChanged, outcomeChanged, consequenceChanged, probabilityChanged;
  38 + String token;
37 39  
38 40  
39 41 @Override
... ... @@ -67,7 +69,7 @@ public class EditEvaluation extends AppCompatActivity {
67 69 etOutcome.setText(outcome);
68 70 etMeasures.setText(measures);
69 71  
70   -
  72 + token = TokenEncrypter.getToken(this);
71 73  
72 74 editEvaluation.setOnClickListener(view -> {
73 75 if (inputAccepted()) {
... ... @@ -108,7 +110,7 @@ public class EditEvaluation extends AppCompatActivity {
108 110 System.out.println("FØLGENDE FELT BLE OPPDATERT: " + fieldschanged);
109 111 logchanges(fieldschanged, logDate, id);
110 112  
111   - Api.get().editEvaluation(id, newtitle, newOutcome, newMeasures, consequenceValue, probabilityValue, assosiatedActivity).enqueue(new Callback<Evaluation>() {
  113 + Api.getInstance().editEvaluation(id, newtitle, newOutcome, newMeasures, consequenceValue, probabilityValue, assosiatedActivity).enqueue(new Callback<Evaluation>() {
112 114 @Override
113 115 public void onResponse(Call<Evaluation> call, Response<Evaluation> response) {
114 116 System.out.println(response);
... ... @@ -128,22 +130,36 @@ public class EditEvaluation extends AppCompatActivity {
128 130 });
129 131 }
130 132  
131   - //TODO: HENT UT DET FAKTISKE BRUKERNAVNET
132   -
133 133 private void logchanges(String fieldsChanged, String date, String assosiatedEval) {
134   - Api.get().newLogEntry("Anne Liane", date, fieldsChanged, assosiatedEval).enqueue(new Callback<String>() {
  134 + Api.getInstance().getUser(token).enqueue(new Callback<User>() {
135 135 @Override
136   - public void onResponse(Call<String> call, Response<String> response) {
137   - System.out.println(response);
  136 + public void onResponse(Call<User> call, Response<User> response) {
  137 + if (response.body() == null) {
  138 + TokenEncrypter.logOut(EditEvaluation.this);
  139 + return;
  140 + }
  141 +
  142 + Api.getInstance().newLogEntry(response.body().getName(), date, fieldsChanged, assosiatedEval).enqueue(new Callback<String>() {
  143 + @Override
  144 + public void onResponse(Call<String> call, Response<String> response) {
  145 + System.out.println(response);
  146 + }
  147 +
  148 + @Override
  149 + public void onFailure(Call<String> call, Throwable t) {
  150 + t.printStackTrace();
  151 +
  152 + }
  153 + });
138 154 }
139 155  
140 156 @Override
141   - public void onFailure(Call<String> call, Throwable t) {
142   - t.printStackTrace();
143   -
  157 + public void onFailure(Call<User> call, Throwable t) {
  158 + TokenEncrypter.logOut(EditEvaluation.this);
144 159 }
145 160 });
146 161  
  162 +
147 163 }
148 164  
149 165  
... ... @@ -198,9 +214,7 @@ public class EditEvaluation extends AppCompatActivity {
198 214 public boolean onOptionsItemSelected(MenuItem item) {
199 215 switch (item.getItemId()) {
200 216 case R.id.action_logout:
201   - //TODO: LEGG TIL LOGG-UT-FUNKSJON
202   - Toast.makeText(EditEvaluation.this, "Logger ut",
203   - Toast.LENGTH_LONG).show();
  217 + TokenEncrypter.logOut(this);
204 218 return true;
205 219  
206 220 case R.id.action_home:
... ...
Risiko/app/src/main/java/activity/EditIncident.java
... ... @@ -160,9 +160,7 @@ public class EditIncident extends AppCompatActivity {
160 160 public boolean onOptionsItemSelected(MenuItem item) {
161 161 switch (item.getItemId()) {
162 162 case R.id.action_logout:
163   - //TODO: LEGG TIL LOGG-UT-FUNKSJON
164   - Toast.makeText(EditIncident.this, "Logger ut",
165   - Toast.LENGTH_LONG).show();
  163 + TokenEncrypter.logOut(this);
166 164 return true;
167 165  
168 166 case R.id.action_home:
... ...
Risiko/app/src/main/java/activity/EvaluationLog.java
... ... @@ -18,6 +18,7 @@ import java.util.List;
18 18 import adapters.ListAdapterActivities;
19 19 import adapters.ListAdapterEvaluationLog;
20 20 import api.Api;
  21 +import api.TokenEncrypter;
21 22 import dataclasses.Activity;
22 23 import dataclasses.Evaluation;
23 24 import retrofit2.Call;
... ... @@ -44,7 +45,7 @@ public class EvaluationLog extends AppCompatActivity {
44 45 log.add(new dataclasses.EvaluationLog("Kari Nordmann", "2015-01-02", "Tittel, konsekvens", assosiatedeval));
45 46 insertLog(log);*/
46 47  
47   - Api.get().getEvaluationLog(assosiatedeval).enqueue(new Callback<List<dataclasses.EvaluationLog>>() {
  48 + Api.getInstance().getEvaluationLog(assosiatedeval).enqueue(new Callback<List<dataclasses.EvaluationLog>>() {
48 49 @Override
49 50 public void onResponse(Call<List<dataclasses.EvaluationLog>> call, Response<List<dataclasses.EvaluationLog>> response) {
50 51 if (response.isSuccessful()) {
... ... @@ -56,7 +57,6 @@ public class EvaluationLog extends AppCompatActivity {
56 57 logs.add(e);
57 58  
58 59 }
59   -
60 60 insertLog(logs);
61 61 }
62 62 }
... ... @@ -87,9 +87,7 @@ public class EvaluationLog extends AppCompatActivity {
87 87 public boolean onOptionsItemSelected(MenuItem item) {
88 88 switch (item.getItemId()) {
89 89 case R.id.action_logout:
90   - //TODO: LEGG TIL LOGG-UT-FUNKSJON
91   - Toast.makeText(EvaluationLog.this, "Logger ut",
92   - Toast.LENGTH_LONG).show();
  90 + TokenEncrypter.logOut(this);
93 91 return true;
94 92  
95 93 case R.id.action_home:
... ...
Risiko/app/src/main/java/activity/Evaluations.java
... ... @@ -128,8 +128,7 @@ public class Evaluations extends AppCompatActivity {
128 128 TextView probabilityLow = promptView.findViewById(R.id.pop_probability_low);
129 129 TextView probabilityMedium = promptView.findViewById(R.id.pop_probability_medium);
130 130 TextView probabilityHigh = promptView.findViewById(R.id.pop_probability_high);
131   - //TODO: IMPLEMENTERE DET SLIK AT VI FÅR HENTET UT HVILKEN BRUKER SOM HAR SKREVET SAKEN
132   - TextView addedBy = promptView.findViewById(R.id.tv_added_by);
  131 + TextView createdBy = promptView.findViewById(R.id.tv_created_by_evaluation);
133 132  
134 133 Button updateEvaluation = promptView.findViewById(R.id.pop_edit_evaluation);
135 134 Button evaluationLog = promptView.findViewById(R.id.pop_log);
... ... @@ -165,6 +164,7 @@ public class Evaluations extends AppCompatActivity {
165 164 headline.setText(evaluation.getTitle());
166 165 outcome.setText("- " + evaluation.getOutcome());
167 166 measures.setText("- " + evaluation.getMeasures());
  167 + createdBy.setText("Skrevet av: " + evaluation.getCreatedby());
168 168  
169 169 alertDialogBuilder.setCancelable(false)
170 170 .setNegativeButton(getString(R.string.cancel),
... ... @@ -238,9 +238,7 @@ public class Evaluations extends AppCompatActivity {
238 238 public boolean onOptionsItemSelected(MenuItem item) {
239 239 switch (item.getItemId()) {
240 240 case R.id.action_logout:
241   - //TODO: LEGG TIL LOGG-UT-FUNKSJON
242   - Toast.makeText(Evaluations.this, "Logger ut",
243   - Toast.LENGTH_LONG).show();
  241 + TokenEncrypter.logOut(this);
244 242 return true;
245 243  
246 244 case R.id.action_home:
... ...
Risiko/app/src/main/java/activity/Incident.java
... ... @@ -32,6 +32,7 @@ import api.Api;
32 32 import api.TokenEncrypter;
33 33 import database.DatabaseSource;
34 34 import dataclasses.Evaluation;
  35 +import dataclasses.User;
35 36 import retrofit2.Call;
36 37 import retrofit2.Callback;
37 38 import retrofit2.Response;
... ... @@ -67,8 +68,32 @@ public class Incident extends AppCompatActivity {
67 68 public void onResponse(Call<List<dataclasses.Incident>> call, Response<List<dataclasses.Incident>> response) {
68 69 if (response.isSuccessful()) {
69 70 List<dataclasses.Incident> incidents = response.body();
70   - if (incidents != null)
71   - insertEvents(incidents);
  71 +
  72 + if (incidents != null){
  73 + Api.getInstance().getUser(token).enqueue(new Callback<User>() {
  74 + @Override
  75 + public void onResponse(Call<User> call, Response<User> response) {
  76 + if (response.body() == null) {
  77 + TokenEncrypter.logOut(Incident.this);
  78 + return;
  79 + }
  80 + List<dataclasses.Incident> accessableIncidents = new ArrayList<>();
  81 +
  82 + for (dataclasses.Incident i : incidents) {
  83 + if (i.getAccessby() == response.body().getGroupnumber() || i.getAccessby() == User.READACCESS_ALL || response.body().getName().equals(i.getCreatedby())) {
  84 + accessableIncidents.add(i);
  85 + }
  86 + }
  87 + insertEvents(accessableIncidents);
  88 + }
  89 +
  90 + @Override
  91 + public void onFailure(Call<User> call, Throwable t) {
  92 + TokenEncrypter.logOut(Incident.this);
  93 + }
  94 + });
  95 + }
  96 +
72 97 }
73 98 }
74 99  
... ... @@ -92,14 +117,30 @@ public class Incident extends AppCompatActivity {
92 117 chosenEventId = ((dataclasses.Incident) lv.getItemAtPosition(position)).getId();
93 118 showEventPopup((dataclasses.Incident) lv.getItemAtPosition(position));
94 119  
95   - Api.getInstance().newAccesslogEntry(chosenEventId, "Timon", "Ambulansepersonell", logDate).enqueue(new Callback<String>() {
  120 + Api.getInstance().getUser(token).enqueue(new Callback<User>() {
96 121 @Override
97   - public void onResponse(Call<String> call, Response<String> response) {
  122 + public void onResponse(Call<User> call, Response<User> response) {
  123 + if (response.body() == null) {
  124 + TokenEncrypter.logOut(Incident.this);
  125 + return;
  126 + }
  127 +
  128 + Api.getInstance().newAccesslogEntry(chosenEventId, response.body().getName(), response.body().getReadAccessString(), logDate).enqueue(new Callback<String>() {
  129 + @Override
  130 + public void onResponse(Call<String> call, Response<String> response) {
  131 +
  132 + }
  133 +
  134 + @Override
  135 + public void onFailure(Call<String> call, Throwable t) {
  136 +
  137 + }
  138 + });
98 139  
99 140 }
100 141  
101 142 @Override
102   - public void onFailure(Call<String> call, Throwable t) {
  143 + public void onFailure(Call<User> call, Throwable t) {
103 144  
104 145 }
105 146 });
... ... @@ -121,13 +162,28 @@ public class Incident extends AppCompatActivity {
121 162 Button deleteEvent = promptView.findViewById(R.id.pop_delete_event);
122 163 Button editEvent = promptView.findViewById(R.id.pop_edit_event);
123 164 Button seeLog = promptView.findViewById(R.id.btn_see_log);
124   -
125   - //TODO: IMPLEMENTERE DET SLIK AT VI FÅR HENTET UT HVILKEN BRUKER SOM HAR SKREVET SAKEN
126 165 TextView addedBy = promptView.findViewById(R.id.tv_added_by);
127 166  
128 167 deleteEvent.setOnClickListener(view -> deleteEventDialog());
129 168 editEvent.setOnClickListener(view -> editIncident(chosenItem.getId(), chosenItem.getTitle(), chosenItem.getDate(), chosenItem.getDescription(), chosenItem.getLocation(), chosenItem.getAssociatedeval()));
130   - seeLog.setOnClickListener(view -> goToAccesslog(chosenEventId));
  169 +
  170 + Api.getInstance().getUser(token).enqueue(new Callback<User>() {
  171 + @Override
  172 + public void onResponse(Call<User> call, Response<User> response) {
  173 + if (response.body() != null) {
  174 + if (response.body().getName().equals(chosenItem.getCreatedby())) {
  175 + seeLog.setVisibility(View.VISIBLE);
  176 + seeLog.setOnClickListener(view -> goToAccesslog(chosenEventId));
  177 + }
  178 +
  179 + }
  180 + }
  181 +
  182 + @Override
  183 + public void onFailure(Call<User> call, Throwable t) {
  184 +
  185 + }
  186 + });
131 187  
132 188 Api.getInstance().getEvaluation(chosenItem.getAssociatedeval()).enqueue(new Callback<Evaluation>() {
133 189 @Override
... ... @@ -149,6 +205,7 @@ public class Incident extends AppCompatActivity {
149 205 tvDate.setText(chosenItem.getDate());
150 206 tvLocation.setText(chosenItem.getLocation());
151 207 tvDescription.setText(chosenItem.getDescription());
  208 + addedBy.setText(chosenItem.getCreatedby());
152 209  
153 210 Evaluation associatedEvaluation = dbs.getEvaluationById(chosenItem.getAssociatedeval());
154 211  
... ... @@ -217,9 +274,7 @@ public class Incident extends AppCompatActivity {
217 274 public boolean onOptionsItemSelected(MenuItem item) {
218 275 switch (item.getItemId()) {
219 276 case R.id.action_logout:
220   - //TODO: LEGG TIL LOGG-UT-FUNKSJON
221   - Toast.makeText(Incident.this, "Logger ut",
222   - Toast.LENGTH_LONG).show();
  277 + TokenEncrypter.logOut(this);
223 278 return true;
224 279  
225 280 case R.id.action_home:
... ...
Risiko/app/src/main/java/activity/Information.java
... ... @@ -10,6 +10,8 @@ import android.widget.Toast;
10 10  
11 11 import com.risiko.risiko.R;
12 12  
  13 +import api.TokenEncrypter;
  14 +
13 15 public class Information extends AppCompatActivity {
14 16  
15 17 @Override
... ... @@ -31,7 +33,7 @@ public class Information extends AppCompatActivity {
31 33 public boolean onOptionsItemSelected(MenuItem item) {
32 34 switch (item.getItemId()) {
33 35 case R.id.action_logout:
34   - //TODO: LEGG TIL LOGG-UT-FUNKSJON
  36 + TokenEncrypter.logOut(this);
35 37 return true;
36 38  
37 39 case R.id.action_home:
... ...
Risiko/app/src/main/java/activity/MainMenu.java
... ... @@ -11,6 +11,8 @@ import android.widget.Toast;
11 11  
12 12 import com.risiko.risiko.R;
13 13  
  14 +import api.TokenEncrypter;
  15 +
14 16 public class MainMenu extends AppCompatActivity {
15 17 Button toActivityList;
16 18 Button toEventList;
... ... @@ -51,7 +53,7 @@ public class MainMenu extends AppCompatActivity {
51 53 public boolean onOptionsItemSelected(MenuItem item) {
52 54 switch (item.getItemId()) {
53 55 case R.id.action_logout:
54   - //TODO: LEGG TIL LOGG-UT-FUNKSJON
  56 + TokenEncrypter.logOut(this);
55 57 return true;
56 58  
57 59 case R.id.action_home:
... ...
Risiko/app/src/main/java/activity/NewEvaluation.java
... ... @@ -19,6 +19,7 @@ import java.util.UUID;
19 19 import api.Api;
20 20 import api.TokenEncrypter;
21 21 import database.DatabaseSource;
  22 +import dataclasses.User;
22 23 import retrofit2.Call;
23 24 import retrofit2.Callback;
24 25 import retrofit2.Response;
... ... @@ -59,20 +60,39 @@ public class NewEvaluation extends AppCompatActivity {
59 60 String consequence = spinnerConsequence.getSelectedItem().toString();
60 61 String probability = spinnerProbability.getSelectedItem().toString();
61 62  
62   - int consequenceValue = getConsequenceValue(consequence);
63   - int probabilityValue = getProbabilityValue(probability);
64   -
65   - Api.getInstance().newEvaluation(title, UUID.randomUUID().toString() ,activityId,consequenceValue,action,outcome,probabilityValue).enqueue(new Callback<String>() {
  63 + Api.getInstance().getUser(token).enqueue(new Callback<User>() {
66 64 @Override
67   - public void onResponse(Call<String> call, Response<String> response) {
68   - System.out.println(response);
  65 + public void onResponse(Call<User> call, Response<User> response) {
  66 + int consequenceValue = getConsequenceValue(consequence);
  67 + int probabilityValue = getProbabilityValue(probability);
  68 +
  69 + if (response.body() == null) {
  70 + TokenEncrypter.logOut(NewEvaluation.this);
  71 + return;
  72 + }
  73 +
  74 +
  75 + Api.getInstance().newEvaluation(title, UUID.randomUUID().toString() ,activityId,consequenceValue,action,outcome,probabilityValue, response.body().getName()).enqueue(new Callback<String>() {
  76 + @Override
  77 + public void onResponse(Call<String> call, Response<String> response) {
  78 + System.out.println(response);
  79 + }
  80 +
  81 + @Override
  82 + public void onFailure(Call<String> call, Throwable t) {
  83 + t.printStackTrace();
  84 + }
  85 + });
69 86 }
70 87  
71 88 @Override
72   - public void onFailure(Call<String> call, Throwable t) {
73   - t.printStackTrace();
  89 + public void onFailure(Call<User> call, Throwable t) {
  90 + TokenEncrypter.logOut(NewEvaluation.this);
74 91 }
75 92 });
  93 + ;
  94 +
  95 +
76 96  
77 97 //Evaluation newEval = new Evaluation(activityId, title, outcome, action, consequenceValue, probabilityValue);
78 98 //dbs.insertEvaluation(newEval);
... ... @@ -129,9 +149,7 @@ public class NewEvaluation extends AppCompatActivity {
129 149 public boolean onOptionsItemSelected(MenuItem item) {
130 150 switch (item.getItemId()) {
131 151 case R.id.action_logout:
132   - //TODO: LEGG TIL LOGG-UT-FUNKSJON
133   - Toast.makeText(NewEvaluation.this, "Logger ut",
134   - Toast.LENGTH_LONG).show();
  152 + TokenEncrypter.logOut(this);
135 153 return true;
136 154  
137 155 case R.id.action_home:
... ...
Risiko/app/src/main/java/activity/NewIncident.java
... ... @@ -25,6 +25,7 @@ import api.TokenEncrypter;
25 25 import database.DatabaseSource;
26 26 import dataclasses.Evaluation;
27 27 import dataclasses.Incident;
  28 +import dataclasses.User;
28 29 import retrofit2.Call;
29 30 import retrofit2.Callback;
30 31 import retrofit2.Response;
... ... @@ -59,10 +60,7 @@ public class NewIncident extends AppCompatActivity {
59 60  
60 61 //TODO FJERN DENNE MIDLERTIDIGE DELEN FOR LESEAKSESS
61 62  
62   - List<String> list = new ArrayList<>();
63   - list.add("Sykepleiere");
64   - list.add("Ambulansepersonell");
65   - list.add("Leger");
  63 + List<String> list = User.getAllReadAccesses();
66 64 ArrayAdapter<String> adapter2 = new ArrayAdapter<String>(NewIncident.this, android.R.layout.simple_spinner_item, list);
67 65 adapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
68 66 spinnerReadAccess.setAdapter(adapter2);
... ... @@ -94,24 +92,43 @@ public class NewIncident extends AppCompatActivity {
94 92 String associatedRiskTitle = spinnerAssociatedRisk.getSelectedItem().toString();
95 93 String associatedRisk = evalMap.get(associatedRiskTitle);
96 94  
97   - dataclasses.Incident newIncident = new Incident(id, date, location, title, description, associatedRisk);
98 95  
99 96  
100   - Api.getInstance().newIncident(date, title, id, associatedRisk, description, location).enqueue(new Callback<String>() {
  97 + Api.getInstance().getUser(token).enqueue(new Callback<User>() {
101 98 @Override
102   - public void onResponse(Call<String> call, Response<String> response) {
103   - System.out.println(response);
  99 + public void onResponse(Call<User> call, Response<User> response) {
  100 + if (response.body() == null) {
  101 + TokenEncrypter.logOut(NewIncident.this);
  102 + return;
  103 + }
  104 +
  105 + int chosenAccess = spinnerReadAccess.getSelectedItemPosition();
  106 + System.out.println(chosenAccess);
  107 +
  108 + Api.getInstance().newIncident(date, title, id, associatedRisk, description, location, response.body().getName(), chosenAccess).enqueue(new Callback<String>() {
  109 + @Override
  110 + public void onResponse(Call<String> call, Response<String> response) {
  111 + System.out.println(response);
  112 + }
  113 +
  114 + @Override
  115 + public void onFailure(Call<String> call, Throwable t) {
  116 + t.printStackTrace();
  117 + }
  118 + });
104 119 }
105 120  
106 121 @Override
107   - public void onFailure(Call<String> call, Throwable t) {
108   - t.printStackTrace();
109   -
  122 + public void onFailure(Call<User> call, Throwable t) {
  123 + TokenEncrypter.logOut(NewIncident.this);
110 124 }
111 125 });
112 126  
113 127  
114   - dbs.insertIncident(newIncident);
  128 +
  129 +
  130 +
  131 +// dbs.insertIncident(newIncident);
115 132 finish();
116 133 }
117 134 });
... ... @@ -162,9 +179,7 @@ public class NewIncident extends AppCompatActivity {
162 179 public boolean onOptionsItemSelected(MenuItem item) {
163 180 switch (item.getItemId()) {
164 181 case R.id.action_logout:
165   - //TODO: LEGG TIL LOGG-UT-FUNKSJON
166   - Toast.makeText(NewIncident.this, "Logger ut",
167   - Toast.LENGTH_LONG).show();
  182 + TokenEncrypter.logOut(this);
168 183 return true;
169 184  
170 185 case R.id.action_home:
... ...
Risiko/app/src/main/java/activity/SequenceOfActivities.java
... ... @@ -16,6 +16,8 @@ import android.widget.Toast;
16 16  
17 17 import com.risiko.risiko.R;
18 18  
  19 +import api.TokenEncrypter;
  20 +
19 21 public class SequenceOfActivities extends AppCompatActivity {
20 22 Button generateReport;
21 23  
... ... @@ -74,9 +76,7 @@ public class SequenceOfActivities extends AppCompatActivity {
74 76 public boolean onOptionsItemSelected(MenuItem item) {
75 77 switch (item.getItemId()) {
76 78 case R.id.action_logout:
77   - //TODO: LEGG TIL LOGG-UT-FUNKSJON
78   - Toast.makeText(SequenceOfActivities.this, "Logger ut",
79   - Toast.LENGTH_LONG).show();
  79 + TokenEncrypter.logOut(this);
80 80 return true;
81 81  
82 82 case R.id.action_home:
... ...
Risiko/app/src/main/java/api/Endpoints.java
... ... @@ -71,12 +71,13 @@ public interface Endpoints {
71 71 @FormUrlEncoded
72 72 @POST("incident")
73 73 Call<String> newIncident(@Field("date") String date, @Field("title") String title, @Field("id") String id, @Field("associatedEval") String associatedEval,
74   - @Field("description") String description, @Field("location") String location);
  74 + @Field("description") String description, @Field("location") String location, @Field("createdby") String createdBy, @Field("accessby") int accessBy);
75 75  
76 76 @FormUrlEncoded
77 77 @POST("evaluation")
78 78 Call<String> newEvaluation(@Field("title") String title, @Field("id") String id, @Field("associatedActivity") String associatedactivity,
79   - @Field("consequence") int consequence, @Field("measures") String measures, @Field("outcome") String outcome, @Field("probability") int probability);
  79 + @Field("consequence") int consequence, @Field("measures") String measures,
  80 + @Field("outcome") String outcome, @Field("probability") int probability, @Field("createdby") String createdBy);
80 81  
81 82  
82 83 @DELETE("incident/{id}")
... ...
Risiko/app/src/main/java/api/TokenEncrypter.java
... ... @@ -41,23 +41,6 @@ public class TokenEncrypter {
41 41 return "";
42 42 }
43 43  
44   - public static User getUserByToken(String token){
45   - System.out.println(token);
46   - final User[] user = new User[1];
47   - Api.getInstance().getUser(token).enqueue(new Callback<User>() {
48   - @Override
49   - public void onResponse(Call<User> call, Response<User> response) {
50   - user[0] = response.body();
51   - }
52   -
53   - @Override
54   - public void onFailure(Call<User> call, Throwable t) {
55   - System.out.println(t.getMessage());
56   - }
57   - });
58   - return user[0];
59   - }
60   -
61 44 /**
62 45 * Deletes token, finishes all activities and starts the loginActivity.
63 46 */
... ...
Risiko/app/src/main/java/dataclasses/Evaluation.java
... ... @@ -16,6 +16,7 @@ public class Evaluation {
16 16 String title;
17 17 String outcome;
18 18 String measures;
  19 + String createdby;
19 20 String uuid;
20 21  
21 22 int consequence;
... ... @@ -23,13 +24,14 @@ public class Evaluation {
23 24  
24 25 public Evaluation() { }
25 26  
26   - public Evaluation(String associatedactivity, String title, String outcome, String measures, int consequence, int probability) {
  27 + public Evaluation(String associatedactivity, String title, String outcome, String measures, int consequence, int probability, String createdBy) {
27 28 this.title = title;
28 29 this.associatedactivity = associatedactivity;
29 30 this.outcome = outcome;
30 31 this.measures = measures;
31 32 this.consequence = consequence;
32 33 this.probability = probability;
  34 + createdby = createdBy;
33 35 }
34 36  
35 37 public String getId() {
... ... @@ -69,6 +71,13 @@ public class Evaluation {
69 71 return consequence;
70 72 }
71 73  
  74 + public String getCreatedby() {
  75 + return createdby;
  76 + }
  77 +
  78 + public void setCreatedby(String createdby) {
  79 + this.createdby = createdby;
  80 + }
72 81  
73 82 public String getConsequenceString() {
74 83 switch (consequence) {
... ...
Risiko/app/src/main/java/dataclasses/Incident.java
... ... @@ -13,18 +13,22 @@ public class Incident {
13 13 private String title;
14 14 private String description;
15 15 private String associatedeval;
  16 + private String createdby;
  17 + private int accessby;
16 18  
17 19  
18 20 public Incident() {
19 21 }
20 22  
21   - public Incident(String id, String date, String place, String title, String description, String associatedeval) {
  23 + public Incident(String id, String date, String place, String title, String description, String associatedeval, String createdBy, int accessBy) {
22 24 this.id = id;
23 25 this.date = date;
24 26 this.location = place;
25 27 this.title = title;
26 28 this.description = description;
27 29 this.associatedeval = associatedeval;
  30 + createdby = createdBy;
  31 + accessby = accessBy;
28 32 }
29 33  
30 34 public Incident(String title) {
... ... @@ -78,4 +82,20 @@ public class Incident {
78 82 public void setId(String id) {
79 83 this.id = id;
80 84 }
  85 +
  86 + public String getCreatedby() {
  87 + return createdby;
  88 + }
  89 +
  90 + public void setCreatedby(String createdby) {
  91 + this.createdby = createdby;
  92 + }
  93 +
  94 + public int getAccessby() {
  95 + return accessby;
  96 + }
  97 +
  98 + public void setAccessby(int accessby) {
  99 + this.accessby = accessby;
  100 + }
81 101 }
... ...
Risiko/app/src/main/java/dataclasses/User.java
1 1 package dataclasses;
2 2  
  3 +import java.util.ArrayList;
  4 +
3 5 /**
4 6 * Created by kristinlaahneolsen on 22.11.2018.
5 7 */
6 8  
7 9 public class User {
8 10  
9   - public static final int READACCESS_ALL = 1, READACESS_NURSE_ANESTHETIST = 2, READACCESS_CHILD_NURSE = 3,
10   - READACCESS_ALL_TYPES_NURSE = 4, READACCESS_DOCTOR = 5, READACCESS_CONSULTANT = 6, READACCESS_PARAMEDICS = 7;
  11 + public static final int READACCESS_ALL = 0, READACESS_NURSE_ANESTHETIST = 1, READACCESS_CHILD_NURSE = 2,
  12 + READACCESS_ALL_TYPES_NURSE = 3, READACCESS_DOCTOR = 4, READACCESS_CONSULTANT = 5, READACCESS_PARAMEDICS = 6;
11 13  
12 14 String username;
13 15 String name;
... ... @@ -56,9 +58,18 @@ public class User {
56 58 }
57 59 }
58 60  
59   -
60   -
61   -
  61 + public static ArrayList<String> getAllReadAccesses(){
  62 + ArrayList<String> allAccesses = new ArrayList<>();
  63 + allAccesses.add(READACCESS_ALL, "All helsepersonell");
  64 + allAccesses.add(READACESS_NURSE_ANESTHETIST, "Anestiesisykepleier");
  65 + allAccesses.add(READACCESS_CHILD_NURSE, "Barnesykepleier");
  66 + allAccesses.add(READACCESS_ALL_TYPES_NURSE, "Alle typer sykepleiere");
  67 + allAccesses.add(READACCESS_DOCTOR, "Lege");
  68 + allAccesses.add(READACCESS_CONSULTANT, "Overlege");
  69 + allAccesses.add(READACCESS_PARAMEDICS, "Ambulansepersonell");
  70 +
  71 + return allAccesses;
  72 + }
62 73 }
63 74  
64 75  
... ...
Risiko/app/src/main/res/layout/activity_main_page.xml
... ... @@ -83,7 +83,8 @@
83 83 android:textStyle="italic"
84 84 app:layout_constraintLeft_toLeftOf="parent"
85 85 app:layout_constraintRight_toRightOf="parent"
86   - app:layout_constraintTop_toBottomOf="@id/et_username"/>
  86 + app:layout_constraintTop_toBottomOf="@id/et_username"
  87 + android:inputType="textPassword" />
87 88  
88 89  
89 90 <Button
... ...
Risiko/app/src/main/res/layout/popup_evaluation.xml
... ... @@ -47,7 +47,7 @@
47 47 </LinearLayout>
48 48  
49 49 <TextView
50   - android:id="@+id/tv_added_by"
  50 + android:id="@+id/tv_created_by_evaluation"
51 51 android:layout_width="match_parent"
52 52 android:layout_height="wrap_content"
53 53 android:text="@string/added_by"
... ...
Risiko/app/src/main/res/layout/popup_event.xml
... ... @@ -150,6 +150,7 @@
150 150 android:background="@color/colorLightGray"
151 151 android:layout_width="200dp"
152 152 android:layout_height="wrap_content"
  153 + android:visibility="invisible"
153 154 android:text="@string/accesss_log"/>
154 155  
155 156  
... ...
restApi/.idea/workspace.xml
... ... @@ -2,17 +2,19 @@
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$/../Konfidensialitet og sporbarhet i et distribuert system.docx" afterPath="$PROJECT_DIR$/../Konfidensialitet og sporbarhet i et distribuert system.docx" />
6   - <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/Incident.java" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/Incident.java" />
7   - <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/adapters/ListAdapterAccesslog.java" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/adapters/ListAdapterAccesslog.java" />
8   - <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/api/Endpoints.java" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/api/Endpoints.java" />
9   - <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/dataclasses/Accesslog.java" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/dataclasses/Accesslog.java" />
10   - <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
11   - <change beforePath="$PROJECT_DIR$/api/routes/routes.js" afterPath="$PROJECT_DIR$/api/routes/routes.js" />
12   - <change beforePath="$PROJECT_DIR$/../~$nfidensialitet og sporbarhet i et distribuert system.docx" afterPath="" />
  5 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/Accesslog.java" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/Accesslog.java" afterDir="false" />
  6 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/EditEvaluation.java" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/EditEvaluation.java" afterDir="false" />
  7 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/EvaluationLog.java" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/EvaluationLog.java" afterDir="false" />
  8 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/Evaluations.java" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/Evaluations.java" afterDir="false" />
  9 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/NewEvaluation.java" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/NewEvaluation.java" afterDir="false" />
  10 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/api/Endpoints.java" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/api/Endpoints.java" afterDir="false" />
  11 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/api/TokenEncrypter.java" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/api/TokenEncrypter.java" afterDir="false" />
  12 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/dataclasses/Evaluation.java" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/dataclasses/Evaluation.java" afterDir="false" />
  13 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/res/layout/popup_evaluation.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/res/layout/popup_evaluation.xml" afterDir="false" />
  14 + <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
  15 + <change beforePath="$PROJECT_DIR$/api/routes/routes.js" beforeDir="false" afterPath="$PROJECT_DIR$/api/routes/routes.js" afterDir="false" />
13 16 </list>
14 17 <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
15   - <option name="TRACKING_ENABLED" value="true" />
16 18 <option name="SHOW_DIALOG" value="false" />
17 19 <option name="HIGHLIGHT_CONFLICTS" value="true" />
18 20 <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
... ... @@ -24,18 +26,19 @@
24 26 <counts>
25 27 <entry key="project.closed" value="2" />
26 28 <entry key="project.open.time.1" value="1" />
  29 + <entry key="project.open.time.3" value="1" />
27 30 <entry key="project.open.time.31" value="1" />
28   - <entry key="project.opened" value="2" />
  31 + <entry key="project.opened" value="3" />
29 32 </counts>
30 33 </usages-collector>
31 34 <usages-collector id="statistics.file.extensions.edit">
32 35 <counts>
33   - <entry key="js" value="3212" />
  36 + <entry key="js" value="3537" />
34 37 </counts>
35 38 </usages-collector>
36 39 <usages-collector id="statistics.file.types.edit">
37 40 <counts>
38   - <entry key="JavaScript" value="3212" />
  41 + <entry key="JavaScript" value="3537" />
39 42 </counts>
40 43 </usages-collector>
41 44 <usages-collector id="statistics.file.types.open">
... ... @@ -54,42 +57,38 @@
54 57 </component>
55 58 <component name="FileEditorManager">
56 59 <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
57   - <file leaf-file-name="routes.js" pinned="false" current-in-tab="true">
  60 + <file pinned="false" current-in-tab="true">
58 61 <entry file="file://$PROJECT_DIR$/api/routes/routes.js">
59 62 <provider selected="true" editor-type-id="text-editor">
60   - <state relative-caret-position="369">
61   - <caret line="518" column="109" lean-forward="false" selection-start-line="518" selection-start-column="109" selection-end-line="518" selection-end-column="109" />
62   - <folding />
  63 + <state relative-caret-position="-7184">
  64 + <caret line="100" lean-forward="true" selection-start-line="100" selection-end-line="100" />
63 65 </state>
64 66 </provider>
65 67 </entry>
66 68 </file>
67   - <file leaf-file-name="server.js" pinned="false" current-in-tab="false">
  69 + <file pinned="false" current-in-tab="false">
68 70 <entry file="file://$PROJECT_DIR$/server.js">
69 71 <provider selected="true" editor-type-id="text-editor">
70 72 <state relative-caret-position="105">
71   - <caret line="7" column="47" lean-forward="false" selection-start-line="7" selection-start-column="47" selection-end-line="7" selection-end-column="47" />
72   - <folding />
  73 + <caret line="7" column="47" selection-start-line="7" selection-start-column="47" selection-end-line="7" selection-end-column="47" />
73 74 </state>
74 75 </provider>
75 76 </entry>
76 77 </file>
77   - <file leaf-file-name="application.js" pinned="false" current-in-tab="false">
  78 + <file pinned="false" current-in-tab="false">
78 79 <entry file="file://$PROJECT_DIR$/node_modules/express/lib/application.js">
79 80 <provider selected="true" editor-type-id="text-editor">
80 81 <state relative-caret-position="9165">
81   - <caret line="617" column="23" lean-forward="false" selection-start-line="617" selection-start-column="23" selection-end-line="617" selection-end-column="23" />
82   - <folding />
  82 + <caret line="617" column="23" selection-start-line="617" selection-start-column="23" selection-end-line="617" selection-end-column="23" />
83 83 </state>
84 84 </provider>
85 85 </entry>
86 86 </file>
87   - <file leaf-file-name="package.json" pinned="false" current-in-tab="false">
  87 + <file pinned="false" current-in-tab="false">
88 88 <entry file="file://$PROJECT_DIR$/package.json">
89 89 <provider selected="true" editor-type-id="text-editor">
90 90 <state relative-caret-position="120">
91   - <caret line="8" column="48" lean-forward="false" selection-start-line="8" selection-start-column="48" selection-end-line="8" selection-end-column="48" />
92   - <folding />
  91 + <caret line="8" column="48" selection-start-line="8" selection-start-column="48" selection-end-line="8" selection-end-column="48" />
93 92 </state>
94 93 </provider>
95 94 </entry>
... ... @@ -99,6 +98,8 @@
99 98 <component name="FindInProjectRecents">
100 99 <findStrings>
101 100 <find>delete</find>
  101 + <find>incid</find>
  102 + <find>post</find>
102 103 </findStrings>
103 104 </component>
104 105 <component name="Git.Settings">
... ... @@ -128,22 +129,14 @@
128 129 <path value="$PROJECT_DIR$/package.json" />
129 130 </packageJsonPaths>
130 131 </component>
131   - <component name="ProjectFrameBounds" fullScreen="true">
132   - <option name="width" value="450" />
133   - <option name="height" value="900" />
  132 + <component name="ProjectFrameBounds" extendedState="6">
  133 + <option name="x" value="-367" />
  134 + <option name="y" value="206" />
  135 + <option name="width" value="1920" />
  136 + <option name="height" value="1080" />
134 137 </component>
135 138 <component name="ProjectView">
136   - <navigator currentView="ProjectPane" proportions="" version="1">
137   - <flattenPackages />
138   - <showMembers />
139   - <showModules />
140   - <showLibraryContents />
141   - <hideEmptyPackages />
142   - <abbreviatePackageNames />
143   - <autoscrollToSource />
144   - <autoscrollFromSource />
145   - <sortByType />
146   - <manualOrder />
  139 + <navigator proportions="" version="1">
147 140 <foldersAlwaysOnTop value="true" />
148 141 </navigator>
149 142 <panes>
... ... @@ -176,7 +169,6 @@
176 169 </subPane>
177 170 </pane>
178 171 <pane id="Scope" />
179   - <pane id="Scratches" />
180 172 </panes>
181 173 </component>
182 174 <component name="PropertiesComponent">
... ... @@ -196,7 +188,9 @@
196 188 </option>
197 189 </component>
198 190 <component name="RunManager" selected="npm.debug">
199   - <configuration name="server.js" type="NodeJSConfigurationType" factoryName="Node.js" temporary="true" path-to-js-file="server.js" working-dir="$PROJECT_DIR$" />
  191 + <configuration name="server.js" type="NodeJSConfigurationType" factoryName="Node.js" temporary="true" path-to-js-file="server.js" working-dir="$PROJECT_DIR$">
  192 + <method v="2" />
  193 + </configuration>
200 194 <configuration name="api" type="js.build_tools.npm" factoryName="npm" temporary="true" nameIsGenerated="true">
201 195 <package-json value="$PROJECT_DIR$/package.json" />
202 196 <command value="run" />
... ... @@ -205,6 +199,7 @@
205 199 </scripts>
206 200 <node-interpreter value="project" />
207 201 <envs />
  202 + <method v="2" />
208 203 </configuration>
209 204 <configuration name="debug" type="js.build_tools.npm" factoryName="npm" temporary="true" nameIsGenerated="true">
210 205 <package-json value="$PROJECT_DIR$/package.json" />
... ... @@ -214,23 +209,21 @@
214 209 </scripts>
215 210 <node-interpreter value="project" />
216 211 <envs />
  212 + <method v="2" />
217 213 </configuration>
218   - <list size="3">
219   - <item index="0" class="java.lang.String" itemvalue="Node.js.server.js" />
220   - <item index="1" class="java.lang.String" itemvalue="npm.api" />
221   - <item index="2" class="java.lang.String" itemvalue="npm.debug" />
  214 + <list>
  215 + <item itemvalue="Node.js.server.js" />
  216 + <item itemvalue="npm.api" />
  217 + <item itemvalue="npm.debug" />
222 218 </list>
223 219 <recent_temporary>
224   - <list size="3">
225   - <item index="0" class="java.lang.String" itemvalue="npm.debug" />
226   - <item index="1" class="java.lang.String" itemvalue="npm.api" />
227   - <item index="2" class="java.lang.String" itemvalue="Node.js.server.js" />
  220 + <list>
  221 + <item itemvalue="npm.api" />
  222 + <item itemvalue="npm.debug" />
  223 + <item itemvalue="Node.js.server.js" />
228 224 </list>
229 225 </recent_temporary>
230 226 </component>
231   - <component name="ShelveChangesManager" show_recycled="false">
232   - <option name="remove_strategy" value="false" />
233   - </component>
234 227 <component name="SvnConfiguration">
235 228 <configuration />
236 229 </component>
... ... @@ -250,35 +243,36 @@
250 243 <workItem from="1542881688157" duration="372000" />
251 244 <workItem from="1543226716067" duration="9986000" />
252 245 <workItem from="1543573540819" duration="221000" />
  246 + <workItem from="1543578347496" duration="5247000" />
253 247 </task>
254 248 <servers />
255 249 </component>
256 250 <component name="TimeTrackingManager">
257   - <option name="totallyTimeSpent" value="39898000" />
  251 + <option name="totallyTimeSpent" value="45145000" />
258 252 </component>
259 253 <component name="ToolWindowManager">
260   - <frame x="0" y="0" width="1440" height="900" extended-state="0" />
  254 + <frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
261 255 <editor active="true" />
262 256 <layout>
263   - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.13883016" sideWeight="0.68561065" order="0" side_tool="false" content_ui="combo" />
264   - <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" />
265   - <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" />
266   - <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" />
267   - <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" />
268   - <window_info id="npm" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.13883016" sideWeight="0.31438935" order="2" side_tool="true" content_ui="tabs" />
269   - <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32769045" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
270   - <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" />
271   - <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" />
272   - <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" />
273   - <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" />
274   - <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" />
275   - <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" />
276   - <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" />
277   - <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" />
278   - <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" />
279   - <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" />
280   - <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" />
281   - <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" />
  257 + <window_info content_ui="combo" id="Project" order="0" sideWeight="0.6845071" visible="true" weight="0.13856691" />
  258 + <window_info id="Structure" order="1" weight="0.25" />
  259 + <window_info id="npm" order="2" sideWeight="0.31549296" side_tool="true" visible="true" weight="0.13856691" />
  260 + <window_info id="Favorites" order="3" side_tool="true" />
  261 + <window_info anchor="bottom" id="Message" order="0" />
  262 + <window_info anchor="bottom" id="Find" order="1" />
  263 + <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.22993493" />
  264 + <window_info anchor="bottom" id="Debug" order="3" weight="0.39903265" />
  265 + <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
  266 + <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
  267 + <window_info anchor="bottom" id="TODO" order="6" />
  268 + <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
  269 + <window_info anchor="bottom" id="Version Control" order="8" />
  270 + <window_info anchor="bottom" id="Terminal" order="9" />
  271 + <window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
  272 + <window_info anchor="bottom" id="Messages" order="11" />
  273 + <window_info anchor="right" id="Commander" order="0" weight="0.4" />
  274 + <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
  275 + <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
282 276 </layout>
283 277 </component>
284 278 <component name="TypeScriptGeneratedFilesManager">
... ... @@ -287,127 +281,39 @@
287 281 <component name="VcsContentAnnotationSettings">
288 282 <option name="myLimit" value="2678400000" />
289