glific icon indicating copy to clipboard operation
glific copied to clipboard

Update revision schema to get the inbuilt support for flow issues.

Open mdshamoon opened this issue 1 year ago • 0 comments

          Floweditor has inbuilt support for flow issues. I think we can leverage that.

https://github.com/glific/glific-frontend/assets/32592458/5924d397-f051-4d07-aa06-2a565dbe9d59

Will need the backend to send the revision response in this format:

{
  definition: <flow definition>
  metadata: <flow metadata>
  issues: <an array of issues> // this needs to be added to the revision
}

Format of the issues object

interface FlowIssue {
  type: FlowIssueType;
  node_uuid: string;
  action_uuid: string;
  description: string;
  dependency?: Dependency;
  language?: string;
  regex?: string;
}

export enum FlowIssueType {
  MISSING_DEPENDENCY = 'missing_dependency',
  LEGACY_EXTRA = 'legacy_extra',
  INVALID_REGEX = 'invalid_regex'
}

export interface Dependency {
  uuid?: string;
  key?: string;
  name: string;
  type: DependencyType;
  missing?: boolean;
  nodes: { [uuid: string]: string[] };
}

export enum DependencyType {
  channel = 'channel',
  classifier = 'classifier',
  contact = 'contact',
  field = 'field',
  flow = 'flow',
  group = 'group',
  label = 'label',
  template = 'template'
}

Originally posted by @mdshamoon in https://github.com/glific/glific-frontend/issues/2630#issuecomment-1838509781

mdshamoon avatar Dec 14 '23 09:12 mdshamoon