mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
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:
committed by
GitHub
parent
e5397c6de7
commit
c158adb4dd
6
.github/ISSUE_TEMPLATE/config.yml
vendored
6
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -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
|
||||
|
||||
12
src/components/fields/LongText/Filter.tsx
Normal file
12
src/components/fields/LongText/Filter.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { IFilterOperator } from "@src/components/fields/types";
|
||||
|
||||
export const filterOperators: IFilterOperator[] = [
|
||||
{
|
||||
label: "equals",
|
||||
value: "==",
|
||||
},
|
||||
{
|
||||
label: "not equals",
|
||||
value: "!=",
|
||||
},
|
||||
];
|
||||
31
src/components/fields/LongText/Settings.tsx
Normal file
31
src/components/fields/LongText/Settings.tsx
Normal 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);
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
|
||||
@@ -15,6 +15,7 @@ const SideDrawerField = lazy(
|
||||
"./SideDrawerField" /* webpackChunkName: "SideDrawerField-ShortText" */
|
||||
)
|
||||
);
|
||||
|
||||
const Settings = lazy(
|
||||
() => import("./Settings" /* webpackChunkName: "Settings-ShortText" */)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user