Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
to
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
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
Container 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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
matrix
to
Commits
38028295
Commit
38028295
authored
3 years ago
by
Danila Fedorin
Browse files
Options
Downloads
Patches
Plain Diff
Differentiate between rooms and room aliases
parent
5f5359ae
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/InvalidUrlView.js
+13
-6
13 additions, 6 deletions
src/InvalidUrlView.js
with
13 additions
and
6 deletions
src/InvalidUrlView.js
+
13
−
6
View file @
38028295
...
@@ -15,7 +15,7 @@ limitations under the License.
...
@@ -15,7 +15,7 @@ limitations under the License.
*/
*/
import
{
TemplateView
}
from
"
./utils/TemplateView.js
"
;
import
{
TemplateView
}
from
"
./utils/TemplateView.js
"
;
import
{
LinkKind
}
from
"
./Link.js
"
;
import
{
LinkKind
,
IdentifierKind
}
from
"
./Link.js
"
;
export
class
InvalidUrlView
extends
TemplateView
{
export
class
InvalidUrlView
extends
TemplateView
{
render
(
t
,
vm
)
{
render
(
t
,
vm
)
{
...
@@ -29,12 +29,16 @@ export class InvalidUrlView extends TemplateView {
...
@@ -29,12 +29,16 @@ export class InvalidUrlView extends TemplateView {
]);
]);
}
}
_describeLinkKind
(
kind
)
{
_describeRoom
(
identifierKind
)
{
switch
(
kind
)
{
return
identifierKind
===
IdentifierKind
.
RoomAlias
?
"
room alias
"
:
"
room
"
;
case
LinkKind
.
Room
:
return
"
The room
"
;
}
_describeLinkKind
(
linkKind
,
identifierKind
)
{
switch
(
linkKind
)
{
case
LinkKind
.
Room
:
return
`The
${
this
.
_describeRoom
(
identifierKind
)}
`
;
case
LinkKind
.
User
:
return
"
The user
"
;
case
LinkKind
.
User
:
return
"
The user
"
;
case
LinkKind
.
Group
:
return
"
The group
"
;
case
LinkKind
.
Group
:
return
"
The group
"
;
case
LinkKind
.
Event
:
return
"
An event in
room
"
;
case
LinkKind
.
Event
:
return
`
An event in
${
this
.
_describeRoom
(
identifierKind
)}
`
;
}
}
}
}
...
@@ -42,7 +46,10 @@ export class InvalidUrlView extends TemplateView {
...
@@ -42,7 +46,10 @@ export class InvalidUrlView extends TemplateView {
return
t
.
p
([
return
t
.
p
([
'
Did you mean any of the following?
'
,
'
Did you mean any of the following?
'
,
t
.
ul
(
validFixes
.
map
(
fix
=>
t
.
ul
(
validFixes
.
map
(
fix
=>
t
.
li
([
this
.
_describeLinkKind
(
fix
.
link
.
kind
),
t
.
a
({
href
:
fix
.
url
},
fix
.
link
.
identifier
)])
t
.
li
([
this
.
_describeLinkKind
(
fix
.
link
.
kind
,
fix
.
link
.
identifierKind
),
t
.
a
({
href
:
fix
.
url
},
fix
.
link
.
identifier
)
])
))
))
]);
]);
}
}
...
...
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