1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-27 13:48:52 +02:00

GH-966 - Removing empty placeholders (#1008)

* GH-966 - Removing empty placeholders

* Updating test

Co-authored-by: Hossein <hahmadia@users.noreply.github.com>
This commit is contained in:
Asaad Mahmood 2021-08-19 17:54:43 +05:00 committed by GitHub
parent 2520d2fa4b
commit e8eeb51046
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 47 additions and 22 deletions

View File

@ -44,7 +44,9 @@ exports[`components/properties/dateRange returns default correctly 1`] = `
type="button" type="button"
> >
<span> <span>
Empty <span
title="Empty"
/>
</span> </span>
</button> </button>
</div> </div>

View File

@ -1,10 +1,14 @@
.DateRange { .DateRange {
width: 100%;
display: flex;
.octo-propertyvalue { .octo-propertyvalue {
white-space: none; white-space: none;
} }
.inputContainer { .inputContainer {
display: flex; display: flex;
.Editable { .Editable {
width: 50% !important; width: 50% !important;
} }
@ -17,33 +21,42 @@
min-height: 24px; min-height: 24px;
width: 100%; width: 100%;
margin: 2px; margin: 2px;
&.active { &.active {
min-width: 100px; min-width: 100px;
} }
&::placeholder { &::placeholder {
color: rgba(var(--body-color), 0.4); color: rgba(var(--body-color), 0.4);
opacity: 1; opacity: 1;
} }
&.error { &.error {
border: 1px solid var(--error-color); border: 1px solid var(--error-color);
border-radius: var(--default-rad); border-radius: var(--default-rad);
} }
} }
.Modal{ .Modal {
position: absolute; position: absolute;
top: 0px; top: 0px;
left: 0px; left: 0px;
margin-bottom: 100px; margin-bottom: 100px;
} }
.Button{ .Button {
width: 100%; width: 100%;
justify-content: left; justify-content: left;
&.--empty {
opacity: 0;
}
&:hover { &:hover {
background-color: transparent; background-color: transparent;
} }
} }
.menu-option { .menu-option {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@ -60,42 +73,41 @@
background: rgba(var(--button-bg-rgb), 0.08); background: rgba(var(--button-bg-rgb), 0.08);
} }
> * { >* {
margin-left: 6px; margin-left: 6px;
} }
> *:first-child { >*:first-child {
margin-left: 0; margin-left: 0;
} }
> .menu-name { >.menu-name {
display: flex; display: flex;
flex-grow: 1; flex-grow: 1;
white-space: nowrap; white-space: nowrap;
} }
> .SubmenuTriangleIcon { >.SubmenuTriangleIcon {
fill: rgba(var(--body-color), 0.7); fill: rgba(var(--body-color), 0.7);
} }
> .Icon { >.Icon {
opacity: 0.56; opacity: 0.56;
width: 16px; width: 16px;
height: 16px; height: 16px;
line-height: 16px; line-height: 16px;
} }
> .IconButton .Icon { >.IconButton .Icon {
margin-right: 0; margin-right: 0;
} }
} }
.DayPicker { .DayPicker {}
}
.DayPickerInput-Overlay { .DayPickerInput-Overlay {
background-color: rgba(var(--center-channel-bg-rgb)); background-color: rgba(var(--center-channel-bg-rgb));
box-shadow: 0 0 0 1px hsla(0, 0%, 0%, 0.1),0 4px 11px hsla(0, 0%, 0%, 0.1); box-shadow: 0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1);
line-height: 100%; line-height: 100%;
} }
@ -105,51 +117,62 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.DayPicker-Body { .DayPicker-Body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.DayPicker-WeekdaysRow { .DayPicker-WeekdaysRow {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
} }
.DayPicker-Weekday { .DayPicker-Weekday {
display: block; display: block;
width: 36px; width: 36px;
height: 36px; height: 36px;
} }
.DayPicker-Week { .DayPicker-Week {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
} }
.DayPicker-Day { .DayPicker-Day {
border-radius: unset; border-radius: unset;
display: block; display: block;
width: 36px; width: 36px;
height: 36px; height: 36px;
} }
.DayPicker-Day--today { .DayPicker-Day--today {
color: #c74655; color: #c74655;
} }
.DayPicker-Day--start { .DayPicker-Day--start {
border-top-left-radius: 50% !important; border-top-left-radius: 50% !important;
border-bottom-left-radius: 50% !important; border-bottom-left-radius: 50% !important;
} }
.DayPicker-Day--end { .DayPicker-Day--end {
border-top-right-radius: 50% !important; border-top-right-radius: 50% !important;
border-bottom-right-radius: 50% !important; border-bottom-right-radius: 50% !important;
} }
.DayPicker-Day--selected:not(.DayPicker-Day--disabled):not(.DayPicker-Day--outside) { .DayPicker-Day--selected:not(.DayPicker-Day--disabled):not(.DayPicker-Day--outside) {
background-color: rgb(var(--button-bg-rgb));; background-color: rgb(var(--button-bg-rgb));
;
color: rgba(var(--button-color-rgb), 0.5); color: rgba(var(--button-color-rgb), 0.5);
} }
.DayPicker-Day--selected:not(.DayPicker-Day--start):not(.DayPicker-Day--end):not(.DayPicker-Day--outside) { .DayPicker-Day--selected:not(.DayPicker-Day--start):not(.DayPicker-Day--end):not(.DayPicker-Day--outside) {
color: rgb(var(--button-bg-rgb));; color: rgb(var(--button-bg-rgb));
;
background-color: rgba(var(--button-bg-rgb), 0.2); background-color: rgba(var(--button-bg-rgb), 0.2);
} }
.DayPicker:not(.DayPicker--interactionDisabled) .DayPicker:not(.DayPicker--interactionDisabled) .DayPicker-Day:not(.DayPicker-Day--disabled):not(.DayPicker-Day--selected):not(.DayPicker-Day--outside):hover {
.DayPicker-Day:not(.DayPicker-Day--disabled):not(.DayPicker-Day--selected):not(.DayPicker-Day--outside):hover {
background-color: rgba(var(--body-color), 0.2); background-color: rgba(var(--body-color), 0.2);
} }
} }

View File

@ -68,7 +68,7 @@ describe('components/properties/dateRange', () => {
const fifteenth = Date.UTC(date.getFullYear(), date.getMonth(), 15, 12) const fifteenth = Date.UTC(date.getFullYear(), date.getMonth(), 15, 12)
const {getByText, getByTitle} = render(component) const {getByText, getByTitle} = render(component)
const dayDisplay = getByText('Empty') const dayDisplay = getByTitle('Empty')
userEvent.click(dayDisplay) userEvent.click(dayDisplay)
const day = getByText('15') const day = getByText('15')
@ -92,7 +92,7 @@ describe('components/properties/dateRange', () => {
// open modal // open modal
const {getByText, getByTitle} = render(component) const {getByText, getByTitle} = render(component)
const dayDisplay = getByText('Empty') const dayDisplay = getByTitle('Empty')
userEvent.click(dayDisplay) userEvent.click(dayDisplay)
// select start date // select start date

View File

@ -156,7 +156,7 @@ function DateRange(props: Props): JSX.Element {
<Button <Button
onClick={() => setShowDialog(true)} onClick={() => setShowDialog(true)}
> >
{displayValue || intl.formatMessage({id: 'DateRange.empty', defaultMessage: 'Empty'})} {displayValue || <span title={intl.formatMessage({id: 'DateRange.empty', defaultMessage: 'Empty'})}/>}
</Button> </Button>
{showDialog && {showDialog &&

View File

@ -36,7 +36,7 @@ const URLProperty = (props: Props): JSX.Element => {
<div className='URLProperty property-link url'> <div className='URLProperty property-link url'>
<Editable <Editable
className='octo-propertyvalue' className='octo-propertyvalue'
placeholderText='Empty' placeholderText=''
value={props.value} value={props.value}
onChange={props.onChange} onChange={props.onChange}
onSave={props.onSave} onSave={props.onSave}

View File

@ -259,7 +259,7 @@ const PropertyValueElement = (props:Props): JSX.Element => {
return ( return (
<Editable <Editable
className='octo-propertyvalue' className='octo-propertyvalue'
placeholderText='Empty' placeholderText=''
value={value as string} value={value as string}
onChange={setValue} onChange={setValue}
onSave={saveTextProperty} onSave={saveTextProperty}