Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mattermost/mattermost-plugin-jira…
Browse files Browse the repository at this point in the history
… into GH-558
  • Loading branch information
Kshitij-Katiyar committed Sep 25, 2023
2 parents 3d8cdb1 + 17e8a47 commit b9979fb
Show file tree
Hide file tree
Showing 113 changed files with 30,652 additions and 6,167 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.21.1
16.13.1
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ export GO111MODULE=on
# You can include assets this directory into the bundle. This can be e.g. used to include profile pictures.
ASSETS_DIR ?= assets

## Define the default target (make all)
.PHONY: default
default: all

# Verify environment, and define PLUGIN_ID, PLUGIN_VERSION, HAS_SERVER and HAS_WEBAPP as needed.
include build/setup.mk
include build/legacy.mk

BUNDLE_NAME ?= $(PLUGIN_ID)-$(PLUGIN_VERSION).tar.gz

Expand All @@ -33,11 +38,6 @@ endif
## Checks the code style, tests, builds and bundles the plugin.
all: check-style test dist

## Propagates plugin manifest information into the server/ and webapp/ folders as required.
.PHONY: apply
apply:
./build/bin/manifest apply

## Runs golangci-lint and eslint.
.PHONY: check-style
check-style: webapp/.npminstall golangci-lint
Expand Down Expand Up @@ -81,7 +81,6 @@ endif
## Ensures NPM dependencies are installed without having to run this all the time.
webapp/.npminstall:
ifneq ($(HAS_WEBAPP),)
git config --global url."ssh://git@".insteadOf git://
cd webapp && $(NPM) install
touch $@
endif
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
23 changes: 22 additions & 1 deletion assets/templates/oauth1/complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
.btn {
-webkit-transition: all 0.15s ease;
-webkit-transition-delay: 0s;
transition-delay: 0s;
-moz-transition: all 0.15s ease;
-o-transition: all 0.15s ease;
transition: all 0.15s ease false;
Expand Down Expand Up @@ -54,6 +55,26 @@
margin-right: 4px;
}
</style>
<script>
const handleDisconnect = () => {
// Splitting the cookies string on the basis of cookie name and then popping out the first value.
const token = ('; ' + document.cookie).split('; MMCSRF=').pop().split(';')[0];

fetch("{{ .RevokeURL }}", {
method: "POST",
headers: {'X-CSRF-Token': token},
}).then(res => {
const element = document.body;
if(!res.ok) {
element.style.margin = "10px";
} else {
window.close();
}

return res.text().then(text => element.innerHTML = text);
})
}
</script>
<link rel="stylesheet" href="https://unpkg.com/@atlaskit/[email protected]/dist/bundle.css" media="all">
</head>
<body>
Expand All @@ -68,7 +89,7 @@ <h3>
<div>Mattermost account: {{ .MattermostDisplayName }}</div>
<div>Jira account: {{ .JiraDisplayName }}</div>
</div>
<a href="{{ .RevokeURL }}" class="btn btn-link">Disconnect</a>
<button onclick="handleDisconnect()" class="btn btn-link">Disconnect</button>
</div>
</body>
</html>
Expand Down
77 changes: 77 additions & 0 deletions assets/templates/oauth2/complete.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
color: rgb(23, 43, 77);
letter-spacing: -0.01em;
}

.flex-parent {
padding: 50px;
}

.btn {
-webkit-transition: all 0.15s ease;
-webkit-transition-delay: 0s;
transition-delay: 0s;
-moz-transition: all 0.15s ease;
-o-transition: all 0.15s ease;
transition: all 0.15s ease false;
padding-right: 0 1em;
font-size: inherit;
border: none;
height: 2.4em;
border-radius: 4px;
cursor: pointer;
}

.btn-primary {
color: rgb(255, 255, 255);
background: rgb(0, 82, 204);
}

.btn-primary:hover,
.btn-primary:active {
background: rgb(0, 101, 255);
}

.btn-link {
color: rgb(80, 95, 121);
background: rgb(244, 245, 247);
padding: 10px;
}

.btn-link:hover,
.btn-link:active {
background: rgb(235, 236, 240);
}

.accounts-container {
padding: 1.6em 0 0.8em;
opacity: .6;
}
.icon--check {
margin-right: 4px;
}
</style>
<link rel="stylesheet" href="https://unpkg.com/@atlaskit/[email protected]/dist/bundle.css" media="all">
</head>
<body>
<div class="flex-parent">
<h3>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="15" class="icon--check" viewBox="0 0 18 14">
<path fill="#0052CC" d="M100.649576,76.1740942 C100.649576,76.4531124 100.537969,76.7321306 100.337075,76.9330237 L90.7388497,86.5312494 C90.5379566,86.7321425 90.2589384,86.8437498 89.9799202,86.8437498 C89.700902,86.8437498 89.4218838,86.7321425 89.2209908,86.5312494 L83.6629484,80.9732071 C83.4620553,80.772314 83.350448,80.4932958 83.350448,80.2142776 C83.350448,79.9352594 83.4620553,79.6562412 83.6629484,79.4553481 L85.1808074,77.9374892 C85.3817005,77.7365961 85.6607186,77.6249888 85.9397368,77.6249888 C86.218755,77.6249888 86.4977732,77.7365961 86.6986663,77.9374892 L89.9799202,81.2299038 L97.3013575,73.8973058 C97.5022506,73.6964127 97.7812688,73.5848054 98.060287,73.5848054 C98.3393052,73.5848054 98.6183234,73.6964127 98.8192165,73.8973058 L100.337075,75.4151648 C100.537969,75.6160579 100.649576,75.895076 100.649576,76.1740942 Z" transform="translate(-83 -73)"/>
</svg>
Mattermost user is now connected to Jira
</h3>
<div class="accounts-container">
<div>Mattermost account: {{ .MattermostDisplayName }}</div>
<div>Jira account: {{ .JiraDisplayName }}</div>
<div>It is now safe to close this browser window.</div>
</div>
<a href="javascript:window.close();" class="btn btn-link">Close</a>
<a href="{{ .RevokeURL }}" class="btn btn-link">Disconnect</a>
</div>
</body>
</html>
File renamed without changes
13 changes: 0 additions & 13 deletions build/custom.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Include custom targets and environment variables here

