Skip to content

Commit

Permalink
Merge pull request #459 from ruxailab/deployProdFix
Browse files Browse the repository at this point in the history
 fix(notifications): and added firebase config files
  • Loading branch information
jvJUCA authored Apr 24, 2024
2 parents 3cd36ca + 22ce629 commit c7658f5
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 147 deletions.
3 changes: 2 additions & 1 deletion .firebaserc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"projects": {
"default": "retlab-dev",
"dev": "retlab-dev",
"production": "retlab"
"production": "retlab",
"prod": "ruxailab-prod"
},
"targets": {
"retlab-dev": {
Expand Down
43 changes: 25 additions & 18 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,33 @@
"indexes": "firestore.indexes.json"
},
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
],
"predeploy": ["npm --prefix \"$RESOURCE_DIR\" run lint"],
"source": "functions"
},
"hosting": {
"site": "ruxailab-dev",
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
"hosting": [
{
"site": "ruxailab-dev",
"public": "dist",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"site": "ruxailab-prod",
"public": "dist",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
],
"emulators": {
"auth": {
"port": 9099
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"test": "vue-cli-service test:unit",
"build-dev": "vue-cli-service build --mode development",
"build-prod": "vue-cli-service build --mode production",
"deploy-dev": "firebase use dev && firebase deploy --only hosting",
"deploy-prod": "firebase use production && firebase deploy --only hosting"
"deploy-dev": "firebase use dev && firebase deploy --only hosting:ruxailab-dev",
"deploy-prod": "firebase use prod && firebase deploy --only hosting:ruxailab-prod"
},
"dependencies": {
"axios": "^1.5.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/NotificationButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default {
user: this.user,
})
// Redirect to notification url
this.$router.go(`${notification.redirectsTo}`)
this.$router.push(notification.redirectsTo)
},
checkIfHasNewNotifications() {
const newNot = this.user.notifications.filter((n) => n.read === false)
Expand Down
9 changes: 7 additions & 2 deletions src/components/organisms/HeuristicsTestAnswer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,13 @@
</v-card>

<!-- Tab 3 - Heuristics-->
<v-card v-if="tab == 2" rounded="xl" flat class="mb-6 py-2" style="background: #f5f7ff">
<v-card
v-if="tab == 2"
rounded="xl"
flat
class="mb-6 py-2"
style="background: #f5f7ff"
>
<div>
<v-card-title class="subtitleView">
Heuristics Data
Expand Down Expand Up @@ -701,7 +707,6 @@ export default {
//
this.$emit('goToCoops')
},
usuability_percentage_array() {
const teste = this.heuristicsStatistics
const array_scores = []
Expand Down
123 changes: 0 additions & 123 deletions src/views/admin/AnswerView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,129 +23,6 @@ export default {
showFinalResult() {
return finalResult()
},
evaluatorStatistics() {
return this.$store.state.Answer.evaluatorStatistics
},
sortedEvaluatorStatistics() {
return this.evaluatorStatistics.items.slice().sort((a, b) => {
const parseDate = (dateStr) => {
const [day, month, yearTime] = dateStr.split('/')
const [year, time] = yearTime.split(', ')
const [hours, minutes, seconds] = time.split(':')
// Adjust the date format to 'month/day/year'
return new Date(`${month}/${day}/${year} ${time}`)
}
const dateA = parseDate(a.lastUpdate)
const dateB = parseDate(b.lastUpdate)
return dateB - dateA // sort in descending order
})
},
heuristicsEvaluator() {
const table = {
header: [],
items: [],
}
const options = this.test.testOptions.map((op) => op.value)
const max = Math.max(...options)
const min = Math.min(...options)
table.header.push({
text: 'HEURISTICS',
align: 'start',
value: 'heuristic',
})
if (this.resultEvaluator) {
this.resultEvaluator.forEach((evaluator) => {
const header = table.header.find((h) => h.text == evaluator.id)
if (!header) {
table.header.push({
text: evaluator.id,
align: 'center',
value: evaluator.id,
})
}
evaluator.heuristics.forEach((heuristic) => {
const item = table.items.find((i) => i.heuristic == heuristic.id)
if (item) {
Object.assign(item, {
[evaluator.id]: heuristic.result,
})
} else {
table.items.push({
heuristic: heuristic.id,
max: max * heuristic.totalQuestions,
min: min * heuristic.totalQuestions,
[evaluator.id]: heuristic.result,
})
}
})
})
}
return table
},
heuristicsStatistics() {
const table = {
header: [],
items: [],
}
table.header = [
{
text: 'HEURISTICS',
align: 'start',
sortable: false,
value: 'name',
},
{
text: 'Percentage (%)',
value: 'percentage',
align: 'center',
sortable: false,
},
{
text: 'Standard deviation',
value: 'sd',
align: 'center',
sortable: false,
},
{
text: 'Average',
value: 'average',
align: 'center',
sortable: false,
},
{ text: 'Max', value: 'max', align: 'center', sortable: false },
{ text: 'Min', value: 'min', align: 'center', sortable: false },
]
if (this.heuristicsEvaluator.items) {
this.heuristicsEvaluator.items.forEach((item) => {
const results = Object.entries(item)
.filter((item) => item[0].includes('Ev'))
.map((item) => item[1])
const valueToConvert = results
.reduce((total, value) => total + value / results.length, 0)
.toFixed(2),
convertedValue =
((valueToConvert - item.min) / (item.max - item.min)) * 100
table.items.push({
name: item.heuristic,
max: Math.max(item.max).toFixed(2),
min: Math.min(item.min).toFixed(2),
percentage: convertedValue.toFixed(2),
sd: standardDeviation(results).toFixed(2),
average: results
.reduce((total, value) => total + value / results.length, 0)
.toFixed(2),
})
})
}
return table
},
testAnswerDocument() {
return this.$store.state.Answer.testAnswerDocument
},
Expand Down

0 comments on commit c7658f5

Please sign in to comment.