From 8b82106c3fed707c2abe1ac00111337fe523d7c6 Mon Sep 17 00:00:00 2001
From: Matt Shaver <60105315+matthewshaver@users.noreply.github.com>
Date: Tue, 22 Oct 2024 13:19:38 -0400
Subject: [PATCH 01/14] Adding sortable tables
---
website/package-lock.json | 76 +++++++++++++++++++
website/package.json | 2 +
.../snippets/_enterprise-permissions-table.md | 39 +++++-----
website/src/components/sortableTable/index.js | 73 ++++++++++++++++++
4 files changed, 173 insertions(+), 17 deletions(-)
create mode 100644 website/src/components/sortableTable/index.js
diff --git a/website/package-lock.json b/website/package-lock.json
index 5fdf491f1cf..9a87f8c45c8 100644
--- a/website/package-lock.json
+++ b/website/package-lock.json
@@ -37,10 +37,12 @@
"react-dom": "^18.2.0",
"react-full-screen": "^1.1.1",
"react-is": "^18.1.0",
+ "react-markdown": "^9.0.1",
"react-select": "^5.7.5",
"react-tooltip": "^4.2.21",
"redoc": "^2.0.0-rc.57",
"rehype-katex": "^5.0.0",
+ "remark-gfm": "^4.0.0",
"remark-math": "^3.0.1",
"sanitize-html": "^2.8.0",
"slugify": "^1.6.1",
@@ -13848,6 +13850,15 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/html-url-attributes": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/html-url-attributes/-/html-url-attributes-3.0.1.tgz",
+ "integrity": "sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ==",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/html-void-elements": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-2.0.1.tgz",
@@ -24384,6 +24395,71 @@
"webpack": ">=4.41.1 || 5.x"
}
},
+ "node_modules/react-markdown": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-9.0.1.tgz",
+ "integrity": "sha512-186Gw/vF1uRkydbsOIkcGXw7aHq0sZOCRFFjGrr7b9+nVZg4UfA4enXCaxm4fUzecU38sWfrNDitGhshuU7rdg==",
+ "dependencies": {
+ "@types/hast": "^3.0.0",
+ "devlop": "^1.0.0",
+ "hast-util-to-jsx-runtime": "^2.0.0",
+ "html-url-attributes": "^3.0.0",
+ "mdast-util-to-hast": "^13.0.0",
+ "remark-parse": "^11.0.0",
+ "remark-rehype": "^11.0.0",
+ "unified": "^11.0.0",
+ "unist-util-visit": "^5.0.0",
+ "vfile": "^6.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ },
+ "peerDependencies": {
+ "@types/react": ">=18",
+ "react": ">=18"
+ }
+ },
+ "node_modules/react-markdown/node_modules/@types/mdast": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz",
+ "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==",
+ "dependencies": {
+ "@types/unist": "*"
+ }
+ },
+ "node_modules/react-markdown/node_modules/mdast-util-to-hast": {
+ "version": "13.2.0",
+ "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz",
+ "integrity": "sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==",
+ "dependencies": {
+ "@types/hast": "^3.0.0",
+ "@types/mdast": "^4.0.0",
+ "@ungap/structured-clone": "^1.0.0",
+ "devlop": "^1.0.0",
+ "micromark-util-sanitize-uri": "^2.0.0",
+ "trim-lines": "^3.0.0",
+ "unist-util-position": "^5.0.0",
+ "unist-util-visit": "^5.0.0",
+ "vfile": "^6.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/react-markdown/node_modules/unist-util-position": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz",
+ "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==",
+ "dependencies": {
+ "@types/unist": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/react-overflow-list": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/react-overflow-list/-/react-overflow-list-0.5.0.tgz",
diff --git a/website/package.json b/website/package.json
index 51edae4bf17..3b5f8b309ef 100644
--- a/website/package.json
+++ b/website/package.json
@@ -40,10 +40,12 @@
"react-dom": "^18.2.0",
"react-full-screen": "^1.1.1",
"react-is": "^18.1.0",
+ "react-markdown": "^9.0.1",
"react-select": "^5.7.5",
"react-tooltip": "^4.2.21",
"redoc": "^2.0.0-rc.57",
"rehype-katex": "^5.0.0",
+ "remark-gfm": "^4.0.0",
"remark-math": "^3.0.1",
"sanitize-html": "^2.8.0",
"slugify": "^1.6.1",
diff --git a/website/snippets/_enterprise-permissions-table.md b/website/snippets/_enterprise-permissions-table.md
index d972fc95342..9fef489ebf6 100644
--- a/website/snippets/_enterprise-permissions-table.md
+++ b/website/snippets/_enterprise-permissions-table.md
@@ -1,3 +1,4 @@
+import SortableTable from '@site/src/components/SortableTable';
Key:
@@ -13,23 +14,27 @@ Permissions:
Account roles enable you to manage the dbt Cloud account and manage the account settings (for example, generating service tokens, inviting users, and configuring SSO). They also provide project-level permissions. The **Account Admin** role is the highest level of access you can assign.
#### Account permissions for account roles
-| Account-level permission| Account Admin | Billing admin | Manage
marketplace
apps | Project creator | Security admin | Viewer |
-|:-------------------------|:-------------:|:------------:|:-------------------------:|:---------------:|:--------------:|:------:|
-| Account settings | W | | | R | R | R |
-| Audit logs | R | | | | R | R |
-| Auth provider | W | | | | W | R |
-| Billing | W | W | | | | R |
-| Connections | W | | | W | | |
-| Groups | W | | | R | W | R |
-| Invitations | W | | | W | W | R |
-| IP restrictions | W | | | | W | R |
-| Licenses | W | | | W | W | R |
-| Marketplace app | | | W | | | |
-| Members | W | | | W | W | R |
-| Project (create) | W | | | W | | |
-| Public models | R | R | | R | R | R |
-| Service tokens | W | | | | R | R |
-| Webhooks | W | | | | | |
+
+
sortTable(index)}
+ style={{ cursor: 'pointer', position: 'relative', textAlign: columnAlignments[index] || 'left', padding: '10px' }} // Apply alignment
+ >
+
+ {header}
+ {/* Always show both carets */}
+
+ ↑
+
+
+ ↓
+
+
+ |
+ ))}
+
---|
{cell || '\u00A0'} | // Apply alignment to cells + ))} +