Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cf2021
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
Model registry
Operate
Environments
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
vojtech.pikal
cf2021
Commits
a55ca24f
Commit
a55ca24f
authored
4 years ago
by
xaralis
Browse files
Options
Downloads
Patches
Plain Diff
feat: improve formatting of program entry descriptions
parent
27b240a1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/actions/program.js
+6
-0
6 additions, 0 deletions
src/actions/program.js
src/pages/Program.jsx
+7
-9
7 additions, 9 deletions
src/pages/Program.jsx
src/ws/handlers/program.js
+9
-1
9 additions, 1 deletion
src/ws/handlers/program.js
typings/cf2021.d.ts
+2
-0
2 additions, 0 deletions
typings/cf2021.d.ts
with
24 additions
and
10 deletions
src/actions/program.js
+
6
−
0
View file @
a55ca24f
...
...
@@ -5,6 +5,7 @@ import property from "lodash/property";
import
{
createAsyncAction
,
errorResult
,
successResult
}
from
"
pullstate
"
;
import
{
fetch
}
from
"
api
"
;
import
{
markdownConverter
}
from
"
markdown
"
;
import
{
ProgramStore
}
from
"
stores
"
;
import
{
loadPosts
}
from
"
./posts
"
;
...
...
@@ -39,6 +40,11 @@ export const loadProgram = createAsyncAction(
"
proposer
"
,
"
speakers
"
,
]),
fullTitle
:
entry
.
number
!==
""
?
`
${
entry
.
number
}
.
${
entry
.
title
}
`
:
entry
.
title
,
htmlContent
:
markdownConverter
.
makeHtml
(
entry
.
description
),
discussionOpened
:
entry
.
discussion_opened
,
expectedStartAt
:
parse
(
entry
.
expected_start_at
,
...
...
This diff is collapsed.
Click to expand it.
src/pages/Program.jsx
+
7
−
9
View file @
a55ca24f
...
...
@@ -8,7 +8,6 @@ import Button from "components/Button";
import
Chip
from
"
components/Chip
"
;
import
ModalConfirm
from
"
components/modals/ModalConfirm
"
;
import
{
useActionState
,
useItemActionConfirm
}
from
"
hooks
"
;
import
{
markdownConverter
}
from
"
markdown
"
;
import
{
AuthStore
,
ProgramStore
}
from
"
stores
"
;
const
Schedule
=
()
=>
{
...
...
@@ -49,10 +48,9 @@ const Schedule = () => {
{
scheduleIds
.
map
((
id
)
=>
{
const
isCurrent
=
id
===
currentId
;
const
entry
=
items
[
id
];
const
fullTitle
=
`
${
entry
.
number
}
.
${
entry
.
title
}
`
;
const
htmlContent
=
!!
entry
.
description
const
htmlContent
=
entry
.
htmlContent
?
{
__html
:
markdownConverter
.
makeHtml
(
entry
.
description
)
,
__html
:
entry
.
htmlContent
,
}
:
null
;
return
(
...
...
@@ -76,11 +74,11 @@ const Schedule = () => {
</
p
>
</
div
>
<
div
className
=
"flex-grow w-full"
>
<
h2
className
=
"head-heavy-xs md:head-heavy-base mb-
1
"
>
{
isCurrent
&&
<
Link
to
=
"/"
>
{
fullTitle
}
</
Link
>
}
{
!
isCurrent
&&
fullTitle
}
<
h2
className
=
"head-heavy-xs md:head-heavy-base mb-
2
"
>
{
isCurrent
&&
<
Link
to
=
"/"
>
{
entry
.
fullTitle
}
</
Link
>
}
{
!
isCurrent
&&
entry
.
fullTitle
}
</
h2
>
<
div
className
=
"leading-
normal sm:flex sm:space-x-4
"
>
<
div
className
=
"leading-
snug
"
>
<
div
className
=
"space-x-2"
>
<
strong
>
Navrhovatel:
</
strong
>
<
span
>
{
entry
.
proposer
}
</
span
>
...
...
@@ -94,7 +92,7 @@ const Schedule = () => {
</
div
>
{
htmlContent
&&
(
<
div
className
=
"mt-2 leading-
tight
max-w-3xl content-block"
className
=
"mt-2 leading-
snug
max-w-3xl content-block"
dangerouslySetInnerHTML
=
{
htmlContent
}
/>
)
}
...
...
This diff is collapsed.
Click to expand it.
src/ws/handlers/program.js
+
9
−
1
View file @
a55ca24f
import
has
from
"
lodash/has
"
;
import
{
markdownConverter
}
from
"
markdown
"
;
import
{
ProgramStore
}
from
"
stores
"
;
export
const
handleProgramEntryChanged
=
(
payload
)
=>
{
ProgramStore
.
update
((
state
)
=>
{
if
(
state
.
items
[
payload
.
id
])
{
const
entry
=
state
.
items
[
payload
.
id
];
if
(
entry
)
{
if
(
has
(
payload
,
"
discussion_opened
"
))
{
state
.
items
[
payload
.
id
].
discussionOpened
=
payload
.
discussion_opened
;
}
if
(
has
(
payload
,
"
title
"
))
{
state
.
items
[
payload
.
id
].
title
=
payload
.
title
;
state
.
items
[
payload
.
id
].
fullTitle
=
entry
.
number
!==
""
?
`
${
entry
.
number
}
.
${
entry
.
title
}
`
:
entry
.
title
;
}
if
(
has
(
payload
,
"
description
"
))
{
state
.
items
[
payload
.
id
].
description
=
payload
.
description
;
state
.
items
[
payload
.
id
].
htmlContent
=
markdownConverter
.
makeHtml
(
payload
.
description
);
}
}
});
...
...
This diff is collapsed.
Click to expand it.
typings/cf2021.d.ts
+
2
−
0
View file @
a55ca24f
...
...
@@ -14,10 +14,12 @@ declare namespace CF2021 {
id
:
number
;
number
:
string
;
title
:
string
;
fullTitle
:
string
;
proposer
:
string
;
speakers
:
string
;
discussionOpened
:
boolean
;
description
?:
string
;
htmlContent
?:
string
;
expectedStartAt
:
Date
;
expectedFinishAt
?:
Date
;
}
...
...
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