Skip to content

Commit

Permalink
Rename non-wrapping to wrapping fields in record list configurator
Browse files Browse the repository at this point in the history
  • Loading branch information
Fajfa committed Oct 25, 2024
1 parent 6bf7ee3 commit b8a3e5f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 34 deletions.
16 changes: 0 additions & 16 deletions client/web/compose/src/components/ModuleFields/Viewer/String.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,5 @@ import base from './base'
export default {
extends: base,
computed: {
classes () {
const classes = []
const { fieldID } = this.field
const { textStyles = {} } = this.extraOptions
if (this.field.isMulti || this.field.options.multiLine) {
classes.push('multiline')
} else if (textStyles.noWrapFields && textStyles.noWrapFields.includes(fieldID)) {
classes.push('text-nowrap')
}
return classes
},
},
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default {
if (this.field.isMulti) {
classes.push('multiline')
} else if (textStyles.noWrapFields && textStyles.noWrapFields.includes(fieldID)) {
} else if (!textStyles.wrappedFields || !textStyles.wrappedFields.includes(fieldID)) {
classes.push('text-nowrap')
}
Expand Down
22 changes: 13 additions & 9 deletions client/web/compose/src/components/PageBlocks/RecordListBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2298,15 +2298,19 @@ export default {
cursor: pointer;
}
th .required::after {
content: "*";
display: inline-block;
color: var(--primary);
vertical-align: sub;
margin-left: 2px;
width: 10px;
height: 16px;
overflow: hidden;
th {
min-width: 13rem;
&.required::after {
content: "*";
display: inline-block;
color: var(--primary);
vertical-align: sub;
margin-left: 2px;
width: 10px;
height: 16px;
overflow: hidden;
}
}
tr:hover td.actions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@
size="sm"
variant="light"
:module="recordListModule"
:fields="options.textStyles.noWrapFields || []"
:fields="options.textStyles.wrappedFields || []"
:field-subset="options.fields.length ? options.fields : recordListModule.fields"
@updateFields="onUpdateTextWrapOption"
>
{{ $t('recordList.record.configureNonWrappingFelids') }}
{{ $t('recordList.record.configureWrappedFields') }}
</column-picker>
</b-form-group>
</b-col>
Expand Down Expand Up @@ -1064,8 +1064,8 @@ export default {
},
onUpdateTextWrapOption (fields = []) {
if (this.options.textStyles.noWrapFields) {
this.options.textStyles.noWrapFields = fields.map(f => f.fieldID)
if (this.options.textStyles.wrappedFields) {
this.options.textStyles.wrappedFields = fields.map(f => f.fieldID)
}
},
},
Expand Down
9 changes: 6 additions & 3 deletions lib/js/src/compose/types/page-block/record-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export interface Options {
openRecordInEditMode: boolean;

textStyles: {
noWrapFields: Array<string>
wrappedFields: Array<string>
}
}

Expand Down Expand Up @@ -132,7 +132,7 @@ const defaults: Readonly<Options> = Object.freeze({
openRecordInEditMode: false,

textStyles: {
noWrapFields: [],
wrappedFields: [],
},
})

Expand Down Expand Up @@ -218,7 +218,10 @@ export class PageBlockRecordList extends PageBlock {
}

if (o.textStyles) {
this.options.textStyles = o.textStyles
this.options.textStyles = {
...this.options.textStyles,
...o.textStyles,
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion locale/en/corteza-webapp-compose/block.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ recordList:
recordSelectorDisplayOptions: On record value click
addRecordOptions: On add record click
textStyles: Text Styles
configureNonWrappingFelids: Configure non-wrapping fields
configureWrappedFields: Select fields that will be wrapped
showFullText: Show full text
recordPage: record page
refField:
Expand Down

0 comments on commit b8a3e5f

Please sign in to comment.