-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #746 from SlateFoundation/issue/736-create-enrollment
Fixes #736: Add Enroll Button to New Dashboard
- Loading branch information
Showing
5 changed files
with
95 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
static-webapps/slate-portfolio-manager/src/components/sidebar/NewLevelPanel.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<template> | ||
<div | ||
:class="`level-panel -new mb-2 cbl-level-${Level}`" | ||
> | ||
<b-container class="bg-cbl-level-25"> | ||
<b-row class="py-2 align-items-center"> | ||
<b-col> | ||
<h3 class="h6 m-0 text-muted"> | ||
Year {{ Level }} | ||
</h3> | ||
</b-col> | ||
<b-col cols="4"> | ||
<button | ||
class="btn btn-primary btn-sm float-right" | ||
@click="createLevel" | ||
> | ||
Enroll | ||
</button> | ||
</b-col> | ||
</b-row> | ||
</b-container> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import client from '@/store/client'; | ||
import emitter from '@/store/emitter'; | ||
export default { | ||
props: { | ||
Level: { | ||
type: Number, | ||
default: () => null, | ||
}, | ||
StudentID: { | ||
type: Number, | ||
default: () => null, | ||
}, | ||
CompetencyID: { | ||
type: Number, | ||
default: () => null, | ||
}, | ||
}, | ||
methods: { | ||
createLevel() { | ||
const { StudentID, CompetencyID, Level } = this; | ||
const data = [ | ||
{ | ||
StudentID, | ||
CompetencyID, | ||
Level, | ||
EnteredVia: 'enrollment', | ||
ID: -1, | ||
Class: 'Slate\\CBL\\StudentCompetency', | ||
BaselineRating: null, | ||
}, | ||
]; | ||
const url = 'cbl/student-competencies/save'; | ||
const refetch = () => emitter.emit('update-store', { StudentID, CompetencyID }); | ||
client.post(url, { data }).then(refetch); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters