UnifiedViews / Core

UnifiedViews
https://www.poolparty.biz/agile-data-integration
Other
30 stars 7 forks source link

Frontend: unnecessary prompt about unsaved changes when viewing pipeline #301

Closed jindrichmynarz closed 9 years ago

jindrichmynarz commented 9 years ago

Using a build from the develop branch (commit 4ed9b6172c3547924753de3e45621cce7332c327) the prompt warning about unsaved changes ("There are unsaved changes. Do you wish to save them or discard?") appears when leaving the pipeline edit screen even when pipeline is unchanged but a DPU configuration detail is viewed (without changing it). The preferred behaviour would be to prompt the user only if the pipeline is changed.

eea02 commented 9 years ago

I have tracked down the root cause of this issue. During installation of DPU, default config is saved into database. Then, when user opens DPU configuration, by clicking on DPU in DPU tree, configuration is taken to build the dialog. When user leaves this dialog, frontend checks, if configuration has changed. Problem is that even in case user didn't change anything, config in DB and config taken from dialog does not match. Here is example of default configuration:

<object-stream>
  <MasterConfigObject>
    <configurations>
      <entry>
        <string>dpu_config</string>
        <string>&lt;object-stream&gt;
  &lt;cz.cuni.mff.xrg.uv.transformer.sparql.update.SparqlUpdateConfig__V1&gt;
    &lt;query&gt;INSERT {?s ?p ?o} WHERE {?s ?p ?o}&lt;/query&gt;
    &lt;perGraph&gt;true&lt;/perGraph&gt;
  &lt;/cz.cuni.mff.xrg.uv.transformer.sparql.update.SparqlUpdateConfig__V1&gt;
&lt;/object-stream&gt;</string>
      </entry>
    </configurations>
  </MasterConfigObject>
</object-stream>

And here is example of configuration taken from dialog, without any changes:

<object-stream>
  <MasterConfigObject>
    <configurations>
      <entry>
        <string>addon/faultToleranceWrap</string>
        <string>&lt;object-stream&gt;
  &lt;eu.unifiedviews.helpers.dpu.extension.faulttolerance.FaultTolerance_-Configuration__V1&gt;
    &lt;enabled&gt;false&lt;/enabled&gt;
    &lt;exceptionNames class=&quot;linked-list&quot;/&gt;
    &lt;maxRetryCount&gt;-1&lt;/maxRetryCount&gt;
  &lt;/eu.unifiedviews.helpers.dpu.extension.faulttolerance.FaultTolerance_-Configuration__V1&gt;
&lt;/object-stream&gt;</string>
      </entry>
      <entry>
        <string>dpu_config</string>
        <string>&lt;object-stream&gt;
  &lt;cz.cuni.mff.xrg.uv.transformer.sparql.update.SparqlUpdateConfig__V1&gt;
    &lt;query&gt;INSERT {?s ?p ?o} WHERE {?s ?p ?o}&lt;/query&gt;
    &lt;perGraph&gt;true&lt;/perGraph&gt;
  &lt;/cz.cuni.mff.xrg.uv.transformer.sparql.update.SparqlUpdateConfig__V1&gt;
&lt;/object-stream&gt;</string>
      </entry>
    </configurations>
  </MasterConfigObject>
</object-stream>
eea02 commented 9 years ago

Configuration of addon/faultToleranceWrap is missing from default config. In class eu.unifiedviews.helpers.dpu.exec.AbstractDpu method createDefaultMasterConfig() we should add default configuration for addons. I would fix it, but I am unable to figure out how to get this default configuration. @skodape could you please help me with this issue? I think you have implemented addons functionality, so you know it better.

tomas-knap commented 9 years ago

If you open pipeline, do not change anything, save the pipeline, close the pipeline, reopen, do not change anything and close without saving, is it ok, or the warning still appears?

What you describe happens when something changes in the core/helpers and different conf is needed. Then it works in a way that conf is loaded from db, it is realized that it does not respect the latest format of the conf, it is updated, but not saved automatically - and then the message appeard.

tomas-knap commented 9 years ago

So basically it should work in a way that it automatically saves on background if the format of the stored config does not correcpond to expected format, but the question is whether it is wanted.

skrchnavy commented 9 years ago

@eea04 / @eea02 please provide steps to reproduce

eea02 commented 9 years ago

I was referring to different to different case as @jindrichmynarz , but I think they are connected. Here are my steps: Fresh install of UV. DPU's are imported.

  1. Go to DPU templates view (/unifiedviews/#!DPURecord)
  2. Click on any DPU. -> DPU config will be viewed
  3. Without change of configuration, click on other DPU. Expected: DPU config of other DPU will be viewed. Real situation: Save changes dialog will pop-up.
jindrichmynarz commented 9 years ago

Indeed, @eea02, what you describe is a different issue from the one I reported. There is one issue with unnecessary save prompt in the DPU templates view and another one in the pipeline view. While they may be related I would rather split them in separate issues. I have created #448 for the unnecessary save prompt in the DPU templates view. I would discuss this problem there and leave this issue for the prompt in the pipeline view.

jindrichmynarz commented 9 years ago

@tomas-knap: If you open pipeline, do not change anything, save the pipeline, close the pipeline, reopen, do not change anything and close without saving, is it ok, or the warning still appears?

As I described in the issue above, the Unsaved changes prompt appears when you open a pipeline, open a DPU detail (not changing anything), and try to close the pipeline (e.g., navigate to a different view). The prompt does not appear "you open pipeline, do not change anything, save the pipeline, close the pipeline, reopen, do not change anything and close without saving".

This issue still appears in bd1ace5a754b87b9fb8794da215e82fd4a443765 and in the UV in ODN 1.0.3.