diff --git a/webapp/package-lock.json b/webapp/package-lock.json index 319b38942..2a2a0daf7 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -5,7 +5,6 @@ "packages": { "": { "dependencies": { - "@reduxjs/toolkit": "1.9.5", "core-js": "3.6.5", "js-cookie": "3.0.5", "mattermost-redux": "5.27.0", @@ -3124,37 +3123,6 @@ "react-native": ">=0.59" } }, - "node_modules/@reduxjs/toolkit": { - "version": "1.9.5", - "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-1.9.5.tgz", - "integrity": "sha512-Rt97jHmfTeaxL4swLRNPD/zV4OxTes4la07Xc4hetpUW/vc75t5m1ANyxG6ymnEQ2FsLQsoMlYB2vV1sO3m8tQ==", - "dependencies": { - "immer": "^9.0.21", - "redux": "^4.2.1", - "redux-thunk": "^2.4.2", - "reselect": "^4.1.8" - }, - "peerDependencies": { - "react": "^16.9.0 || ^17.0.0 || ^18", - "react-redux": "^7.2.1 || ^8.0.2" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-redux": { - "optional": true - } - } - }, - "node_modules/@reduxjs/toolkit/node_modules/redux": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", - "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", - "dependencies": { - "@babel/runtime": "^7.9.2" - } - }, "node_modules/@restart/hooks": { "version": "0.4.9", "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.4.9.tgz", @@ -9045,15 +9013,6 @@ "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", "dev": true }, - "node_modules/immer": { - "version": "9.0.21", - "resolved": "https://registry.npmjs.org/immer/-/immer-9.0.21.tgz", - "integrity": "sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/immer" - } - }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -15934,14 +15893,6 @@ "node-localstorage": "^1.3.0" } }, - "node_modules/redux-thunk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.4.2.tgz", - "integrity": "sha512-+P3TjtnP0k/FEjcBL5FZpoovtvrTNT/UXd4/sluaSyrURlSlhLSzEdfsTBW7WsKB6yPvgd7q/iZPICFjW4o57Q==", - "peerDependencies": { - "redux": "^4" - } - }, "node_modules/reflect.ownkeys": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz", @@ -16232,11 +16183,6 @@ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, - "node_modules/reselect": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/reselect/-/reselect-4.1.8.tgz", - "integrity": "sha512-ab9EmR80F/zQTMNeneUr4cv+jSwPJgIlvEmVwLerwrWVbpLlBuls9XHzIeTFy4cegU2NHBp3va0LKOzU5qFEYQ==" - }, "node_modules/resolve": { "version": "1.22.2", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", diff --git a/webapp/package.json b/webapp/package.json index 7f69f2a23..b4ec038dd 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -61,7 +61,6 @@ "webpack-cli": "3.3.12" }, "dependencies": { - "@reduxjs/toolkit": "1.9.5", "core-js": "3.6.5", "js-cookie": "3.0.5", "mattermost-redux": "5.27.0", diff --git a/webapp/src/api/api_wrapper.ts b/webapp/src/api/api_wrapper.ts index 5c3ba7a91..c989a7b6a 100644 --- a/webapp/src/api/api_wrapper.ts +++ b/webapp/src/api/api_wrapper.ts @@ -2,19 +2,23 @@ import Utils from 'utils'; export const fetchChannels = async (mmSiteUrl: string) => { const url = Utils.getBaseUrls(mmSiteUrl).mattermostApiBaseUrl + '/channels?exclude_default_channels=true'; + const response = await fetch(url, { method: 'GET', headers: {Authentication: Utils.getAuthToken()}, }); + return response.json(); }; export const fetchTeams = async (mmSiteUrl: string) => { const url = Utils.getBaseUrls(mmSiteUrl).mattermostApiBaseUrl + '/teams'; + const response = await fetch(url, { method: 'GET', headers: {Authentication: Utils.getAuthToken()}, }); + return response.json(); }; diff --git a/webapp/src/components/modals/configModal.tsx b/webapp/src/components/modals/configModal.tsx index 30f859ac1..badb8cd0b 100644 --- a/webapp/src/components/modals/configModal.tsx +++ b/webapp/src/components/modals/configModal.tsx @@ -15,7 +15,7 @@ import {GlobalState} from 'mattermost-redux/types/store'; import {fetchChannels, fetchTeams} from 'api/api_wrapper'; -import {DeleteSvg, EditSvg} from '../svgIcons/svg'; +import {DeleteIcon, EditIcon} from '../svgIcons/svg'; import './styles.scss'; @@ -585,7 +585,7 @@ const ConfigModal = ({visibility, setVisibility, configIndex, config, onChange, overlay={{'Edit action'}} > {'Delete action'}} > diff --git a/webapp/src/components/modals/styles.scss b/webapp/src/components/modals/styles.scss index 766a97c7a..98186b59d 100644 --- a/webapp/src/components/modals/styles.scss +++ b/webapp/src/components/modals/styles.scss @@ -32,10 +32,12 @@ .modal-header { display: flex; } + .modal-body { display: flex; flex-direction: column; } + width: 615px; max-width: 615px; } @@ -58,14 +60,17 @@ .btn-group { display: flex; justify-content: space-between; + .btn.btn-default { background: none; border-color: transparent; border: transparent; + &:hover { background: transparent; color: #000000; } + &:focus { background: transparent; color: #000000; @@ -89,7 +94,7 @@ } .radio-form { - margin-bottom: 0px; + margin-bottom: 0; } .add-actions { @@ -122,6 +127,7 @@ .warning { margin-bottom: 27px; color: #000000; + .form-group { position: relative; } @@ -138,6 +144,7 @@ .warnings { margin-bottom: 25px; + .form-group { position: relative; } @@ -231,6 +238,7 @@ } } } + thead { tr { th { @@ -241,27 +249,33 @@ } } } + border: 1px solid #dddddd; vertical-align: middle; width: 100%; } + td { text-align: center; vertical-align: middle; } + th { text-align: center; vertical-align: bottom; } + width: 100%; margin-top: 0; margin-bottom: 0; table-layout: fixed; + tr { display: flex; width: 100%; } } + th { text-align: center; } diff --git a/webapp/src/components/svgIcons/svg.tsx b/webapp/src/components/svgIcons/svg.tsx index 15626e932..a9623eb24 100644 --- a/webapp/src/components/svgIcons/svg.tsx +++ b/webapp/src/components/svgIcons/svg.tsx @@ -1,6 +1,6 @@ import React from 'react'; -const EditSvg = () => ( +const EditIcon = () => ( ( ); -const DeleteSvg = () => ( +const DeleteIcon = () => ( ( ); -const ViewSvg = () => ( +const ViewIcon = () => ( ( ); -export {EditSvg, DeleteSvg, ViewSvg}; +export {EditIcon, DeleteIcon, ViewIcon}; diff --git a/webapp/src/components/tables/existingConfigTable.tsx b/webapp/src/components/tables/existingConfigTable.tsx index 99e0fcc3d..24fb6599e 100644 --- a/webapp/src/components/tables/existingConfigTable.tsx +++ b/webapp/src/components/tables/existingConfigTable.tsx @@ -6,7 +6,7 @@ import ActionModal from '../modals/actionModal'; import DeleteModal from '../modals/deleteModal'; import ConfigModal from '../modals/configModal'; -import {DeleteSvg, EditSvg, ViewSvg} from '../svgIcons/svg'; +import {DeleteIcon, EditIcon, ViewIcon} from '../svgIcons/svg'; import './styles.scss'; @@ -80,6 +80,7 @@ const ExistingConfigTable = ({value, onChange}: Props) => { modalHeader='Add Config' /> } +
{'Existing Configs'} @@ -137,7 +138,7 @@ const ExistingConfigTable = ({value, onChange}: Props) => { className='svg-buttons' onClick={() => handleView(i)} > - + { className='svg-buttons' onClick={() => handleEdit(i)} > - + { className='svg-buttons' onClick={() => handleDelete(i)} > - + diff --git a/webapp/src/components/tables/styles.scss b/webapp/src/components/tables/styles.scss index ef7d19bfb..6842a4d43 100644 --- a/webapp/src/components/tables/styles.scss +++ b/webapp/src/components/tables/styles.scss @@ -3,6 +3,7 @@ justify-content: space-between; gap: 10px; gap: 1px; + .btn.btn-default { background: none; border-color: transparent; @@ -19,6 +20,7 @@ } } } + thead { tr { th { @@ -39,12 +41,15 @@ text-overflow: ellipsis; white-space: nowrap; } + th { text-align: center; vertical-align: bottom; } + width: 100%; table-layout: fixed; + thead { tr { th { @@ -54,6 +59,7 @@ } } } + .messageValue { text-align: left; vertical-align: middle; @@ -88,7 +94,7 @@ .config { .form-group { - margin-left: 0px; + margin-left: 0; } } @@ -143,6 +149,7 @@ outline: none; box-shadow: none; } + &:active { outline: none; box-shadow: none;