refactor: move web utils to packages (#7145)
* refactor: move web utils to packages * fix: build and lint errors * chore: update drag handle plugin * chore: update table cell type to fix build errors * fix: build errors * chore: sync few changes * fix: build errors * chore: minor fixes related to duplicate assets imports * fix: build errors * chore: minor changes
This commit is contained in:
parent
dffcc6dc10
commit
2014400bed
614 changed files with 1999 additions and 3030 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import set from "lodash/set";
|
||||
// plane imports
|
||||
import { DEFAULT_WORK_ITEM_FORM_VALUES } from "@plane/constants";
|
||||
import { IPartialProject, ISearchIssueResponse, IState, TIssue } from "@plane/types";
|
||||
|
|
@ -31,3 +32,17 @@ export const convertWorkItemDataToSearchResponse = (
|
|||
state__name: state?.name ?? "",
|
||||
workspace__slug: workspaceSlug,
|
||||
});
|
||||
|
||||
|
||||
export function getChangedIssuefields(formData: Partial<TIssue>, dirtyFields: { [key: string]: boolean | undefined }) {
|
||||
const changedFields = {};
|
||||
|
||||
const dirtyFieldKeys = Object.keys(dirtyFields) as (keyof TIssue)[];
|
||||
for (const dirtyField of dirtyFieldKeys) {
|
||||
if (!!dirtyFields[dirtyField]) {
|
||||
set(changedFields, [dirtyField], formData[dirtyField]);
|
||||
}
|
||||
}
|
||||
|
||||
return changedFields as Partial<TIssue>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue