Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
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
Package 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
Pierre Boudes
mastodon
Commits
bd1ceb1d
Commit
bd1ceb1d
authored
8 years ago
by
Eugen Rochko
Browse files
Options
Downloads
Patches
Plain Diff
Privacy dropdown i18n
parent
99ca63a5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/assets/javascripts/components/features/compose/components/privacy_dropdown.jsx
+20
-8
20 additions, 8 deletions
...mponents/features/compose/components/privacy_dropdown.jsx
with
20 additions
and
8 deletions
app/assets/javascripts/components/features/compose/components/privacy_dropdown.jsx
+
20
−
8
View file @
bd1ceb1d
import
PureRenderMixin
from
'
react-addons-pure-render-mixin
'
;
import
{
Formatted
Message
}
from
'
react-intl
'
;
import
{
injectIntl
,
define
Message
s
}
from
'
react-intl
'
;
import
IconButton
from
'
../../../components/icon_button
'
;
const
messages
=
defineMessages
({
public_short
:
{
id
:
'
privacy.public.short
'
,
defaultMessage
:
'
Public
'
},
public_long
:
{
id
:
'
privacy.public.long
'
,
defaultMessage
:
'
Anyone can see
'
},
unlisted_short
:
{
id
:
'
privacy.unlisted.short
'
,
defaultMessage
:
'
Unlisted
'
},
unlisted_long
:
{
id
:
'
privacy.unlisted.long
'
,
defaultMessage
:
'
Anyone can see
'
},
private_short
:
{
id
:
'
privacy.private.short
'
,
defaultMessage
:
'
Private
'
},
private_long
:
{
id
:
'
privacy.private.long
'
,
defaultMessage
:
'
Followers can see
'
},
direct_short
:
{
id
:
'
privacy.direct.short
'
,
defaultMessage
:
'
Direct
'
},
direct_long
:
{
id
:
'
privacy.direct.long
'
,
defaultMessage
:
'
Mentions can see
'
}
});
const
PrivacyDropdown
=
React
.
createClass
({
propTypes
:
{
value
:
React
.
PropTypes
.
string
.
isRequired
,
onChange
:
React
.
PropTypes
.
func
.
isRequired
onChange
:
React
.
PropTypes
.
func
.
isRequired
,
intl
:
React
.
PropTypes
.
object
.
isRequired
},
getInitialState
()
{
...
...
@@ -48,14 +60,14 @@ const PrivacyDropdown = React.createClass({
},
render
()
{
const
{
value
,
onChange
}
=
this
.
props
;
const
{
value
,
onChange
,
intl
}
=
this
.
props
;
const
{
open
}
=
this
.
state
;
const
options
=
[
{
icon
:
'
globe
'
,
value
:
'
public
'
,
shortText
:
'
Public
'
,
longText
:
'
Anyone can see
'
},
{
icon
:
'
globe
'
,
value
:
'
unlisted
'
,
shortText
:
'
Unlisted
'
,
longText
:
'
Anyone can see
'
},
{
icon
:
'
lock
'
,
value
:
'
private
'
,
shortText
:
'
Private
'
,
longText
:
'
Followers can see
'
},
{
icon
:
'
send
'
,
value
:
'
direct
'
,
shortText
:
'
Direct
'
,
longText
:
'
Mentions can see
'
}
{
icon
:
'
globe
'
,
value
:
'
public
'
,
shortText
:
intl
.
formatMessage
(
messages
.
public_short
),
longText
:
intl
.
formatMessage
(
messages
.
public_long
)
},
{
icon
:
'
globe
'
,
value
:
'
unlisted
'
,
shortText
:
intl
.
formatMessage
(
messages
.
unlisted_short
),
longText
:
intl
.
formatMessage
(
messages
.
unlisted_long
)
},
{
icon
:
'
lock
'
,
value
:
'
private
'
,
shortText
:
intl
.
formatMessage
(
messages
.
private_short
),
longText
:
intl
.
formatMessage
(
messages
.
private_long
)
},
{
icon
:
'
send
'
,
value
:
'
direct
'
,
shortText
:
intl
.
formatMessage
(
messages
.
direct_short
),
longText
:
intl
.
formatMessage
(
messages
.
direct_long
)
}
];
const
valueOption
=
options
.
find
(
item
=>
item
.
value
===
value
);
...
...
@@ -80,4 +92,4 @@ const PrivacyDropdown = React.createClass({
});
export
default
PrivacyDropdown
;
export
default
injectIntl
(
PrivacyDropdown
)
;
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