Skip to content

Commit eb5dd7b

Browse files
jreockCortexFernando Cremer
authored
Confluence plugin (#32)
Co-authored-by: Cortex <[email protected]> Co-authored-by: Fernando Cremer <[email protected]>
1 parent 60f01b0 commit eb5dd7b

34 files changed

+80044
-1571
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Cortex
3+
Copyright (c) 2024 Cortex
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
dist/
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
},
6+
extends: [
7+
"plugin:react/jsx-runtime",
8+
"plugin:react-hooks/recommended",
9+
"standard-with-typescript",
10+
"prettier",
11+
],
12+
overrides: [],
13+
parserOptions: {
14+
ecmaVersion: "latest",
15+
project: "tsconfig.json",
16+
sourceType: "module",
17+
tsconfigRootDir: __dirname,
18+
},
19+
plugins: ["react"],
20+
rules: {
21+
// conflicts with no-extra-boolean-cast
22+
"@typescript-eslint/strict-boolean-expressions": "off",
23+
"no-console": ["error", { allow: ["warn", "error"] }],
24+
},
25+
settings: {
26+
react: {
27+
version: "detect",
28+
},
29+
},
30+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# OSX
2+
*.DS_Store
3+
4+
# IDEs
5+
.idea
6+
*.iml
7+
.vscode
8+
9+
# This project
10+
node_modules/
11+
dist/
12+
yarn-error.log
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
dist/
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Cortex Confluence Plugin
2+
3+
This plugin makes it possible to view Confluence assets alongside related entities in the service catalog, such as in this screenshot:
4+
5+
![Cortex Confluence Plugin Screenshot](images/confluence-plugin-screenshot.png)
6+
7+
This is a [Cortex](https://www.cortex.io/) plugin. To see how to run the plugin inside of Cortex, see [our docs](https://docs.cortex.io/docs/plugins).
8+
9+
### Prerequisites
10+
11+
The URL of your Confluence instance should be configured in `src/components/PageContent.tsx`. To do so, change the following line to match the URL of your server:
12+
13+
```
14+
const baseConfluenceUrl = "https://confluence-server.atlassian.net";
15+
```
16+
17+
Developing and building this plugin requires either [yarn](https://classic.yarnpkg.com/lang/en/docs/install/) or [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
18+
19+
## Getting started
20+
21+
1. Modify the `src/components/PageContent.tsx` file as described above
22+
2. Run `yarn` to download all dependencies
23+
3. Run `yarn build` to compile the plugin code into `./dist/ui.html`
24+
4. Upload `ui.html` into Cortex on a create or edit plugin page
25+
5. Add or update the code and repeat steps 2-3 as necessary
26+
27+
## Adding Confluence Content
28+
29+
Entities can be associated with Confluence Page IDs by adding a PageID tag to the `x-cortex-confluence` object. In the Entity yaml for the entity to the Page ID that you'd like to view inside of Cortex, such as:
30+
31+
```
32+
x-cortex-confluence:
33+
pageID: "123456"
34+
```
35+
36+
You can do this for Custom Entities, as well as any Service entity.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = "test-file-stub";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
plugins: ["@babel/plugin-syntax-jsx"],
3+
presets: [
4+
["@babel/preset-env", { targets: { node: "current" } }],
5+
"@babel/preset-typescript",
6+
["@babel/preset-react", { runtime: "automatic" }],
7+
],
8+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
openapi: 3.0.1
2+
info:
3+
title: Plugins Confluence Plugin
4+
description: ""
5+
x-cortex-tag: plugins-confluence-plugin
6+
x-cortex-git:
7+
github:
8+
repository: cortexapps/cortex-plugins
9+
basepath: plugins/confluence-plugin
10+
x-cortex-custom-metadata:
11+
cortex-template-version: 0.1.0
12+
cortex-generated-timestamp: 2024-01-25T14:45:14.646626276

0 commit comments

Comments
 (0)