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

Iconbtn colors #2362

Merged
merged 10 commits into from
Aug 8, 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
10 changes: 5 additions & 5 deletions bundles/admin/admin-layeranalytics/LayerAnalyticsList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { Fragment, useRef } from 'react';
import PropTypes from 'prop-types';
import { Table, getSorterFor } from 'oskari-ui/components/Table';
import { Message, Space, Spin, Tooltip, TextInput, Select, Option, Button } from 'oskari-ui';
import { DeleteButton, SecondaryButton } from 'oskari-ui/components/buttons';
import { EditOutlined, SearchOutlined } from '@ant-design/icons';
import { DeleteButton, SecondaryButton, IconButton } from 'oskari-ui/components/buttons';
import { SearchOutlined } from '@ant-design/icons';
import styled from 'styled-components';
import { ThemeConsumer } from 'oskari-ui/util';

Expand Down Expand Up @@ -204,9 +204,9 @@ export const LayerAnalyticsList = ThemeConsumer(({ theme, analyticsData, isLoadi
<React.Fragment>
<TitleArea>
<Space>
<Tooltip title={ <Message messageKey='flyout.editLayerTooltip' /> }>
<EditOutlined onClick={ () => layerEditorCallback(item.id) } />
</Tooltip>
<IconButton type='edit'
title={ <Message messageKey='flyout.editLayerTooltip' /> }
onClick={ () => layerEditorCallback(item.id) } />
<DeleteButton
type='icon'
title={<Message messageKey='flyout.removeAllDataForLayer' />}
Expand Down
21 changes: 12 additions & 9 deletions bundles/framework/announcements/view/flyout/CollapseTools.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { DeleteButton } from 'oskari-ui/components/buttons';
import { Tooltip, Message } from 'oskari-ui';
import { EditOutlined, EyeOutlined } from '@ant-design/icons';
import { DeleteButton, IconButton } from 'oskari-ui/components/buttons';
import { Message } from 'oskari-ui';
import { EyeOutlined } from '@ant-design/icons';

const ToolRow = styled.div`
margin-left: 10px;
Expand All @@ -22,14 +22,17 @@ export const CollapseTools = ({ announcementId, toolController }) => {
return (
<ToolRow onClick={(event) => event.stopPropagation()}>
<StyledTool>
<Tooltip title={<Message messageKey={'tools.preview'}/>}>
<EyeOutlined className='t_button-preview' onClick = { () => toolController.preview(announcementId) }/>
</Tooltip>
<IconButton
className='t_preview'
icon={<EyeOutlined/>}
title={<Message messageKey={'tools.preview'}/>}
onClick = { () => toolController.preview(announcementId) }/>
</StyledTool>
<StyledTool>
<Tooltip title={<Message messageKey={'tools.edit'}/>}>
<EditOutlined className='t_button-edit' onClick = { () => toolController.showEditPopup(announcementId) }/>
</Tooltip>
<IconButton
type='edit'
title={<Message messageKey={'tools.edit'}/>}
onClick = { () => toolController.showEditPopup(announcementId) }/>
</StyledTool>
<StyledTool>
<DeleteButton
Expand Down
6 changes: 2 additions & 4 deletions bundles/framework/myplaces3/MyPlacesLayerControls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import { SecondaryButton, ButtonContainer, DeleteButton, IconButton } from 'oska
import { PlusCircleOutlined, ExportOutlined } from '@ant-design/icons';
import { green } from '@ant-design/colors';

const AddIcon = styled(PlusCircleOutlined)`
color: ${green.primary}
`;
const StyledControls = styled('div')`
display: flex;
width: 100%;
Expand Down Expand Up @@ -122,7 +119,8 @@ export const MyPlacesLayerControls = (props) => {
<StyledActions className='t_layer'>
<IconButton
bordered={true}
icon={<AddIcon />}
icon={<PlusCircleOutlined />}
color={green.primary}
title={<Message messageKey='tab.addCategory' />}
className='t_add'
onClick={() => controller.openLayerDialog()}
Expand Down
5 changes: 4 additions & 1 deletion bundles/framework/oskariui/resources/locale/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ Oskari.registerLocalization({
search: 'Search',
reset: 'Reset',
copy: 'Copy to clipboard',
clear: 'Clear'
clear: 'Clear',
accept: 'Accept',
reject: 'Reject',
info: 'Show more information'
},
messages: {
confirm: 'Are you sure you want to continue?',
Expand Down
5 changes: 4 additions & 1 deletion bundles/framework/oskariui/resources/locale/fi.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ Oskari.registerLocalization({
search: 'Etsi',
reset: 'Tyhjennä',
copy: 'Kopioi leikepöydälle',
clear: 'Tyhjennä'
clear: 'Tyhjennä',
accept: 'Hyväksy',
reject: 'Hylkää',
info: 'Näytä lisätietoa'
},
messages: {
confirm: 'Haluatko varmasti jatkaa?',
Expand Down
10 changes: 9 additions & 1 deletion bundles/framework/oskariui/resources/locale/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ Oskari.registerLocalization({
yes: 'Oui',
no: 'Non',
next: 'Suivant',
previous: 'Précédent'
previous: 'Précédent',
print: 'Imprimer',
search: 'Recherche',
reset: 'Effacer',
copy: 'Copier dans le presse-papier',
clear: 'Effacer',
accept: 'Accepter',
reject: 'Refuser',
info: 'Afficher plus d\'informations'
},
table: {
sort: {
Expand Down
10 changes: 9 additions & 1 deletion bundles/framework/oskariui/resources/locale/is.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ Oskari.registerLocalization({
yes: 'Já',
no: 'Nei',
next: 'Næst',
previous: 'Fyrri'
previous: 'Fyrri',
print: 'Prenta',
search: 'Leita',
reset: 'Hreinsa',
copy: 'Afrita á klemmuspjald',
clear: 'Hreinsa',
accept: 'Samþykkja',
reject: 'Hafna',
info: 'Sýna frekari upplýsingar'
},
messages: {
confirmDelete: 'Viss um að eyða?'
Expand Down
10 changes: 9 additions & 1 deletion bundles/framework/oskariui/resources/locale/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ Oskari.registerLocalization({
yes: 'Да',
no: 'Нет',
next: 'Следующий',
previous: 'Предыдущий'
previous: 'Предыдущий',
print: 'Распечатать',
search: 'Поиск',
reset: 'Очистить',
copy: 'Скопировать в буфер обмена',
clear: 'Очистить',
accept: 'Принять',
reject: 'Отклонить',
info: 'Показать больше информации'
},
table: {
sort: {
Expand Down
5 changes: 4 additions & 1 deletion bundles/framework/oskariui/resources/locale/sv.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ Oskari.registerLocalization({
search: 'Sök',
reset: 'Återställa',
copy: 'Kopiera till klippbordet',
clear: 'Rensa'
clear: 'Rensa',
accept: 'Acceptera',
reject: 'Avvisa',
info: 'Visa mera information'
},
messages: {
confirm: 'Är du säker på att du vill fortsätta?',
Expand Down
30 changes: 14 additions & 16 deletions src/react/components/buttons/DeleteButton.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { Message, Confirm, Button,Tooltip } from 'oskari-ui';
import { IconButton } from 'oskari-ui/components/buttons';
import { SecondaryButton } from './';
import { DeleteIcon } from '../icons'
import { Message, Confirm, Tooltip } from 'oskari-ui';
import { SecondaryButton, IconButton } from './';

const StyledButton = styled(Button)`
font-size: 16px;
pointer-events: ${props => props.disabled ? 'none' : 'auto'};
`;
/**
* This + pointer-events style on button components are used to fix tooltip
* not disappearing if the button is disabled. Probably caused by styled-components + antd problem.
Expand All @@ -21,16 +15,22 @@ const DisabledWrapper = styled('div')`
const getButton = (type, disabled) => {
const props = {
className: 't_button t_delete',
disabled
}
disabled,
type: 'delete',
title: null
};
if (type === 'icon') {
return <IconButton icon={<DeleteIcon/>} {...props}/>;
return <IconButton {...props}/>;
}
if (type === 'button') {
return <StyledButton {...props}><DeleteIcon/></StyledButton>;
return <IconButton bordered {...props}/>;
}
if (type === 'label') {
return <SecondaryButton {...props} danger type="delete"/>;
return (
<DisabledWrapper>
<SecondaryButton danger {...props}/>;
</DisabledWrapper>
);
}
};

Expand All @@ -55,9 +55,7 @@ export const DeleteButton = ({
okType='danger'
placement={placement}>
<Tooltip title={tooltip}>
<DisabledWrapper $disabled={disabled}>
{getButton(type, disabled)}
</DisabledWrapper>
{getButton(type, disabled)}
</Tooltip>
</Confirm>
);
Expand Down
Loading