add tracked fields to extention initial object

This commit is contained in:
shamsmosowi
2022-02-07 17:11:22 +08:00
parent 58208d032a
commit aab1e5da2e
2 changed files with 6 additions and 8 deletions

View File

@@ -172,12 +172,13 @@ export function emptyExtensionObject(
user: IExtensionEditor
): IExtension {
return {
name: "Untitled extension",
name: `${type} extension`,
active: false,
triggers: [],
type,
extensionBody: extensionBodyTemplate[type] ?? extensionBodyTemplate["task"],
requiredFields: [],
trackedFields: [],
conditions: `const condition: Condition = async({row, change}) => {
// feel free to add your own code logic here
return true;

View File

@@ -303,13 +303,10 @@ export const ProjectContextProvider: React.FC = ({ children }) => {
() => console.log("Field Value deleted"),
(error) => {
if (error.code === "permission-denied") {
enqueueSnackbar(
`You do not have the permissions to make this change.`,
{
variant: "error",
anchorOrigin: { horizontal: "center", vertical: "top" },
}
);
enqueueSnackbar(`You don't have permission to delete this field`, {
variant: "error",
anchorOrigin: { horizontal: "center", vertical: "top" },
});
} else {
enqueueSnackbar(error.message, {
variant: "error",