Skip to content

Commit

Permalink
Merge branch 'upgrade/fix-mistakes' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuseduardomedeiros committed May 23, 2024
2 parents 3fdb2a8 + e1b9499 commit 45c81aa
Show file tree
Hide file tree
Showing 4 changed files with 648 additions and 77 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"format": "lint --fix"
},
"dependencies": {
"@vue/compat": "^3.4.21",
"@weni/unnnic-system": "^2.0.0-beta.0",
"@weni/unnnic-system": "2.0.9",
"axios": "^1.6.7",
"logrocket": "^8.1.0",
"moment": "^2.30.1",
Expand All @@ -24,7 +23,6 @@
"devDependencies": {
"@rushstack/eslint-patch": "^1.3.3",
"@vitejs/plugin-vue": "^4.5.2",
"@vue/compiler-sfc": "^3.4.21",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/test-utils": "^2.4.4",
"@weni/eslint-config": "^1.0.1",
Expand Down
88 changes: 40 additions & 48 deletions src/views/ClassPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
<main class="unnnic-grid-span-12">
<div class="page-container">
<iframe
v-if="hasMovie"
class="i"
class="iframe-video"
:src="currentClass.video"
:title="currentClass.title"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>

/>
<div :class="['notes', { yellowed: isNotesYellowed }]">
<div class="header">
<div class="title">Suas anotações</div>

<div class="action">
<UnnnicIcon
v-if="isSavingNotes"
Expand All @@ -25,27 +22,26 @@
/>
</div>
</div>

<div
class="placeholder"
v-if="!isNotesFocusedOrFilled"
>
<span
class="edit-button"
@click="$refs.notesInput.focus()"
>Clique aqui</span
>
Clique aqui
</span>
para começar a fazer anotações.
</div>

<div class="content">
<textarea
ref="notesInput"
v-model="notes"
@input="saveNotes"
@focus="isNotesFocused = true"
@blur="isNotesFocused = false"
></textarea>
/>
</div>
</div>

Expand All @@ -62,13 +58,12 @@
showValue
readonly
/>

<div
<span
class="leave-a-comment"
@click="goToCommentInput"
@click.stop="goToCommentInput"
>
Deixe um comentário
</div>
</span>
</div>
<!--
TODO:
Expand All @@ -80,31 +75,31 @@
--></div>
<UnnnicTab
v-model="currentTab"
:activeTab="currentTab"
:tabs="['overview' /* , 'materials' */, 'comments']"
@change.self="currentTab = $event"
>
<template v-slot:tab-head-overview>Visão Geral</template>
<template v-slot:tab-panel-overview>
<template #tab-head-overview>Visão Geral</template>
<template #tab-panel-overview>
<div class="overview-container">
<UnnnicSwitch
v-model="currentClass.lesson_monitoring.watched"
size="medium"
textRight="Marcar aprendizado como concluído"
@input="
@update:model-value="
toggleCheckClass({
classID: currentClass.id,
value: $event,
})
"
v-model="currentClass.lesson_monitoring.watched"
class="toggle-class"
/>

<div v-html="currentClass.content"></div>
</div>
</template>

<template v-slot:tab-head-materials>Materiais de Apoio</template>
<template v-slot:tab-panel-materials>
<!-- <template #tab-head-materials>Materiais de Apoio</template>
<template #tab-panel-materials>
<div
v-for="(material, index) in materials"
:key="index"
Expand All @@ -115,12 +110,12 @@
/>
{{ material.title }}
</div>
</template>
</template> -->

<template v-slot:tab-head-comments
>Comentários ({{ comments.length }})</template
>
<template v-slot:tab-panel-comments>
<template #tab-head-comments>
Comentários ({{ comments.length }})
</template>
<template #tab-panel-comments>
<UnnnicInput
label="Deixe um comentário"
v-model="comment"
Expand All @@ -130,10 +125,10 @@
iconRight="send-email-3-1"
iconRightClickable
@icon-right-click="createComment"
@keydown.enter="createComment"
@keyup.enter.stop="createComment"
class="comment-input"
ref="comment-input"
></UnnnicInput>
/>

<div class="comments-container">
<UnnnicComment
Expand Down Expand Up @@ -199,15 +194,8 @@
<div class="mood-rating-container">
<UnnnicMoodRating
title="Avalie seu aprendizado nesta aula"
:value="mood === 0 ? null : mood"
@input="setMood"
:titlesMoods="[
'Decepcionado',
'Insatisfeito',
'Neutro',
'Feliz',
'Produtivo',
]"
v-model="mood"
@update:model-value="setMood"
/>
</div>

Expand Down Expand Up @@ -281,7 +269,6 @@ export default {
name: 'ClassPage',
data() {
return {
hasMovie: true,
text: `<h1>Titulo</h1>\r\n\r\n<p>sdads asdas</p>\r\n\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In porta sagittis ligula at egestas. Vivamus vestibulum diam sit amet massa viverra, quis dapibus diam pellentesque. Pellentesque fermentum efficitur lorem sit amet sollicitudin. Sed magna velit, pellentesque sit amet aliquet quis, dapibus vitae erat. Nullam imperdiet mollis odio eu ultrices. Duis imperdiet volutpat dolor, vitae imperdiet turpis elementum at. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent ut ornare nunc.</p>\r\n\r\n<p>Sed quam lorem, ultricies vitae sapien a, vehicula malesuada arcu. Phasellus luctus lobortis enim eget consequat. Praesent mattis quam urna, tempor ornare sapien tincidunt ac. Pellentesque consectetur volutpat velit vel tincidunt. Vestibulum vestibulum fringilla malesuada. Curabitur sit amet ex eu nunc feugiat efficitur. Morbi hendrerit ipsum sed neque accumsan, ut ultricies turpis commodo. Cras dapibus nisi vel interdum laoreet. Sed varius, arcu eu finibus imperdiet, ligula eros luctus augue, quis feugiat justo magna non enim.</p>\r\n\r\n<p>Sed eget bibendum diam, nec vehicula augue. Quisque consectetur commodo finibus. Aenean commodo ante nec tempus auctor. Aenean vel aliquet magna. Mauris aliquam odio sit amet rhoncus ultricies. Praesent lobortis, enim a placerat gravida, dolor ante suscipit libero, ac aliquet dui tellus vitae magna. Fusce ut fermentum urna. Integer nunc nunc, volutpat porttitor tincidunt condimentum, blandit eget turpis. Sed pharetra scelerisque laoreet. Nulla facilisi. Aliquam ultrices non magna sit amet mattis. Sed feugiat dui at lacus finibus, sed tincidunt lorem fermentum. Curabitur molestie pharetra rhoncus. Etiam egestas nunc sed tortor dapibus feugiat vel ac felis.</p>\r\n\r\n<p>&nbsp;</p>`,
comments: [],
Expand All @@ -305,8 +292,6 @@ export default {
},
],
mood: 0,
notes: '',
isNotesFocused: false,
Expand Down Expand Up @@ -347,7 +332,7 @@ export default {
'setClassAnnotation',
'createClassComment',
'removeClassComment',
'getClassComments'
'getClassComments',
]),
init() {
Expand Down Expand Up @@ -427,9 +412,9 @@ export default {
classId: this.currentClass.id,
mood,
});
this.currentClass.lesson_monitoring.mood = response.data.mood;
this.mood = this.currentClass.lesson_monitoring.mood =
response.data.mood;
this.mood = this.currentClass.lesson_monitoring.mood;
} catch (error) {
this.mood = initialValue;
}
Expand Down Expand Up @@ -489,10 +474,7 @@ export default {
},
computed: {
...mapState(useModulesStore, [
'currentClass',
'currentModule',
]),
...mapState(useModulesStore, ['currentClass', 'currentModule']),
isNotesFocusedOrFilled() {
return this.isNotesFocused || this.notes;
Expand All @@ -501,6 +483,16 @@ export default {
isNotesYellowed() {
return !this.isNotesFocused && this.notes;
},
mood: {
get() {
return this.currentClass.lesson_monitoring.mood === 0
? null
: this.currentClass.lesson_monitoring.mood;
},
set(val) {
this.currentClass.lesson_monitoring.mood = val;
},
},
},
watch: {
Expand Down Expand Up @@ -690,7 +682,7 @@ aside {
}
}
.i {
.iframe-video {
width: 100%;
height: 492px;
border-radius: $unnnic-border-radius-md;
Expand Down
13 changes: 2 additions & 11 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,7 @@ import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue({
template: {
compilerOptions: {
compatConfig: {
MODE: 3
}
}
}
})],
plugins: [vue()],
css: {
preprocessorOptions: {
scss: {
Expand All @@ -23,8 +15,7 @@ export default defineConfig({
},
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
vue: '@vue/compat'
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
});
Loading

0 comments on commit 45c81aa

Please sign in to comment.