Skip to content

Commit

Permalink
Revert "fix(lang): use INSUFFICIENT_AUTHORITY instead of FORBIDDEN_BY…
Browse files Browse the repository at this point in the history
…_STATE"

This reverts commit ff78179.
  • Loading branch information
wlliaml committed Oct 9, 2023
1 parent aa6fab1 commit 42d158b
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 47 deletions.
8 changes: 4 additions & 4 deletions lang/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,10 @@
"defaultMessage": "commented broadcast in {circleName}",
"description": "src/components/Notice/CircleNotice/CircleNewBroadcastComments.tsx"
},
"EoeUjA": {
"defaultMessage": "You do not have permission to perform this operation",
"description": "FORBIDDEN_BY_STATE"
},
"EwbNbl": {
"defaultMessage": "Oops!This link has expired",
"description": "src/views/Callback/GoogleCallback.tsx"
Expand Down Expand Up @@ -1165,10 +1169,6 @@
"defaultMessage": "Unblock",
"description": "src/components/BlockUser/Button/index.tsx"
},
"bZtfkT": {
"defaultMessage": "You do not have permission to perform this operation",
"description": "INSUFFICIENT_AUTHORITY"
},
"beLe/F": {
"defaultMessage": "Broadcast"
},
Expand Down
8 changes: 4 additions & 4 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,10 @@
"defaultMessage": "commented broadcast in {circleName}",
"description": "src/components/Notice/CircleNotice/CircleNewBroadcastComments.tsx"
},
"EoeUjA": {
"defaultMessage": "You do not have permission to perform this operation",
"description": "FORBIDDEN_BY_STATE"
},
"EwbNbl": {
"defaultMessage": "Oops!This link has expired",
"description": "src/views/Callback/GoogleCallback.tsx"
Expand Down Expand Up @@ -1165,10 +1169,6 @@
"defaultMessage": "Unblock",
"description": "src/components/BlockUser/Button/index.tsx"
},
"bZtfkT": {
"defaultMessage": "You do not have permission to perform this operation",
"description": "INSUFFICIENT_AUTHORITY"
},
"beLe/F": {
"defaultMessage": "Broadcast"
},
Expand Down
10 changes: 5 additions & 5 deletions lang/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,10 @@
"defaultMessage": "在 {circleName} 的广播中留言 ",
"description": "src/components/Notice/CircleNotice/CircleNewBroadcastComments.tsx"
},
"EoeUjA": {
"defaultMessage": "你无权限进行该操作",
"description": "FORBIDDEN_BY_STATE"
},
"EwbNbl": {
"defaultMessage": "Oops!链接已失效",
"description": "src/views/Callback/GoogleCallback.tsx"
Expand Down Expand Up @@ -1165,10 +1169,6 @@
"defaultMessage": "取消屏蔽",
"description": "src/components/BlockUser/Button/index.tsx"
},
"bZtfkT": {
"defaultMessage": "你无权限进行该操作",
"description": "INSUFFICIENT_AUTHORITY"
},
"beLe/F": {
"defaultMessage": "广播"
},
Expand Down Expand Up @@ -1835,4 +1835,4 @@
"defaultMessage": "{subscriber, plural, =1 {人} other {人}}",
"description": "src/views/Circle/Analytics/SubscriberAnalytics/index.tsx"
}
}
}
10 changes: 5 additions & 5 deletions lang/zh-Hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,10 @@
"defaultMessage": "在 {circleName} 的廣播中留言 ",
"description": "src/components/Notice/CircleNotice/CircleNewBroadcastComments.tsx"
},
"EoeUjA": {
"defaultMessage": "你無權限進行該操作",
"description": "FORBIDDEN_BY_STATE"
},
"EwbNbl": {
"defaultMessage": "Oops!連結已失效",
"description": "src/views/Callback/GoogleCallback.tsx"
Expand Down Expand Up @@ -1165,10 +1169,6 @@
"defaultMessage": "取消封鎖",
"description": "src/components/BlockUser/Button/index.tsx"
},
"bZtfkT": {
"defaultMessage": "你無權限進行該操作",
"description": "INSUFFICIENT_AUTHORITY"
},
"beLe/F": {
"defaultMessage": "廣播"
},
Expand Down Expand Up @@ -1835,4 +1835,4 @@
"defaultMessage": "{subscriber, plural, =1 {人} other {人}}",
"description": "src/views/Circle/Analytics/SubscriberAnalytics/index.tsx"
}
}
}
1 change: 0 additions & 1 deletion src/common/enums/errorCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export enum ERROR_CODES {
FORBIDDEN_BY_STATE = 'FORBIDDEN_BY_STATE',
FORBIDDEN_BY_TARGET_STATE = 'FORBIDDEN_BY_TARGET_STATE',
TOKEN_INVALID = 'TOKEN_INVALID',
INSUFFICIENT_AUTHORITY = 'INSUFFICIENT_AUTHORITY',

// Entity
ENTITY_NOT_FOUND = 'ENTITY_NOT_FOUND',
Expand Down
4 changes: 1 addition & 3 deletions src/components/ArticleDigest/DropdownActions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,7 @@ const DropdownActions = (props: DropdownActionsProps) => {
const forbid = () => {
toast.error({
message: (
<FormattedMessage
{...ERROR_MESSAGES[ERROR_CODES.INSUFFICIENT_AUTHORITY]}
/>
<FormattedMessage {...ERROR_MESSAGES[ERROR_CODES.FORBIDDEN_BY_STATE]} />
),
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Buttons/Bookmark/Subscribe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const Subscribe = ({ articleId, size, disabled, inCard }: SubscribeProps) => {
toast.error({
message: (
<FormattedMessage
{...ERROR_MESSAGES[ERROR_CODES.INSUFFICIENT_AUTHORITY]}
{...ERROR_MESSAGES[ERROR_CODES.FORBIDDEN_BY_STATE]}
/>
),
})
Expand Down
2 changes: 1 addition & 1 deletion src/components/Buttons/Bookmark/Unsubscribe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Unsubscribe = ({
toast.error({
message: (
<FormattedMessage
{...ERROR_MESSAGES[ERROR_CODES.INSUFFICIENT_AUTHORITY]}
{...ERROR_MESSAGES[ERROR_CODES.FORBIDDEN_BY_STATE]}
/>
),
})
Expand Down
2 changes: 1 addition & 1 deletion src/components/Buttons/Write/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const WriteButton = ({ allowed, authed, forbidden }: Props) => {
toast.error({
message: (
<FormattedMessage
{...ERROR_MESSAGES[ERROR_CODES.INSUFFICIENT_AUTHORITY]}
{...ERROR_MESSAGES[ERROR_CODES.FORBIDDEN_BY_STATE]}
/>
),
})
Expand Down
4 changes: 1 addition & 3 deletions src/components/CollectionDigest/DropdownActions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ const DropdownActions = (props: DropdownActionsProps) => {
const forbid = () => {
toast.error({
message: (
<FormattedMessage
{...ERROR_MESSAGES[ERROR_CODES.INSUFFICIENT_AUTHORITY]}
/>
<FormattedMessage {...ERROR_MESSAGES[ERROR_CODES.FORBIDDEN_BY_STATE]} />
),
})
}
Expand Down
4 changes: 1 addition & 3 deletions src/components/Comment/DropdownActions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,7 @@ const DropdownActions = (props: DropdownActionsProps) => {
const forbid = () => {
toast.error({
message: (
<FormattedMessage
{...ERROR_MESSAGES[ERROR_CODES.INSUFFICIENT_AUTHORITY]}
/>
<FormattedMessage {...ERROR_MESSAGES[ERROR_CODES.FORBIDDEN_BY_STATE]} />
),
})
}
Expand Down
4 changes: 1 addition & 3 deletions src/components/Comment/FooterActions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ const BaseFooterActions = ({
const forbid = () =>
toast.error({
message: (
<FormattedMessage
{...ERROR_MESSAGES[ERROR_CODES.INSUFFICIENT_AUTHORITY]}
/>
<FormattedMessage {...ERROR_MESSAGES[ERROR_CODES.FORBIDDEN_BY_STATE]} />
),
})

Expand Down
6 changes: 1 addition & 5 deletions src/components/GQL/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,8 @@ export const ERROR_MESSAGES: { [key in ERROR_CODES]: MessageDescriptor } = {
defaultMessage: 'You do not have permission to perform this operation',
description: 'FORBIDDEN',
}),
[ERROR_CODES.INSUFFICIENT_AUTHORITY]: defineMessage({
defaultMessage: 'You do not have permission to perform this operation',
description: 'INSUFFICIENT_AUTHORITY',
}),
[ERROR_CODES.FORBIDDEN_BY_STATE]: defineMessage({
defaultMessage: 'Unavailable',
defaultMessage: 'You do not have permission to perform this operation',
description: 'FORBIDDEN_BY_STATE',
}),
[ERROR_CODES.FORBIDDEN_BY_TARGET_STATE]: defineMessage({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const ForbiddenButton = ({
toast.error({
message: (
<FormattedMessage
{...ERROR_MESSAGES[ERROR_CODES.INSUFFICIENT_AUTHORITY]}
{...ERROR_MESSAGES[ERROR_CODES.FORBIDDEN_BY_STATE]}
/>
),
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ const SupportButton = ({
message: isAuthor ? (
<Translate zh_hant="去支持其他用戶吧" zh_hans="去支持其他用户吧" />
) : (
<FormattedMessage
{...ERROR_MESSAGES[ERROR_CODES.INSUFFICIENT_AUTHORITY]}
/>
<FormattedMessage {...ERROR_MESSAGES[ERROR_CODES.FORBIDDEN_BY_STATE]} />
),
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/ArticleDetail/Toolbar/CommentBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const CommentBar = ({ article, disabled }: CommentBarProps) => {
toast.error({
message: (
<FormattedMessage
{...ERROR_MESSAGES[ERROR_CODES.INSUFFICIENT_AUTHORITY]}
{...ERROR_MESSAGES[ERROR_CODES.FORBIDDEN_BY_STATE]}
/>
),
})
Expand Down
4 changes: 1 addition & 3 deletions src/views/ArticleDetail/Toolbar/DonationButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ const DonationButton = ({
const forbid = () => {
toast.error({
message: (
<FormattedMessage
{...ERROR_MESSAGES[ERROR_CODES.INSUFFICIENT_AUTHORITY]}
/>
<FormattedMessage {...ERROR_MESSAGES[ERROR_CODES.FORBIDDEN_BY_STATE]} />
),
})
}
Expand Down

0 comments on commit 42d158b

Please sign in to comment.