Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
haven
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
haven
Commits
cc4e9f13
Commit
cc4e9f13
authored
4 months ago
by
Richard T. Carback III
Browse files
Options
Downloads
Patches
Plain Diff
Fix channel join
parent
8d58b480
No related branches found
No related tags found
1 merge request
!110
Hot fixes for vite
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/common/Input/index.tsx
+4
-4
4 additions, 4 deletions
src/components/common/Input/index.tsx
src/components/modals/CreateChannelView/CreateChannelView.tsx
+42
-5
42 additions, 5 deletions
...components/modals/CreateChannelView/CreateChannelView.tsx
with
46 additions
and
9 deletions
src/components/common/Input/index.tsx
+
4
−
4
View file @
cc4e9f13
...
...
@@ -19,10 +19,10 @@ const Input: FC<Props> = ({ size = 'md', ...props }) => (
w-full block
rounded-[1.5rem]
px-4
bg-
transparent
border border-
[var(--
charcoal-1
)]
focus:outline-none focus:border-
[var(--
primary
)]
placeholder:text-sm placeholder:text-
[var(--
charcoal-1
)]
bg-
charcoal-4
border border-charcoal-1
focus:outline-none focus:border-primary
placeholder:text-sm placeholder:text-charcoal-1
${
sizeMap
[
size
]}
${
props
.
className
||
''
}
`
}
...
...
This diff is collapsed.
Click to expand it.
src/components/modals/CreateChannelView/CreateChannelView.tsx
+
42
−
5
View file @
cc4e9f13
...
...
@@ -55,16 +55,44 @@ const CreateChannelView: FC = () => {
const
onCreate
=
useCallback
(
async
()
=>
{
if
(
error
)
{
console
.
error
(
'
Validation error:
'
,
error
);
return
;
}
const
trimmedName
=
channelName
.
trim
();
// Log the actual values for debugging
console
.
log
(
'
Attempting to create channel with:
'
,
{
name
:
trimmedName
,
nameLength
:
trimmedName
.
length
,
description
:
channelDesc
,
privacyLevel
,
dmsEnabled
});
try
{
createChannel
(
channelName
,
channelDesc
,
privacyLevel
,
dmsEnabled
);
if
(
!
trimmedName
)
{
alert
({
type
:
'
error
'
,
content
:
t
(
'
Channel name is required
'
)
});
return
;
}
if
(
!
regex
.
test
(
trimmedName
))
{
alert
({
type
:
'
error
'
,
content
:
t
(
'
Invalid channel name format
'
)
});
return
;
}
await
createChannel
(
trimmedName
,
channelDesc
,
privacyLevel
,
dmsEnabled
);
setChannelName
(
''
);
setChannelDesc
(
''
);
closeModal
();
}
catch
(
e
)
{
console
.
error
(
(
e
as
any
).
messag
e
);
console
.
error
(
'
Failed to create channel:
'
,
e
);
alert
({
type
:
'
error
'
,
content
:
t
(
'
Something wrong happened, please check your details.
'
)
...
...
@@ -89,7 +117,17 @@ const CreateChannelView: FC = () => {
<
ModalTitle
>
{
t
(
'
Create New Space
'
)
}
</
ModalTitle
>
<
div
className
=
'space-y-4 w-full'
>
<
Input
className
=
{
cn
({
'
border-red text-red placeholder:text-red
'
:
!!
nameError
})
}
autoFocus
className
=
{
cn
(
`
focus:border-primary
focus-visible:outline-none w-full
rounded-2xl bg-charcoal-4 border border-charcoal-1 px-4 py-2
placeholder-charcoal-1 placeholder:text-sm
transition-all`
,
{
'
border-red text-red
'
:
!!
nameError
}
)
}
data-testid
=
'channel-name-input'
type
=
'text'
placeholder
=
{
t
(
'
Name
'
)
}
...
...
@@ -103,8 +141,7 @@ const CreateChannelView: FC = () => {
onChange
=
{
onChannelNameChange
}
/>
<
textarea
className
=
{
cn
(
`
className
=
{
cn
(
`
focus:border-primary
focus-visible:outline-none resize-none h-10 active:outline-0 w-full
rounded-2xl bg-charcoal-4 border border-charcoal-1 px-4 py-2
...
...
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