-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1693 from vivid-planet/merge-main-into-next
Merge main into next
- Loading branch information
Showing
6 changed files
with
23 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@comet/cms-api": patch | ||
--- | ||
|
||
API Generator: Disable input generation if `create` and `update` are set to `false` in the decorator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@comet/cms-admin": patch | ||
--- | ||
|
||
Use `useCurrentUser` hook where possible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 3 additions & 17 deletions
20
packages/admin/cms-admin/src/dashboard/DefaultGreeting.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,9 @@ | ||
import { gql, useQuery } from "@apollo/client"; | ||
import React from "react"; | ||
import { FormattedMessage } from "react-intl"; | ||
|
||
import { GQLDashboardCurrentUserNameQuery } from "./DefaultGreeting.generated"; | ||
|
||
const CURRENT_USER_NAME_QUERY = gql` | ||
query DashboardCurrentUserName { | ||
currentUser { | ||
name | ||
} | ||
} | ||
`; | ||
import { useCurrentUser } from "../userPermissions/hooks/currentUser"; | ||
|
||
export const DefaultGreeting = () => { | ||
const { data } = useQuery<GQLDashboardCurrentUserNameQuery>(CURRENT_USER_NAME_QUERY); | ||
|
||
if (data) { | ||
return <FormattedMessage id="dashboard.userGreeting" defaultMessage="Hello {givenName}!" values={{ givenName: data.currentUser.name }} />; | ||
} | ||
|
||
return <FormattedMessage id="dashboard.greeting" defaultMessage="Hello!" />; | ||
const user = useCurrentUser(); | ||
return <FormattedMessage id="dashboard.userGreeting" defaultMessage="Hello {givenName}!" values={{ givenName: user.name }} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters