Skip to content

Commit

Permalink
[MM-108]
Browse files Browse the repository at this point in the history
Changed the name of svg icons
Added padding to different css
removing unused dependancy
  • Loading branch information
Kshitij-Katiyar committed Sep 14, 2023
1 parent 369219f commit ee44476
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 68 deletions.
54 changes: 0 additions & 54 deletions webapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions webapp/src/api/api_wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};

6 changes: 3 additions & 3 deletions webapp/src/components/modals/configModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -585,15 +585,15 @@ const ConfigModal = ({visibility, setVisibility, configIndex, config, onChange,
overlay={<Tooltip>{'Edit action'}</Tooltip>}
>
<Button onClick={() => handleEditAction(i)}>
<EditSvg/>
<EditIcon/>
</Button>
</OverlayTrigger>
<OverlayTrigger
placement='top'
overlay={<Tooltip>{'Delete action'}</Tooltip>}
>
<Button onClick={() => handleActionDelete(i, val.actionName)}>
<DeleteSvg/>
<DeleteIcon/>
</Button>
</OverlayTrigger>
</ButtonGroup>
Expand Down
16 changes: 15 additions & 1 deletion webapp/src/components/modals/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@
.modal-header {
display: flex;
}

.modal-body {
display: flex;
flex-direction: column;
}

width: 615px;
max-width: 615px;
}
Expand All @@ -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;
Expand All @@ -89,7 +94,7 @@
}

.radio-form {
margin-bottom: 0px;
margin-bottom: 0;
}

.add-actions {
Expand Down Expand Up @@ -122,6 +127,7 @@
.warning {
margin-bottom: 27px;
color: #000000;

.form-group {
position: relative;
}
Expand All @@ -138,6 +144,7 @@

.warnings {
margin-bottom: 25px;

.form-group {
position: relative;
}
Expand Down Expand Up @@ -231,6 +238,7 @@
}
}
}

thead {
tr {
th {
Expand All @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions webapp/src/components/svgIcons/svg.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

const EditSvg = () => (
const EditIcon = () => (
<svg
className='svg'
xmlns='http://www.w3.org/2000/svg'
Expand All @@ -18,7 +18,7 @@ const EditSvg = () => (
</svg>
);

const DeleteSvg = () => (
const DeleteIcon = () => (
<svg
className='svg'
xmlns='http://www.w3.org/2000/svg'
Expand Down Expand Up @@ -48,7 +48,7 @@ const DeleteSvg = () => (
</svg>
);

const ViewSvg = () => (
const ViewIcon = () => (
<svg
xmlns='http://www.w3.org/2000/svg'
width='16'
Expand All @@ -69,4 +69,4 @@ const ViewSvg = () => (
</svg>
);

export {EditSvg, DeleteSvg, ViewSvg};
export {EditIcon, DeleteIcon, ViewIcon};
9 changes: 5 additions & 4 deletions webapp/src/components/tables/existingConfigTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -80,6 +80,7 @@ const ExistingConfigTable = ({value, onChange}: Props) => {
modalHeader='Add Config'
/>
}

<FormGroup>
<div className='name'>
{'Existing Configs'}
Expand Down Expand Up @@ -137,7 +138,7 @@ const ExistingConfigTable = ({value, onChange}: Props) => {
className='svg-buttons'
onClick={() => handleView(i)}
>
<ViewSvg/>
<ViewIcon/>
</Button>
</OverlayTrigger>
<OverlayTrigger
Expand All @@ -148,7 +149,7 @@ const ExistingConfigTable = ({value, onChange}: Props) => {
className='svg-buttons'
onClick={() => handleEdit(i)}
>
<EditSvg/>
<EditIcon/>
</Button>
</OverlayTrigger>
<OverlayTrigger
Expand All @@ -159,7 +160,7 @@ const ExistingConfigTable = ({value, onChange}: Props) => {
className='svg-buttons'
onClick={() => handleDelete(i)}
>
<DeleteSvg/>
<DeleteIcon/>
</Button>
</OverlayTrigger>
</ButtonGroup>
Expand Down
9 changes: 8 additions & 1 deletion webapp/src/components/tables/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
justify-content: space-between;
gap: 10px;
gap: 1px;

.btn.btn-default {
background: none;
border-color: transparent;
Expand All @@ -19,6 +20,7 @@
}
}
}

thead {
tr {
th {
Expand All @@ -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 {
Expand All @@ -54,6 +59,7 @@
}
}
}

.messageValue {
text-align: left;
vertical-align: middle;
Expand Down Expand Up @@ -88,7 +94,7 @@

.config {
.form-group {
margin-left: 0px;
margin-left: 0;
}
}

Expand Down Expand Up @@ -143,6 +149,7 @@
outline: none;
box-shadow: none;
}

&:active {
outline: none;
box-shadow: none;
Expand Down

0 comments on commit ee44476

Please sign in to comment.