Feat: Customization options added to long text field (#821)

* Update README.md

* Update config.yml

* Feat: Customization options added to long text field

Signed-off-by: Raj Gaurav Maurya <rajgmsocial19@gmail.com>

* Bug:LongText working

Signed-off-by: Raj Gaurav Maurya <rajgmsocial19@gmail.com>
This commit is contained in:
Raj Gaurav Maurya
2022-10-03 11:10:31 +05:30
committed by GitHub
parent e5397c6de7
commit c158adb4dd
5 changed files with 54 additions and 4 deletions

View File

@@ -1,8 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: 🤔 Support & questions
url: https://discord.com/invite/fjBugmvzZP
about: Chat with us for live support on discord.
- name: 🤔 Need support / Q&A
url: https://github.com/rowyio/rowy/discussions/categories/support-q-a
about: Raise a support query on Github Discussion
- name: 🙌 Want to join our team?
url: https://www.rowy.io/jobs
about: Get in touch to contribute & work with Rowy

View File

@@ -0,0 +1,12 @@
import { IFilterOperator } from "@src/components/fields/types";
export const filterOperators: IFilterOperator[] = [
{
label: "equals",
value: "==",
},
{
label: "not equals",
value: "!=",
},
];

View File

@@ -0,0 +1,31 @@
import { ISettingsProps } from "@src/components/fields/types";
import { TextField } from "@mui/material";
export default function Settings({ onChange, config }: ISettingsProps) {
return (
<>
<TextField
type="number"
label="Character limit"
id="character-limit"
value={config.maxLength}
fullWidth
onChange={(e) => {
if (e.target.value === "0") onChange("maxLength")(null);
else onChange("maxLength")(e.target.value);
}}
/>
<TextField
type="text"
label="Validation regex"
id="validation-regex"
value={config.validationRegex}
fullWidth
onChange={(e) => {
if (e.target.value === "") onChange("validationRegex")(null);
else onChange("validationRegex")(e.target.value);
}}
/>
</>
);
}

View File

@@ -5,7 +5,8 @@ import withBasicCell from "@src/components/fields/_withTableCell/withBasicCell";
import LongTextIcon from "@mui/icons-material/Notes";
import BasicCell from "./BasicCell";
import TextEditor from "@src/components/Table/editors/TextEditor";
import { filterOperators } from "@src/components/fields/ShortText/Filter";
import { filterOperators } from "./Filter";
import BasicContextMenuActions from "@src/components/fields/_BasicCell/BasicCellContextMenuActions";
const SideDrawerField = lazy(
@@ -15,6 +16,10 @@ const SideDrawerField = lazy(
)
);
const Settings = lazy(
() => import("./Settings" /* webpackChunkName: "Settings-LongText" */)
);
export const config: IFieldConfig = {
type: FieldType.longText,
name: "Long Text",
@@ -28,6 +33,7 @@ export const config: IFieldConfig = {
TableCell: withBasicCell(BasicCell),
TableEditor: TextEditor,
SideDrawerField,
settings: Settings,
filter: {
operators: filterOperators,
},

View File

@@ -15,6 +15,7 @@ const SideDrawerField = lazy(
"./SideDrawerField" /* webpackChunkName: "SideDrawerField-ShortText" */
)
);
const Settings = lazy(
() => import("./Settings" /* webpackChunkName: "Settings-ShortText" */)
);