Compare commits
6 Commits
2020_18_09
...
master
Author | SHA1 | Date | |
---|---|---|---|
7eafcce0a9 | |||
71a1144680 | |||
06d2d8ffdb | |||
c3e30b998d | |||
d4226920d8 | |||
cdb156c818 |
@ -60,10 +60,6 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-cache</artifactId>
|
<artifactId>spring-boot-starter-cache</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.module</groupId>
|
<groupId>com.fasterxml.jackson.module</groupId>
|
||||||
<artifactId>jackson-module-kotlin</artifactId>
|
<artifactId>jackson-module-kotlin</artifactId>
|
||||||
|
@ -93,9 +93,9 @@ data class Observation(
|
|||||||
) {
|
) {
|
||||||
fun toCsvFormat(): String {
|
fun toCsvFormat(): String {
|
||||||
fun escapeSpecialCharacters(data: String): String {
|
fun escapeSpecialCharacters(data: String): String {
|
||||||
return data.replace("\"", "\"\"").replace("\n", "")
|
return data.replace("\"", "\"\"").replace("\n", ";")
|
||||||
}
|
}
|
||||||
val dataPortion = "${date.toString("dd/MM/yyyy")},\"$person, ${type.name} ${scenarios.joinToString { it.title }}\"," +
|
val dataPortion = "${date.toString("dd/MM/yyyy")},\"${escapeSpecialCharacters(person)}, ${type.name} ${scenarios.joinToString { escapeSpecialCharacters(it.title) }}\"," +
|
||||||
"\"Training\",\"Operations - Shift Operations\",\"${site.name}\",\"N/A\"," +
|
"\"Training\",\"Operations - Shift Operations\",\"${site.name}\",\"N/A\"," +
|
||||||
"${roundScore(monitoring)},${roundScore(controlProcedural)},${roundScore(control)}," +
|
"${roundScore(monitoring)},${roundScore(controlProcedural)},${roundScore(control)}," +
|
||||||
"${roundScore(conservatism)},${roundScore(teamworkCommunications)},${roundScore(teamworkLeadership)}," +
|
"${roundScore(conservatism)},${roundScore(teamworkCommunications)},${roundScore(teamworkLeadership)}," +
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
package uk.co.neviyn.observationdatabase
|
|
||||||
|
|
||||||
import org.springframework.context.annotation.Configuration
|
|
||||||
import org.springframework.messaging.simp.config.MessageBrokerRegistry
|
|
||||||
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker
|
|
||||||
import org.springframework.web.socket.config.annotation.StompEndpointRegistry
|
|
||||||
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@EnableWebSocketMessageBroker
|
|
||||||
class WebSocketConfig : WebSocketMessageBrokerConfigurer {
|
|
||||||
|
|
||||||
override fun configureMessageBroker(registry: MessageBrokerRegistry) {
|
|
||||||
registry.enableSimpleBroker("/ws")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun registerStompEndpoints(registry: StompEndpointRegistry) {
|
|
||||||
registry.addEndpoint("/websocket").setAllowedOrigins("http://localhost:8080", "http://127.0.0.1:8080").withSockJS()
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<b-container fluid>
|
<b-container fluid>
|
||||||
<b-container v-if="type != null && whom != null && site != null && tutors != null" fluid style="padding-left: 130px;">
|
<b-container
|
||||||
|
v-if="type != null && whom != null && site != null && tutors != null"
|
||||||
|
fluid
|
||||||
|
style="padding-left: 130px;"
|
||||||
|
>
|
||||||
<h3>
|
<h3>
|
||||||
<v-icon name="tag" scale="1.5" />
|
<v-icon name="tag" scale="1.5" />
|
||||||
{{ type }} / {{ whom }}
|
{{ type }} / {{ whom }}
|
||||||
@ -400,7 +404,7 @@ export default {
|
|||||||
},
|
},
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
var form = document.getElementById("submission-form");
|
var form = document.getElementById("submission-form");
|
||||||
var notObservedValue = 0
|
var notObservedValue = 0;
|
||||||
if (form.checkValidity()) {
|
if (form.checkValidity()) {
|
||||||
let axiosConfig = {
|
let axiosConfig = {
|
||||||
auth: {
|
auth: {
|
||||||
@ -439,113 +443,99 @@ export default {
|
|||||||
title: scenario.title,
|
title: scenario.title,
|
||||||
monitoringRating:
|
monitoringRating:
|
||||||
monitoring.length > 0
|
monitoring.length > 0
|
||||||
? monitoring.length > 1
|
? Math.round(self.totals[0])
|
||||||
? monitoring.reduce(
|
|
||||||
(a, b) => parseInt(a.rating) + parseInt(b.rating)
|
|
||||||
) / monitoring.length
|
|
||||||
: monitoring[0].rating
|
|
||||||
: notObservedValue,
|
: notObservedValue,
|
||||||
monitoringStrengths: monitoring
|
monitoringStrengths: monitoring
|
||||||
.map((entry) => entry.strengths)
|
.map((entry) => entry.strengths)
|
||||||
|
.filter((entry) => entry.length > 0)
|
||||||
.join("; "),
|
.join("; "),
|
||||||
monitoringImprovements: monitoring
|
monitoringImprovements: monitoring
|
||||||
.map((entry) => entry.AFIs)
|
.map((entry) => entry.AFIs)
|
||||||
|
.filter((entry) => entry.length > 0)
|
||||||
.join("; "),
|
.join("; "),
|
||||||
controlProceduralRating:
|
controlProceduralRating:
|
||||||
controlProcedural.length > 0
|
controlProcedural.length > 0
|
||||||
? controlProcedural.length > 1
|
? Math.round(self.totals[1])
|
||||||
? controlProcedural.reduce(
|
|
||||||
(a, b) => parseInt(a.rating) + parseInt(b.rating)
|
|
||||||
) / controlProcedural.length
|
|
||||||
: controlProcedural[0].rating
|
|
||||||
: notObservedValue,
|
: notObservedValue,
|
||||||
controlProceduralStrengths: controlProcedural
|
controlProceduralStrengths: controlProcedural
|
||||||
.map((entry) => entry.strengths)
|
.map((entry) => entry.strengths)
|
||||||
|
.filter((entry) => entry.length > 0)
|
||||||
.join("; "),
|
.join("; "),
|
||||||
controlProceduralImprovements: controlProcedural
|
controlProceduralImprovements: controlProcedural
|
||||||
.map((entry) => entry.AFIs)
|
.map((entry) => entry.AFIs)
|
||||||
|
.filter((entry) => entry.length > 0)
|
||||||
.join("; "),
|
.join("; "),
|
||||||
controlRating:
|
controlRating:
|
||||||
control.length > 0
|
control.length > 0
|
||||||
? control.length > 1
|
? Math.round(self.totals[2])
|
||||||
? control.reduce(
|
|
||||||
(a, b) => parseInt(a.rating) + parseInt(b.rating)
|
|
||||||
) / control.length
|
|
||||||
: control[0].rating
|
|
||||||
: notObservedValue,
|
: notObservedValue,
|
||||||
controlStrengths: control
|
controlStrengths: control
|
||||||
.map((entry) => entry.strengths)
|
.map((entry) => entry.strengths)
|
||||||
|
.filter((entry) => entry.length > 0)
|
||||||
|
.join("; "),
|
||||||
|
controlImprovements: control
|
||||||
|
.map((entry) => entry.AFIs)
|
||||||
|
.filter((entry) => entry.length > 0)
|
||||||
.join("; "),
|
.join("; "),
|
||||||
controlImprovements: control.map((entry) => entry.AFIs).join("; "),
|
|
||||||
conservatismRating:
|
conservatismRating:
|
||||||
conservatism.length > 0
|
conservatism.length > 0
|
||||||
? conservatism.length > 1
|
? Math.round(self.totals[3])
|
||||||
? conservatism.reduce(
|
|
||||||
(a, b) => parseInt(a.rating) + parseInt(b.rating)
|
|
||||||
) / conservatism.length
|
|
||||||
: conservatism[0].rating
|
|
||||||
: notObservedValue,
|
: notObservedValue,
|
||||||
conservatismStrengths: conservatism
|
conservatismStrengths: conservatism
|
||||||
.map((entry) => entry.strengths)
|
.map((entry) => entry.strengths)
|
||||||
|
.filter((entry) => entry.length > 0)
|
||||||
.join(";"),
|
.join(";"),
|
||||||
conservatismImprovements: conservatism
|
conservatismImprovements: conservatism
|
||||||
.map((entry) => entry.strengths)
|
.map((entry) => entry.strengths)
|
||||||
|
.filter((entry) => entry.length > 0)
|
||||||
.join(";"),
|
.join(";"),
|
||||||
teamworkCommunicationsRating:
|
teamworkCommunicationsRating:
|
||||||
teamworkCommunications.length > 0
|
teamworkCommunications.length > 0
|
||||||
? teamworkCommunications.length > 1
|
? Math.round(self.totals[4])
|
||||||
? teamworkCommunications.reduce(
|
|
||||||
(a, b) => parseInt(a.rating) + parseInt(b.rating)
|
|
||||||
) / teamworkCommunications.length
|
|
||||||
: teamworkCommunications[0].rating
|
|
||||||
: notObservedValue,
|
: notObservedValue,
|
||||||
teamworkCommunicationsStrengths: teamworkCommunications
|
teamworkCommunicationsStrengths: teamworkCommunications
|
||||||
.map((entry) => entry.strengths)
|
.map((entry) => entry.strengths)
|
||||||
|
.filter((entry) => entry.length > 0)
|
||||||
.join(";"),
|
.join(";"),
|
||||||
teamworkCommunicationsImprovements: teamworkCommunications
|
teamworkCommunicationsImprovements: teamworkCommunications
|
||||||
.map((entry) => entry.AFIs)
|
.map((entry) => entry.AFIs)
|
||||||
|
.filter((entry) => entry.length > 0)
|
||||||
.join(";"),
|
.join(";"),
|
||||||
teamworkLeadershipRating:
|
teamworkLeadershipRating:
|
||||||
teamworkLeadership.length > 0
|
teamworkLeadership.length > 0
|
||||||
? teamworkLeadership.length > 1
|
? Math.round(self.totals[5])
|
||||||
? teamworkLeadership.reduce(
|
|
||||||
(a, b) => parseInt(a.rating) + parseInt(b.rating)
|
|
||||||
) / teamworkLeadership.length
|
|
||||||
: teamworkLeadership[0].rating
|
|
||||||
: notObservedValue,
|
: notObservedValue,
|
||||||
teamworkLeadershipStrengths: teamworkLeadership
|
teamworkLeadershipStrengths: teamworkLeadership
|
||||||
.map((entry) => entry.strengths)
|
.map((entry) => entry.strengths)
|
||||||
|
.filter((entry) => entry.length > 0)
|
||||||
.join(";"),
|
.join(";"),
|
||||||
teamworkLeadershipImprovements: teamworkLeadership
|
teamworkLeadershipImprovements: teamworkLeadership
|
||||||
.map((entry) => entry.AFIs)
|
.map((entry) => entry.AFIs)
|
||||||
|
.filter((entry) => entry.length > 0)
|
||||||
.join(";"),
|
.join(";"),
|
||||||
teamworkWorkloadRating:
|
teamworkWorkloadRating:
|
||||||
teamworkWorkload.length > 0
|
teamworkWorkload.length > 0
|
||||||
? teamworkWorkload.length > 1
|
? Math.round(self.totals[6])
|
||||||
? teamworkWorkload.reduce(
|
|
||||||
(a, b) => parseInt(a.rating) + parseInt(b.rating)
|
|
||||||
) / teamworkWorkload.length
|
|
||||||
: teamworkWorkload[0].rating
|
|
||||||
: notObservedValue,
|
: notObservedValue,
|
||||||
teamworkWorkloadStrengths: teamworkWorkload
|
teamworkWorkloadStrengths: teamworkWorkload
|
||||||
.map((entry) => entry.strengths)
|
.map((entry) => entry.strengths)
|
||||||
|
.filter((entry) => entry.length > 0)
|
||||||
.join(";"),
|
.join(";"),
|
||||||
teamworkWorkloadImprovements: teamworkWorkload
|
teamworkWorkloadImprovements: teamworkWorkload
|
||||||
.map((entry) => entry.AFIs)
|
.map((entry) => entry.AFIs)
|
||||||
|
.filter((entry) => entry.length > 0)
|
||||||
.join(";"),
|
.join(";"),
|
||||||
knowledgeRating:
|
knowledgeRating:
|
||||||
knowledge.length > 0
|
knowledge.length > 0
|
||||||
? knowledge.length > 1
|
? Math.round(self.totals[7])
|
||||||
? knowledge.reduce(
|
|
||||||
(a, b) => parseInt(a.rating) + parseInt(b.rating)
|
|
||||||
) / knowledge.length
|
|
||||||
: knowledge[0].rating
|
|
||||||
: notObservedValue,
|
: notObservedValue,
|
||||||
knowledgeStrengths: knowledge
|
knowledgeStrengths: knowledge
|
||||||
.map((entry) => entry.strengths)
|
.map((entry) => entry.strengths)
|
||||||
|
.filter((entry) => entry.length > 0)
|
||||||
.join(";"),
|
.join(";"),
|
||||||
knowledgeImprovements: knowledge
|
knowledgeImprovements: knowledge
|
||||||
.map((entry) => entry.AFIs)
|
.map((entry) => entry.AFIs)
|
||||||
|
.filter((entry) => entry.length > 0)
|
||||||
.join(";"),
|
.join(";"),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user