Skip to content

Commit

Permalink
Merge pull request #532 from SebastianJitaru29/feat-emotions
Browse files Browse the repository at this point in the history
Feat emotions - FrontEnd
  • Loading branch information
KarinePistili authored Aug 23, 2024
2 parents 183c7ff + 155f512 commit fcd9088
Show file tree
Hide file tree
Showing 22 changed files with 2,444 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .firebaserc
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
}
}
},
"etags": {}
"etags": {},
"dataconnectEmulatorConfig": {}
}
1,154 changes: 1,154 additions & 0 deletions firestore-debug.log

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@
"vue-template-compiler": "^2.6.12",
"vuetify-loader": "^1.6.0"
}
}
}
785 changes: 785 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[tool.poetry]
name = "ruxailab"
version = "0.1.0"
description = ""
authors = ["SebastianJitaru <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.12"
httplib2 = "^0.22.0"
idna = "^3.7"
itsdangerous = "^2.2.0"
jinja2 = "^3.1.4"
markupsafe = "^2.1.5"
msgpack = "^1.0.8"
numpy = "^1.26.4"
packaging = "^24.0"
pandas = "^2.2.2"
proto-plus = "^1.23.0"
pyasn1 = "^0.6.0"
pyasn1-modules = "^0.4.0"
pycparser = "^2.22"
pyjwt = "^2.8.0"
pyparsing = "^3.1.2"
python-dateutil = "^2.9.0.post0"
pytz = "^2024.1"
pyyaml = "^6.0.1"
requests = "^2.31.0"
rsa = "^4.9"
six = "^1.16.0"
tabulate = "^0.9.0"
typing-extensions = "^4.11.0"
tzdata = "^2024.1"
uritemplate = "^4.1.1"
urllib3 = "^2.2.1"
watchdog = "^4.0.0"
werkzeug = "^3.0.3"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Binary file added src/assets/manager/IntroEmotions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions src/assets/manager/IntroEmotions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions src/components/atoms/BarChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ export default {
extends: Bar,
props: {
labels: {
type: String,
default: 'Data One',
},
type: Array,
default: () => ['Label 1', 'Label 2', 'Label 3'], },
data: {
type: Array,
default: () => [],
Expand Down
1 change: 1 addition & 0 deletions src/components/atoms/Drawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export default {
this.$router.replace({ name: 'ManagerView', params: { id: testId } })
},
go(item) {
if (this.$route.path === item.path) return
if (item.path === `/testview/${this.test.id}`) return window.open(item.path)
Expand Down
Empty file.
6 changes: 5 additions & 1 deletion src/components/atoms/RadarChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export default {
return []
},
},
legend: {
type: String,
default: 'Legend',
},
},
watch: {
data() {
Expand All @@ -30,7 +34,7 @@ export default {
labels: this.labels,
datasets: [
{
label: 'Usability Percentage ',
label: this.legend,
backgroundColor: 'rgba(249, 152, 38,0.24)',
borderColor: 'rgba(255, 81, 47,1)',
pointBackgroundColor: 'rgba(255, 81, 47,1)',
Expand Down
40 changes: 40 additions & 0 deletions src/components/atoms/SummaryTable.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<template>
<v-card class="mx-auto my-4 pa-2" outlined>
<v-simple-table>
<thead>
<tr>
<th class="text-center">COLLABORATOR</th>
<th class="text-center">AVG HAPPINESS</th>
<th class="text-center">DOMINANT EMOTION</th>
</tr>
</thead>
<tbody>
<tr v-for="collaborator in collaborators" :key="collaborator.name">
<td class="text-center">{{ collaborator.name }}</td>
<td class="text-center">{{ collaborator.attention }}</td>
<td class="text-center">{{ collaborator.emotion }}</td> </tr>
</tbody>
</v-simple-table>
</v-card>
</template>

<script>
export default {
name: 'SummaryTable',
props: {
collaborators: {
type: Array,
required: true,
},
},
}
</script>

<style scoped>
.v-card {
border: 1px solid #f4b700;
}
.text-center {
text-align: center;
}
</style>
66 changes: 66 additions & 0 deletions src/components/molecules/IntroEmotions.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<template>
<div>
<IntroComp
:colors="['#3498db', '#2e9ecc']"
:title="'Emotions'"
:image="'IntroEmotions.png'"
:main="$t('descriptions.intro.emotions')"
:link="$t('descriptions.intro.invite')"
:items="items"
@linkClicked="emitLinkClicked"
@callFunc="emitCallFunc"
/>
</div>
</template>

<script>
import IntroComp from '@/components/atoms/IntrosComponent'
import i18n from '@/i18n'
export default {
components: {
IntroComp,
},
computed: {
items() {
return [
{
iconColor: '#4bbdaf',
icon: 'mdi-file-document',
title: i18n.t('pages.intros.docTitle'),
subtitle: i18n.t('pages.intros.docSubtitle') + i18n.t('titles.answers'),
func: 'goToDoc',
},
{
iconColor: '#4bbdaf',
icon: 'mdi-emoticon-happy',
title: i18n.t('pages.intros.discTitle'),
subtitle: i18n.t('pages.intros.discSubtitle'),
func: 'goToDisc',
},
]
},
},
methods: {
emitLinkClicked() {
this.$emit('linkClicked')
},
emitCallFunc(func) {
this[func]()
},
goToDoc() {
this.$router.push('/emotions/documentation').catch(() => {})
},
goToDisc() {
window.open('https://discord.gg/MFWNpwTq9q')
},
},
}
</script>

<style scoped>
.intro-container {
text-align: center;
padding: 20px;
}
</style>
23 changes: 23 additions & 0 deletions src/controllers/VideoAnalysisController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// src/controllers/VideoAnalysisController.js
import Controller from '@/controllers/BaseController';
import VideoAnalysis from '@/models/VideoAnalysisModel';

const baseController = new Controller();

export default {
async fetchVideoAnalysisData(docId) {
try {
const doc = await baseController.readOne('VideoAnalysis', docId);
console.log('docid', docId);
if (doc.exists()) {
console.log('doc', doc.data());
return VideoAnalysis.fromFirestore(doc.data());
} else {
throw new Error('Document does not exist');
}
} catch (error) {
console.error('Error fetching video analysis data:', error);
throw error;
}
}
};
8 changes: 6 additions & 2 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
"template": "Template",
"finalReport": "Final Report",
"answerType": "Answer type:",
"emotions": "Emotions",
"videoAnalysis": "Video Analysis",
"drawer": {
"Manager": "Manager",
"Test": "Test",
Expand All @@ -61,7 +63,8 @@
"Template": "Template",
"Final Report": "Final Report",
"Answer Test": "Answer Test",
"Settings": "Settings"
"Settings": "Settings",
"Emotions": "Emotions"
},
"heuristic": "Usability Heuristic Evaluation"
},
Expand All @@ -79,7 +82,8 @@
"invite": "Invite evaluators to answer your test!",
"cooperators": "Add cooperators who can help you improve your project and gather data for your studies.",
"start": "Get started!",
"edit": "Create and customize your tasks and heuristics for your research needs."
"edit": "Create and customize your tasks and heuristics for your research needs.",
"emotions": "Learn how your collaborators felt during the test using AI emotion analysis!."
}
},
"errors": {
Expand Down
21 changes: 21 additions & 0 deletions src/models/VideoAnalysisModel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// src/models/VideoAnalysisModel.js
export default class VideoAnalysis {
constructor({
fragment1 = {},
fragment2 = {},
} = {}) {
this.fragment1 = fragment1;
this.fragment2 = fragment2;
}

static fromFirestore(data) {
return new VideoAnalysis(data);
}

toFirestore() {
return {
fragment1: this.fragment1,
fragment2: this.fragment2,
};
}
}
Loading

0 comments on commit fcd9088

Please sign in to comment.