Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Alsijil
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Alsijil
Commits
6143123e
Commit
6143123e
authored
10 months ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Remove tardiness note
parent
1fa3b253
No related branches found
No related tags found
1 merge request
!362
Resolve "Add personal note management dialog in course book"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/alsijil/frontend/components/coursebook/personal_notes/TardinessNote.vue
+0
-173
0 additions, 173 deletions
...nd/components/coursebook/personal_notes/TardinessNote.vue
with
0 additions
and
173 deletions
aleksis/apps/alsijil/frontend/components/coursebook/personal_notes/TardinessNote.vue
deleted
100644 → 0
+
0
−
173
View file @
1fa3b253
<
script
>
import
{
createPersonalNotes
,
deletePersonalNotes
,
updatePersonalNotes
,
}
from
"
./personal_notes.graphql
"
;
import
{
DateTime
}
from
"
luxon
"
;
import
personalNoteRelatedMixin
from
"
./personalNoteRelatedMixin
"
;
import
mutateMixin
from
"
aleksis.core/mixins/mutateMixin.js
"
;
import
DeleteDialog
from
"
aleksis.core/components/generic/dialogs/DeleteDialog.vue
"
;
import
PositiveSmallIntegerField
from
"
aleksis.core/components/generic/forms/PositiveSmallIntegerField.vue
"
;
export
default
{
name
:
"
TardinessNote
"
,
components
:
{
DeleteDialog
,
PositiveSmallIntegerField
},
mixins
:
[
mutateMixin
,
personalNoteRelatedMixin
],
computed
:
{
value
()
{
return
this
.
participation
.
noteWithTardiness
;
},
lessonLength
()
{
const
lessonStart
=
DateTime
.
fromISO
(
this
.
documentation
.
datetimeStart
);
const
lessonEnd
=
DateTime
.
fromISO
(
this
.
documentation
.
datetimeEnd
);
let
diff
=
lessonEnd
.
diff
(
lessonStart
,
"
minutes
"
);
return
diff
.
toObject
().
minutes
;
},
model
:
{
get
()
{
return
this
.
value
?.
tardiness
;
},
set
(
newValue
)
{
if
(
!
newValue
)
{
// this is a DELETE action, show the dialog, ...
this
.
showDeleteConfirm
=
true
;
return
;
}
const
create
=
!
this
.
value
?.
id
;
this
.
mutate
(
create
?
createPersonalNotes
:
updatePersonalNotes
,
this
.
getInput
(
newValue
,
create
?
{
documentation
:
this
.
documentation
.
id
,
person
:
this
.
participation
.
person
.
id
,
}
:
{
id
:
this
.
value
.
id
,
},
),
this
.
getUpdater
(
create
?
"
create
"
:
"
update
"
),
);
},
},
},
methods
:
{
getInput
(
newValue
,
extras
)
{
return
{
input
:
[
{
tardiness
:
newValue
,
...
extras
,
},
],
};
},
getUpdater
(
mode
)
{
return
(
storedDocumentations
,
incomingPersonalNotes
)
=>
{
const
note
=
incomingPersonalNotes
?.[
0
]
||
undefined
;
const
documentation
=
storedDocumentations
.
find
(
(
doc
)
=>
doc
.
id
===
this
.
documentation
.
id
,
);
const
participationStatus
=
documentation
.
participations
.
find
(
(
part
)
=>
part
.
id
===
this
.
participation
.
id
,
);
switch
(
mode
.
toLowerCase
())
{
case
"
update
"
:
{
const
oldNote
=
participationStatus
.
noteWithTardiness
;
participationStatus
.
noteWithTardiness
=
{
...
oldNote
,
...
note
,
};
break
;
}
case
"
delete
"
:
{
participationStatus
.
noteWithTardiness
=
null
;
break
;
}
case
"
create
"
:
participationStatus
.
noteWithTardiness
=
note
;
break
;
default
:
console
.
error
(
"
Invalid mode in getUpdater():
"
,
mode
);
break
;
}
return
storedDocumentations
;
};
},
lessonLengthRule
(
time
)
{
return
(
time
==
null
||
time
<=
this
.
lessonLength
||
this
.
$t
(
"
alsijil.personal_notes.lesson_length_exceeded
"
)
);
},
},
data
()
{
return
{
showDeleteConfirm
:
false
,
deletePersonalNotes
,
};
},
};
</
script
>
<
template
>
<positive-small-integer-field
outlined
class=
"mt-1"
prepend-inner-icon=
"mdi-clock-alert-outline"
:suffix=
"$t('time.minutes')"
:label=
"$t('alsijil.personal_notes.tardiness')"
:rules=
"[lessonLengthRule]"
:value=
"model"
@
change=
"model = $event"
:loading=
"loading"
>
<template
#append
>
<v-slide-x-reverse-transition>
<v-btn
v-if=
"!!model"
icon
@
click=
"showDeleteConfirm = true"
class=
"mt-n1-5"
>
<v-icon>
$deleteContent
</v-icon>
</v-btn>
</v-slide-x-reverse-transition>
<delete-dialog
v-model=
"showDeleteConfirm"
:gql-delete-mutation=
"deletePersonalNotes"
:affected-query=
"affectedQuery"
item-attribute=
"fullName"
:items=
"[value]"
:custom-update=
"getUpdater('delete')"
>
<template
#title
>
{{
$t
(
"
alsijil.personal_notes.confirm_delete
"
)
}}
</
template
>
<
template
#body
>
{{
$t
(
"
alsijil.personal_notes.confirm_delete_tardiness
"
,
{
tardiness
:
value
?.
tardiness
,
name
:
participation
.
person
.
fullName
,
}
)
}}
<
/template
>
<
/delete-dialog
>
<
/template
>
<
/positive-small-integer-field
>
<
/template
>
<
style
scoped
>
.
mt
-
n1
-
5
{
margin
-
top
:
-
6
px
;
}
<
/style
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment