dagu icon indicating copy to clipboard operation
dagu copied to clipboard

Display diff on Web UI for DAG spec editing

Open yohamta opened this issue 2 years ago • 2 comments

This allow us to be more confident on updating a DAG spec.

yohamta avatar Sep 06 '22 23:09 yohamta

@yohamta I may be able to work on this issue. Could you please provide a detailed description on what's needed?

RamonEspinosa avatar Sep 18 '22 20:09 RamonEspinosa

@RamonEspinosa Thank you very much! I was thinking the feature looks like this.

  • When the Save button is pressed in the DAG spec editor in the Web UI, the editor will show the differences from before the edit.
  • Pressing the OK button actually saves it (API call).
  • Pressing the Cancel button returns to the state of editing.
  • If the edited DAG spec has no difference from before the edit, it simply returns to the initial preview state.

This is not required, but it would be nice to be able to disable the diff feature in the admin settings in case the user does not need it.

specEditor:
  - diffOnSave: false # (default: true)

I am not sure if it is usable, but I found a library for diff: https://github.com/kpdecker/jsdiff Also, the Monaco editor seems to support the diff language so I think we can use it.

In the future we would like to extend the feature to have integration with Git (history, commit, push etc) but I think it's too much to think about at the moment :)

yohamta avatar Sep 19 '22 01:09 yohamta