Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
teknikattan-scoring-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
tddd96-grupp1
teknikattan-scoring-system
Merge requests
!105
Resolve "Implement editor views"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Implement editor views"
143-implement-editor-views
into
dev
Overview
0
Commits
3
Pipelines
1
Changes
23
Merged
Emil Wahlqvist
requested to merge
143-implement-editor-views
into
dev
3 years ago
Overview
0
Commits
3
Pipelines
1
Changes
23
Expand
Closes
#143 (closed)
0
0
Merge request reports
Compare
dev
dev (base)
and
latest version
latest version
491301d8
3 commits,
3 years ago
23 files
+
184
−
75
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
23
Search (e.g. *.vue) (Ctrl+P)
client/src/actions/editor.ts
+
13
−
1
Options
@@ -18,16 +18,28 @@ export const getEditorCompetition = (id: string) => async (dispatch: AppDispatch
if
(
getState
().
editor
.
activeSlideId
===
-
1
&&
res
.
data
.
slides
[
0
])
{
setEditorSlideId
(
res
.
data
.
slides
[
0
].
id
)(
dispatch
)
}
const
defaultViewType
=
getState
().
types
.
viewTypes
.
find
((
viewType
)
=>
viewType
.
name
===
'
Audience
'
)
if
(
getState
().
editor
.
activeViewTypeId
===
-
1
&&
defaultViewType
)
{
setEditorViewId
(
defaultViewType
.
id
)(
dispatch
)
}
})
.
catch
((
err
)
=>
{
console
.
log
(
err
)
})
}
// Set
current
SlideId in editor state
// Set
active
SlideId in editor state
export
const
setEditorSlideId
=
(
id
:
number
)
=>
(
dispatch
:
AppDispatch
)
=>
{
dispatch
({
type
:
Types
.
SET_EDITOR_SLIDE_ID
,
payload
:
id
,
})
}
// Set activeViewTypeId in editor state
export
const
setEditorViewId
=
(
id
:
number
)
=>
(
dispatch
:
AppDispatch
)
=>
{
dispatch
({
type
:
Types
.
SET_EDITOR_VIEW_ID
,
payload
:
id
,
})
}
Loading