Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
grady
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Grady Corp.
grady
Commits
cb2b812b
Commit
cb2b812b
authored
6 years ago
by
Dominik Seeger
Browse files
Options
Downloads
Patches
Plain Diff
re-added parseCSVMapMixin
parent
b695ab50
No related branches found
No related tags found
1 merge request
!128
Merge improve testing
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/components/mixins/mixins.ts
+19
-15
19 additions, 15 deletions
frontend/src/components/mixins/mixins.ts
with
19 additions
and
15 deletions
frontend/src/components/mixins/mixins.ts
+
19
−
15
View file @
cb2b812b
import
{
Vue
,
Component
}
from
'
vue-property-decorator
'
import
{
Vue
,
Component
,
Mixins
}
from
'
vue-property-decorator
'
import
{
fetchStudentExportData
,
StudentExportItem
,
InstanceExportData
,
fetchInstanceExportData
}
from
'
@/api
'
import
{
fetchStudentExportData
,
StudentExportItem
,
InstanceExportData
,
fetchInstanceExportData
}
from
'
@/api
'
import
{
getters
}
from
'
@/store/getters
'
import
{
getters
}
from
'
@/store/getters
'
import
{
mutations
as
mut
}
from
'
@/store/mutations
'
import
{
mutations
as
mut
}
from
'
@/store/mutations
'
...
@@ -9,21 +9,9 @@ export enum ExportType {
...
@@ -9,21 +9,9 @@ export enum ExportType {
}
}
@
Component
@
Component
export
class
exportMixin
extends
Vue
{
export
class
parseCSVMapMixin
extends
Vue
{
exportDialog
=
true
mapFile
:
File
|
null
=
null
setPasswords
=
false
exportType
=
ExportType
.
CSV
get
mapFileLoaded
()
{
return
Object
.
keys
(
getters
.
state
.
studentMap
).
length
>
0
}
get
availableExportTypes
():
ExportType
[]
{
return
Object
.
values
(
ExportType
)
}
parseCSVMap
(
csvMap
:
string
)
{
parseCSVMap
(
csvMap
:
string
)
{
console
.
log
(
'
parsing
'
)
let
lines
=
csvMap
.
split
(
'
\n
'
)
let
lines
=
csvMap
.
split
(
'
\n
'
)
lines
.
shift
()
// drop the first line since it contains only headings
lines
.
shift
()
// drop the first line since it contains only headings
// TODO remove any type
// TODO remove any type
...
@@ -35,6 +23,22 @@ export class exportMixin extends Vue {
...
@@ -35,6 +23,22 @@ export class exportMixin extends Vue {
return
acc
return
acc
},
{})
},
{})
}
}
}
@
Component
export
class
exportMixin
extends
Mixins
(
Vue
,
parseCSVMapMixin
)
{
exportDialog
=
true
mapFile
:
File
|
null
=
null
setPasswords
=
false
exportType
=
ExportType
.
CSV
get
mapFileLoaded
()
{
return
Object
.
keys
(
getters
.
state
.
studentMap
).
length
>
0
}
get
availableExportTypes
():
ExportType
[]
{
return
Object
.
values
(
ExportType
)
}
async
getExportFile
(
type
:
string
)
{
async
getExportFile
(
type
:
string
)
{
let
studentData
let
studentData
...
...
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