Skip to content

Commit

Permalink
MM-16368 - Plugin Signing (mattermost#4145)
Browse files Browse the repository at this point in the history
* MM-18797 - Switch webapp to use '/plugins/marketplace' API to install… (mattermost#3871)

* MM-18797 - Switch webapp to use '/plugins/marketplace' API to install marketplace plugins

* Updated tests

* Removing ui marketplace install event

* Revert "Removing ui marketplace install event"

This reverts commit 5419ce0.

* Updating redux dependency

* MM-19844 - Disallow plugin upload when PluginSettings.RequirePl… (mattermost#4109)

* MM-19844 - Disallow plugin upload when PluginSettings.RequirePluginSignature is true

* Fixed text

* Fixed snapshot

* Fixing snapshot

* Bumping redux ver

* temp redux commit

* update snapshots re: i18n

* Bumping redux ver
  • Loading branch information
alifarooq0 authored and lieut-data committed Nov 19, 2019
1 parent e62bfd3 commit bcd672b
Show file tree
Hide file tree
Showing 9 changed files with 762 additions and 31 deletions.
9 changes: 4 additions & 5 deletions actions/marketplace.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// See LICENSE.txt for license information.

import {Client4} from 'mattermost-redux/client';
import {installPluginFromUrl} from 'mattermost-redux/actions/admin';

import {getFilter, getPlugin} from 'selectors/views/marketplace';
import {ActionTypes} from 'utils/constants';
Expand Down Expand Up @@ -31,7 +30,7 @@ export function fetchPlugins() {
// installPlugin installs the latest version of the given plugin from the marketplace.
//
// On success, it also requests the current state of the plugins to reflect the newly installed plugin.
export function installPlugin(id) {
export function installPlugin(id, version) {
return async (dispatch, getState) => {
dispatch({
type: ActionTypes.INSTALLING_MARKETPLACE_PLUGIN,
Expand All @@ -50,9 +49,9 @@ export function installPlugin(id) {
return;
}

const downloadUrl = marketplacePlugin.download_url;
const {error} = await dispatch(installPluginFromUrl(downloadUrl, true));
if (error) {
try {
await Client4.installMarketplacePlugin(id, version);
} catch (error) {
dispatch({
type: ActionTypes.INSTALLING_MARKETPLACE_PLUGIN_FAILED,
id,
Expand Down
Loading

0 comments on commit bcd672b

Please sign in to comment.