.DEFAULT_GOAL := all

# If there's no MM_RUDDER_PLUGINS_PROD, add DEV data
RUDDER_WRITE_KEY = 1d5bMvdrfWClLxgK1FvV3s4U1tg
ifdef MM_RUDDER_PLUGINS_PROD
Expand All @@ -10,17 +8,6 @@ endif

LDFLAGS += -X "github.com/mattermost/mattermost-plugin-jira/server/telemetry.rudderWriteKey=$(RUDDER_WRITE_KEY)"


# Build info
BUILD_DATE = $(shell date -u)
BUILD_HASH = $(shell git rev-parse HEAD)
BUILD_HASH_SHORT = $(shell git rev-parse --short HEAD)
LDFLAGS += -X "main.BuildDate=$(BUILD_DATE)"
LDFLAGS += -X "main.BuildHash=$(BUILD_HASH)"
LDFLAGS += -X "main.BuildHashShort=$(BUILD_HASH_SHORT)"

GO_BUILD_FLAGS = -ldflags '$(LDFLAGS)'

.PHONY: jira
jira:
docker-compose up
3 changes: 3 additions & 0 deletions build/legacy.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.PHONY: apply
apply:
@echo make apply is deprecated and has no effect.
49 changes: 0 additions & 49 deletions build/manifest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,6 @@ import (
"github.com/pkg/errors"
)

const pluginIDGoFileTemplate = `// This file is automatically generated. Do not modify it manually.
package main
var manifest = struct {
ID string
Version string
}{
ID: "%s",
Version: "%s",
}
`

const pluginIDJSFileTemplate = `// This file is automatically generated. Do not modify it manually.
export const id = '%s';
export const version = '%s';
`

func main() {
if len(os.Args) <= 1 {
panic("no cmd specified")
Expand Down Expand Up @@ -56,11 +37,6 @@ func main() {
fmt.Printf("true")
}

case "apply":
if err := applyManifest(manifest); err != nil {
panic("failed to apply manifest: " + err.Error())
}

default:
panic("unrecognized command: " + cmd)
}
Expand Down Expand Up @@ -98,28 +74,3 @@ func dumpPluginID(manifest *model.Manifest) {
func dumpPluginVersion(manifest *model.Manifest) {
fmt.Printf("%s", manifest.Version)
}

// applyManifest propagates the plugin_id into the server and webapp folders, as necessary
func applyManifest(manifest *model.Manifest) error {
if manifest.HasServer() {
if err := os.WriteFile(
"server/manifest.go",
[]byte(fmt.Sprintf(pluginIDGoFileTemplate, manifest.Id, manifest.Version)),
0600,
); err != nil {
return errors.Wrap(err, "failed to write server/manifest.go")
}
}

if manifest.HasWebapp() {
if err := os.WriteFile(
"webapp/src/manifest.js",
[]byte(fmt.Sprintf(pluginIDJSFileTemplate, manifest.Id, manifest.Version)),
0600,
); err != nil {
return errors.Wrap(err, "failed to open webapp/src/manifest.js")
}
}

return nil
}
Binary file removed docs/.gitbook/assets/image (7).png
Binary file not shown.
Binary file removed docs/.gitbook/assets/image-1 (1).png
Binary file not shown.
Binary file removed docs/.gitbook/assets/image-1.png
Binary file not shown.
Binary file removed docs/.gitbook/assets/image-2 (1).png
Binary file not shown.
Binary file removed docs/.gitbook/assets/image-2.png
Binary file not shown.
Binary file removed docs/.gitbook/assets/image-3 (1).png
Binary file not shown.
Binary file removed docs/.gitbook/assets/image-3.png
Binary file not shown.
Binary file removed docs/.gitbook/assets/image-4 (1).png
Binary file not shown.
Binary file removed docs/.gitbook/assets/image-4.png
Binary file not shown.
Binary file removed docs/.gitbook/assets/image-5 (1).png
Binary file not shown.
Binary file removed docs/.gitbook/assets/image-5.png
Binary file not shown.
Binary file removed docs/.gitbook/assets/image-6 (1).png
Binary file not shown.
Binary file removed docs/.gitbook/assets/image-6.png
Binary file not shown.
Binary file removed docs/.gitbook/assets/image-7 (1).png
Binary file not shown.
Binary file removed docs/.gitbook/assets/image-7.png
Binary file not shown.
9 changes: 0 additions & 9 deletions docs/README.md

This file was deleted.

29 changes: 0 additions & 29 deletions docs/SUMMARY.md

This file was deleted.

6 changes: 0 additions & 6 deletions docs/SUMMARY2.md

This file was deleted.

27 changes: 0 additions & 27 deletions docs/administrator-guide/administrator-slash-commands.md

This file was deleted.

53 changes: 0 additions & 53 deletions docs/administrator-guide/frequently-asked-questions-faq.md

This file was deleted.

Loading

0 comments on commit b9979fb

Please sign in to comment.