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

[MI-3173] Setup webapp to the plugin #4

Merged
merged 16 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ ifneq ($(HAS_SERVER),)
endif

## Ensures NPM dependencies are installed without having to run this all the time.
.PHONY: webapp/.npminstall
webapp/.npminstall:
ifneq ($(HAS_WEBAPP),)
cd webapp && $(NPM) install
cd webapp && $(NPM) install --legacy-peer-deps
Kshitij-Katiyar marked this conversation as resolved.
Show resolved Hide resolved
touch $@
endif

Expand Down
4 changes: 2 additions & 2 deletions build/manifest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ func applyManifest(manifest *model.Manifest) error {

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

Expand Down
12 changes: 11 additions & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@
"windows-amd64": "server/dist/plugin-windows-amd64.exe"
}
},
"webapp": {
"bundle_path": "webapp/dist/main.js"
},
"settings_schema": {
"header": "Configure this plugin directly in the config.json file. Learn more [in our documentation](https://github.com/mattermost/mattermost-plugin-welcomebot/blob/master/README.md).\n\n To report an issue, make a suggestion, or submit a contribution, [check the plugin repository](https://github.com/mattermost/mattermost-plugin-welcomebot)."
"header": "Configure this plugin directly in the config.json file. Learn more [in our documentation](https://github.com/mattermost/mattermost-plugin-welcomebot/blob/master/README.md).\n\n To report an issue, make a suggestion, or submit a contribution, [check the plugin repository](https://github.com/mattermost/mattermost-plugin-welcomebot).",
"settings": [
{
"key": "WelcomeMessages",
"type": "custom",
"default": []
}
]
}
}
2 changes: 1 addition & 1 deletion server/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type ConfigMessage struct {

// Configuration from config.json
type Configuration struct {
WelcomeMessages []*ConfigMessage
WelcomeMessages []*ConfigMessage `json:"WelcomeMessages"`
}

// List of the welcome messages from the configuration
Expand Down
Loading