Skip to content

Commit

Permalink
fixes ui upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Elorfin committed Jul 28, 2023
1 parent d06d064 commit 1507b28
Show file tree
Hide file tree
Showing 27 changed files with 354 additions and 372 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {PropTypes as T} from 'prop-types'
import classes from 'classnames'

import {Alert} from '#/main/app/components/alert'
import {ContentHtml} from '#/main/app/content/components/html'

const ContentRestriction = props => {
let title, help
Expand All @@ -24,7 +25,7 @@ const ContentRestriction = props => {
icon={props.icon}
title={title}
>
{help}
<ContentHtml>{help}</ContentHtml>

{props.failed && props.children}
</Alert>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const SectionParameters = props =>
icon={props.icon ? `fa fa-fw fa-${props.icon}` : undefined}
title={props.title || trans('facet_section')}
subtitle={props.description}
className="embedded-form-section"
fill={true}
actions={[
{
Expand Down
29 changes: 23 additions & 6 deletions src/main/app/Resources/modules/data/components/display.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,19 @@ class DataDisplay extends Component {

renderInput() {
if (!this.state.loaded) {
return trans('loading')
return (
<div role="presentation" className="text-secondary">
{trans('loading')}
</div>
)
}

if (this.state.error) {
return trans('error')
return (
<div role="presentation" className="text-danger">
{trans('error')}
</div>
)
}

if (this.props.children) {
Expand All @@ -103,7 +111,8 @@ class DataDisplay extends Component {
merge({}, this.props.options, {
id: this.props.id,
label: this.props.label,
data: this.props.value, // todo rename into `value` in implementations later
data: this.props.value, // deprecated
value: this.props.value,
error: this.props.error,
placeholder: this.props.placeholder,
size: this.props.size
Expand All @@ -113,16 +122,24 @@ class DataDisplay extends Component {

if (!this.props.value && false !== this.props.value && 0 !== this.props.value) {
return (
<span className="text-secondary d-block">{trans('empty_value')}</span>
<div role="presentation" className="text-secondary">{trans('empty_value')}</div>
)
}

if (this.state.render) {
// type render method
return this.state.render(this.props.value, this.props.options || {})
return (
<div role="presentation">
{this.state.render(this.props.value, this.props.options || {})}
</div>
)
}

return this.props.value
return (
<div role="presentation">
{this.props.value}
</div>
)
}

render() {
Expand Down
14 changes: 11 additions & 3 deletions src/main/app/Resources/modules/data/components/input.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createElement, Component} from 'react'
import React, {createElement, Component} from 'react'
import {PropTypes as T} from 'prop-types'
import get from 'lodash/get'
import merge from 'lodash/merge'
Expand Down Expand Up @@ -97,11 +97,19 @@ class DataInput extends Component {

renderInput() {
if (!this.state.loaded) {
return trans('loading')
return (
<div role="presentation" className="text-secondary">
{trans('loading')}
</div>
)
}

if (this.state.error) {
return trans('error')
return (
<div role="presentation" className="text-danger">
{trans('error')}
</div>
)
}

if (this.props.children) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {GridSelection} from '#/main/app/content/grid/components/selection'
const SelectionModal = props =>
<Modal
{...omit(props, 'items', 'handleSelect', 'selectAction')}
size="lg"
>
<GridSelection
items={props.items}
Expand Down
4 changes: 2 additions & 2 deletions src/main/app/Resources/styles/_variables.old.scss
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ $top-bar-max-width: 100%; // max width for the top bar content (do not
$top-bar-height: 60px + $top-bar-border-bottom-size !default;

$top-bar-brand-color: $top-bar-color !default;
$top-bar-brand-secondary-color: $primary !default;
$top-bar-brand-secondary-color: color-contrast($menu, $primary, $top-bar-brand-color) !default;
$top-bar-brand-font-size: $font-size-lg !default;
$top-bar-brand-font-weight: $font-weight-medium !default;

Expand Down Expand Up @@ -217,7 +217,7 @@ $page-action-primary-color: color-contrast($primary);
$page-action-primary-bg: $primary;
$page-action-primary-border: transparent;

$page-action-default-color: $gray-dark;
$page-action-default-color: $body-color;
$page-action-default-bg: transparent;
$page-action-default-border: transparent;

Expand Down
15 changes: 0 additions & 15 deletions src/main/app/Resources/styles/data/_cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,6 @@
.btn {
padding: $data-grid-gutter;
}

.dropdown.open {
/*.btn {
position: relative;
background: $gray-lighter;
border-color: $dropdown-border;
border-bottom-color: $dropdown-bg;
box-shadow: $dropdown-menu-box-shadow;
background-clip: padding-box;
}*/
}

.dropdown-menu {
//margin-top: -1px;
}
}

// clickable variant
Expand Down
76 changes: 0 additions & 76 deletions src/main/app/Resources/styles/data/types/_choice.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,82 +2,6 @@
* Styles for `choice` data type.
*/

/*.choice-control {
.radio,
.radio-inline,
.checkbox,
.checkbox-inline {
margin: 0;
// simulate a .form-control
@include input-size('label', $input-height-base, $padding-base-vertical, $padding-base-horizontal, $font-size-base, $line-height-base, $input-border-radius);
label {
width: 100%;
border: 1px solid transparent;
background: $gray-lighter;
@include transition("border-color ease-in-out .15s, background ease-in-out .15s");
}
&.selected label {
color: $state-selected-text;
border: 1px solid $state-selected-border;
background: $state-selected-bg;
font-weight: bold;
}
&.disabled {
opacity: 0.9;
}
&:not(.disabled) {
label:hover {
background: darken($gray-lighter, 10%);
}
// todo : merge with list selected
&.selected label:hover {
color: darken($state-selected-text, 10%);
background: darken($state-selected-bg, 10%);
border-color: darken($state-selected-border, 10%);
}
}
}
.radio,
.checkbox {
label {
// reset fixed height added by .input-size() to allow long text to expand properly
min-height: $input-height-base;
height: auto;
}
}
.radio + .radio,
.checkbox + .checkbox {
margin-top: 5px;
}
// sizing variants
&.sm {
.radio,
.radio-inline,
.checkbox,
.checkbox-inline {
@include input-size('label', $input-height-small, $padding-small-vertical, $padding-small-horizontal, $font-size-sm, $line-height-small, $input-border-radius-sm);
}
}
&.lg {
.radio,
.radio-inline,
.checkbox,
.checkbox-inline {
@include input-size('label', $input-height-large, $padding-large-vertical, $padding-large-horizontal, $font-size-lg, $line-height-large, $input-border-radius-lg);
}
}
}*/

.choice-cell {
.label {
display: inline-block;
Expand Down
Loading

0 comments on commit 1507b28

Please sign in to comment.