datahub/assets/js/0d4d7cec.e340f07d.js
2025-08-22 14:09:31 +00:00

1 line
17 KiB
JavaScript

"use strict";(self.webpackChunkdocs_website=self.webpackChunkdocs_website||[]).push([[20441],{7653:(e,t,n)=>{n.d(t,{A:()=>a});const a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"}},4732:(e,t,n)=>{n.d(t,{A:()=>p});var a=n(89379),r=n(96540),o=n(7653),s=n(89990),i=function(e,t){return r.createElement(s.A,(0,a.A)((0,a.A)({},e),{},{ref:t,icon:o.A}))};const p=r.forwardRef(i)},15680:(e,t,n)=>{n.d(t,{xA:()=>c,yg:()=>y});var a=n(96540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var p=a.createContext({}),l=function(e){var t=a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},c=function(e){var t=l(e.components);return a.createElement(p.Provider,{value:t},e.children)},u="mdxType",g={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,p=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),u=l(n),m=r,y=u["".concat(p,".").concat(m)]||u[m]||g[m]||o;return n?a.createElement(y,s(s({ref:t},c),{},{components:n})):a.createElement(y,s({ref:t},c))}));function y(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,s=new Array(o);s[0]=m;var i={};for(var p in t)hasOwnProperty.call(t,p)&&(i[p]=t[p]);i.originalType=e,i[u]="string"==typeof e?e:r,s[1]=i;for(var l=2;l<o;l++)s[l]=n[l];return a.createElement.apply(null,s)}return a.createElement.apply(null,n)}m.displayName="MDXCreateElement"},43655:(e,t,n)=>{n.d(t,{A:()=>b});var a=n(96540),r=n(20053);const o="availabilityCard_P5od",s="managedIcon_AxXO",i="platform_wqXv",p="platformAvailable_Y8lN";var l=n(4732),c=n(89379);const u={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"};var g=n(89990),m=function(e,t){return a.createElement(g.A,(0,c.A)((0,c.A)({},e),{},{ref:t,icon:u}))};const y=a.forwardRef(m);const d={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M811.4 418.7C765.6 297.9 648.9 212 512.2 212S258.8 297.8 213 418.6C127.3 441.1 64 519.1 64 612c0 110.5 89.5 200 199.9 200h496.2C870.5 812 960 722.5 960 612c0-92.7-63.1-170.7-148.6-193.3zm36.3 281a123.07 123.07 0 01-87.6 36.3H263.9c-33.1 0-64.2-12.9-87.6-36.3A123.3 123.3 0 01140 612c0-28 9.1-54.3 26.2-76.3a125.7 125.7 0 0166.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10c54.3 14.5 92.1 63.8 92.1 120 0 33.1-12.9 64.3-36.3 87.7z"}}]},name:"cloud",theme:"outlined"};var h=function(e,t){return a.createElement(g.A,(0,c.A)((0,c.A)({},e),{},{ref:t,icon:d}))};const f=a.forwardRef(h),b=({saasOnly:e,ossOnly:t})=>a.createElement("div",{className:(0,r.A)(o,"card")},a.createElement("strong",null,"Feature Availability"),a.createElement("div",null,a.createElement("span",{className:(0,r.A)(i,!e&&p)},"Self-Hosted DataHub ",e?a.createElement(l.A,null):a.createElement(y,null))),a.createElement("div",null,a.createElement(f,{className:s}),a.createElement("span",{className:(0,r.A)(i,!t&&p)},"DataHub Cloud ",t?a.createElement(l.A,null):a.createElement(y,null))))},96693:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>l,default:()=>d,frontMatter:()=>p,metadata:()=>c,toc:()=>g});n(96540);var a=n(15680),r=n(43655);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function i(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}const p={title:"Posts",slug:"/posts",custom_edit_url:"https://github.com/datahub-project/datahub/blob/master/docs/posts.md"},l="Posts",c={unversionedId:"docs/posts",id:"version-1.1.0/docs/posts",title:"Posts",description:"DataHub allows users to make Posts that can be displayed on the app. Currently, Posts are only supported on the Home Page, but may be extended to other surfaces of the app in the future. Posts can be used to accomplish the following:",source:"@site/versioned_docs/version-1.1.0/docs/posts.md",sourceDirName:"docs",slug:"/posts",permalink:"/docs/1.1.0/posts",draft:!1,editUrl:"https://github.com/datahub-project/datahub/blob/master/docs/posts.md",tags:[],version:"1.1.0",frontMatter:{title:"Posts",slug:"/posts",custom_edit_url:"https://github.com/datahub-project/datahub/blob/master/docs/posts.md"},sidebar:"overviewSidebar",previous:{title:"Access Policies",permalink:"/docs/1.1.0/authorization/access-policies-guide"},next:{title:"Overview",permalink:"/docs/1.1.0/features/feature-guides/properties/overview"}},u={},g=[{value:"Posts Setup, Prerequisites, and Permissions",id:"posts-setup-prerequisites-and-permissions",level:2},{value:"Creating Posts",id:"creating-posts",level:2},{value:"Create Posts Using the UI",id:"create-posts-using-the-ui",level:3},{value:"Create Posts Using the GraphQL",id:"create-posts-using-the-graphql",level:3},{value:"GraphQL",id:"graphql",level:3},{value:"Examples",id:"examples",level:3},{value:"Create Post",id:"create-post",level:5},{value:"List Post",id:"list-post",level:5},{value:"Input for list post",id:"input-for-list-post",level:5},{value:"Delete Post",id:"delete-post",level:5}],m={toc:g},y="wrapper";function d(e){var{components:t}=e,n=i(e,["components"]);return(0,a.yg)(y,s(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.forEach((function(t){o(e,t,n[t])}))}return e}({},m,n),{components:t,mdxType:"MDXLayout"}),(0,a.yg)("h1",{id:"posts"},"Posts"),(0,a.yg)(r.A,{mdxType:"FeatureAvailability"}),"DataHub allows users to make Posts that can be displayed on the app. Currently, Posts are only supported on the Home Page, but may be extended to other surfaces of the app in the future. Posts can be used to accomplish the following:",(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"Allowing Admins to post announcements on the home page"),(0,a.yg)("li",{parentName:"ul"},"Pinning important DataHub assets or pages"),(0,a.yg)("li",{parentName:"ul"},"Pinning important external links")),(0,a.yg)("h2",{id:"posts-setup-prerequisites-and-permissions"},"Posts Setup, Prerequisites, and Permissions"),(0,a.yg)("p",null,"Anyone can view Posts on the home page. To create Posts, a user must either have the ",(0,a.yg)("strong",{parentName:"p"},"Create Global Announcements")," Privilege, or possess the ",(0,a.yg)("strong",{parentName:"p"},"Admin")," DataHub Role."),(0,a.yg)("h2",{id:"creating-posts"},"Creating Posts"),(0,a.yg)("h3",{id:"create-posts-using-the-ui"},"Create Posts Using the UI"),(0,a.yg)("p",null,"To create a post, first navigate to the Settings tab in the top-right menu of DataHub.\nOnce you're on the Settings page, click 'Home Page Posts'.\nTo create a new Post, click '+ New Post'."),(0,a.yg)("p",{align:"center"},(0,a.yg)("img",{alt:"Creating a new post",width:"70%",src:"https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/posts/new-post.png"})),'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.',(0,a.yg)("p",{align:"center"},(0,a.yg)("img",{alt:"Selecting text post type",width:"70%",src:"https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/posts/post-type-text.png"})),(0,a.yg)("p",{align:"center"},(0,a.yg)("img",{alt:"Selecting link post type",width:"70%",src:"https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/posts/post-type-link.png"})),"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.",(0,a.yg)("p",null,"Click 'Create' to complete."),(0,a.yg)("p",{align:"center"},(0,a.yg)("img",{alt:"Viewing posts",width:"70%",src:"https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/posts/view-posts.png"})),(0,a.yg)("h3",{id:"create-posts-using-the-graphql"},"Create Posts Using the GraphQL"),(0,a.yg)("p",null,"To create a post via API, you can call the ",(0,a.yg)("a",{parentName:"p",href:"/docs/1.1.0/graphql/mutations#createPost"},"createPost")," GraphQL mutation.\nTo create a post via API, you can call the ",(0,a.yg)("a",{parentName:"p",href:"/docs/1.1.0/graphql/mutations#createPost"},"createPost")," GraphQL mutation."),(0,a.yg)("p",null,"There is only one type of Post that can be currently made, and that is a ",(0,a.yg)("strong",{parentName:"p"},"Home Page Announcement"),". This may be extended in the future to other surfaces."),(0,a.yg)("p",null,"DataHub currently supports two types of Post content. Posts can either contain ",(0,a.yg)("strong",{parentName:"p"},"TEXT")," or can be a ",(0,a.yg)("strong",{parentName:"p"},"LINK"),". When creating a post through GraphQL, users will have to supply the post content."),(0,a.yg)("p",null,"For ",(0,a.yg)("strong",{parentName:"p"},"TEXT")," posts, the following pieces of information are required in the ",(0,a.yg)("inlineCode",{parentName:"p"},"content")," object (of type ",(0,a.yg)("a",{parentName:"p",href:"/docs/1.1.0/graphql/inputObjects#updatepostcontentinput"},"UpdatePostContentInput"),") of the GraphQL ",(0,a.yg)("inlineCode",{parentName:"p"},"input")," (of type ",(0,a.yg)("a",{parentName:"p",href:"/docs/1.1.0/graphql/inputObjects#createpostinput"},"CreatePostInput"),")). ",(0,a.yg)("strong",{parentName:"p"},"TEXT")," posts cannot be clicked."),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("inlineCode",{parentName:"li"},"contentType: TEXT")),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("inlineCode",{parentName:"li"},"title")),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("inlineCode",{parentName:"li"},"description"))),(0,a.yg)("p",null,"The ",(0,a.yg)("inlineCode",{parentName:"p"},"link")," and ",(0,a.yg)("inlineCode",{parentName:"p"},"media")," attributes are currently unused for ",(0,a.yg)("strong",{parentName:"p"},"TEXT")," posts."),(0,a.yg)("p",null,"For ",(0,a.yg)("strong",{parentName:"p"},"LINK")," posts, the following pieces of information are required in the ",(0,a.yg)("inlineCode",{parentName:"p"},"content")," object (of type ",(0,a.yg)("a",{parentName:"p",href:"/docs/1.1.0/graphql/inputObjects#updatepostcontentinput"},"UpdatePostContentInput"),") of the GraphQL ",(0,a.yg)("inlineCode",{parentName:"p"},"input")," (of type ",(0,a.yg)("a",{parentName:"p",href:"/docs/1.1.0/graphql/inputObjects#createpostinput"},"CreatePostInput"),")). ",(0,a.yg)("strong",{parentName:"p"},"LINK")," posts redirect to the provided link when clicked."),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("inlineCode",{parentName:"li"},"contentType: LINK")),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("inlineCode",{parentName:"li"},"title")),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("inlineCode",{parentName:"li"},"link")),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("inlineCode",{parentName:"li"},"media"),". Currently only the ",(0,a.yg)("strong",{parentName:"li"},"IMAGE")," type is supported, and the URL of the image must be provided")),(0,a.yg)("p",null,"The ",(0,a.yg)("inlineCode",{parentName:"p"},"description")," attribute is currently unused for ",(0,a.yg)("strong",{parentName:"p"},"LINK")," posts."),(0,a.yg)("p",null,"Here are some examples of Posts displayed on the home page, with one ",(0,a.yg)("strong",{parentName:"p"},"TEXT")," post and two ",(0,a.yg)("strong",{parentName:"p"},"LINK")," posts."),(0,a.yg)("p",{align:"center"},(0,a.yg)("img",{width:"70%",src:"https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/posts/view-posts.png"})),(0,a.yg)("h3",{id:"graphql"},"GraphQL"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("a",{parentName:"li",href:"/docs/1.1.0/graphql/mutations#createpost"},"createPost")),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("a",{parentName:"li",href:"/docs/1.1.0/graphql/queries#listposts"},"listPosts")),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("a",{parentName:"li",href:"/docs/1.1.0/graphql/queries#listposts"},"deletePosts"))),(0,a.yg)("h3",{id:"examples"},"Examples"),(0,a.yg)("h5",{id:"create-post"},"Create Post"),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre",className:"language-graphql"},'mutation test {\n\xa0 createPost(\n\xa0\xa0\xa0 input: {\n postType: HOME_PAGE_ANNOUNCEMENT,\n content: {\n contentType: TEXT,\n title: "Planed Upgrade 2023-03-23 20:05 - 2023-03-23 23:05",\n description: "datahub upgrade to v0.10.1"\n }\n }\n\xa0 )\n}\n\n')),(0,a.yg)("h5",{id:"list-post"},"List Post"),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre",className:"language-graphql"},"query listPosts($input: ListPostsInput!) {\n\xa0 listPosts(input: $input) {\n\xa0\xa0\xa0 start\n\xa0\xa0\xa0 count\n\xa0\xa0\xa0 total\n\xa0\xa0\xa0 posts {\n\xa0\xa0\xa0\xa0\xa0 urn\n\xa0\xa0\xa0\xa0\xa0 type\n\xa0\xa0\xa0\xa0\xa0 postType\n\xa0\xa0\xa0\xa0\xa0 content {\n\xa0\xa0\xa0\xa0\xa0\xa0\xa0 contentType\n\xa0\xa0\xa0\xa0\xa0\xa0\xa0 title\n\xa0\xa0\xa0\xa0\xa0\xa0\xa0 description\n\xa0\xa0\xa0\xa0\xa0\xa0\xa0 link\n\xa0\xa0\xa0\xa0\xa0\xa0\xa0 media {\n\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 type\n\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 location\n\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0 __typename\n\xa0\xa0\xa0\xa0\xa0\xa0\xa0 }\n\xa0\xa0\xa0\xa0\xa0\xa0\xa0 __typename\n\xa0\xa0\xa0\xa0\xa0 }\n\xa0\xa0\xa0\xa0\xa0 __typename\n\xa0\xa0\xa0 }\n\xa0\xa0\xa0 __typename\n\xa0 }\n}\n\n")),(0,a.yg)("h5",{id:"input-for-list-post"},"Input for list post"),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre",className:"language-shell"},'{\n\xa0 "input": {\n\xa0\xa0\xa0 "start": 0,\n\xa0\xa0\xa0 "count": 10\n\xa0 }\n}\n')),(0,a.yg)("h5",{id:"delete-post"},"Delete Post"),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre",className:"language-graphql"},'mutation deletePosting {\n deletePost (\n\xa0 urn: "urn:li:post:61dd86fa-9e76-4924-ad45-3a533671835e"\n )\n}\n')))}d.isMDXComponent=!0}}]);