Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update posts.md #9893

Merged
merged 18 commits into from
Jul 3, 2024
28 changes: 26 additions & 2 deletions docs/posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,33 @@ DataHub allows users to make Posts that can be displayed on the app. Currently,

Anyone can view Posts on the home page. To create Posts, a user must either have the **Create Global Announcements** Privilege, or possess the **Admin** DataHub Role.

## Using Posts
## Creating Posts

To create a post, users must use the [createPost](../graphql/mutations.md#createPost) GraphQL mutation. There is currently no way to create posts using the UI, though this will come in the future.
### Create Posts Using the UI
chardaway marked this conversation as resolved.
Show resolved Hide resolved
To create a post, first navigate to the Settings tab in the top-right menu of DataHub.
Once you're on the Settings page, click 'Home Page Posts'.
To create a new Post, click '+ New Post'.
<p align="center">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add alt text to images.

Images in this section are missing alt text, which is important for accessibility.

- <img width="70%"  src="https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/posts/new-post.png" />
+ <img alt="Creating a new post" width="70%"  src="https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/posts/new-post.png" />

Committable suggestion was skipped due to low confidence.

<img alt="Creating a new post" width="70%" src="https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/posts/new-post.png" />
Comment on lines +22 to +23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add alt text to images and fix grammatical errors.

Images in this section are missing alt text, which is important for accessibility. Also, there's a grammatical error in line 20 where "a new Posts" should be "a new Post".

- <img width="70%"  src="https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/posts/new-post.png" />
+ <img alt="Creating a new post" width="70%"  src="https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/posts/new-post.png" />

Committable suggestion was skipped due to low confidence.

</p>
DataHub currently supports two types of Post content. Posts can either be of type **Text** or **Link**. Click on "Post Type" to switch between these types.
<p align="center">
<img alt="Selecting text post type" width="70%" src="https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/posts/post-type-text.png" />
</p>
<p align="center">
<img alt="Selecting link post type" width="70%" src="https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/posts/post-type-link.png" />
</p>
If you choose the text type, enter the title and description as prompted; if you choose the link type, enter the title and the URL of the link and the address of the image as prompted.

Click 'Create' to complete.
<p align="center">
<img alt="Viewing posts" width="70%" src="https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/posts/view-posts.png" />
</p>

### Create Posts Using the GraphQL
chardaway marked this conversation as resolved.
Show resolved Hide resolved

To create a post via API, you can call the [createPost](../graphql/mutations.md#createPost) GraphQL mutation.
chardaway marked this conversation as resolved.
Show resolved Hide resolved
To create a post via API, you can call the [createPost](../graphql/mutations.md#createPost) GraphQL mutation.

There is only one type of Post that can be currently made, and that is a **Home Page Announcement**. This may be extended in the future to other surfaces.

Expand Down
Loading