Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe

Commits:

3 changed files:

Changes:

  • client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/SetNonTargetCatchReleaseUIModelStates.java
    ... ... @@ -26,7 +26,6 @@ import fr.ird.observe.client.configuration.ClientConfig;
    26 26
     import fr.ird.observe.client.constants.AcquisitionMode;
    
    27 27
     import fr.ird.observe.client.datasource.api.cache.ReferencesCache;
    
    28 28
     import fr.ird.observe.client.datasource.api.cache.ReferencesFilterHelper;
    
    29
    -import fr.ird.observe.client.datasource.editor.api.content.data.table.AskToDelete;
    
    30 29
     import fr.ird.observe.dto.data.ps.observation.NonTargetCatchReleaseDto;
    
    31 30
     import fr.ird.observe.dto.data.ps.observation.SetNonTargetCatchReleaseDto;
    
    32 31
     import fr.ird.observe.dto.referential.common.SpeciesGroupDto;
    
    ... ... @@ -34,9 +33,7 @@ import fr.ird.observe.dto.referential.common.SpeciesReference;
    34 33
     import fr.ird.observe.navigation.select.ProjectSelectModel;
    
    35 34
     import fr.ird.observe.services.ObserveServicesProvider;
    
    36 35
     import io.ultreia.java4all.bean.spi.GenerateJavaBeanDefinition;
    
    37
    -import io.ultreia.java4all.i18n.I18n;
    
    38 36
     
    
    39
    -import java.util.List;
    
    40 37
     import java.util.Map;
    
    41 38
     import java.util.TreeMap;
    
    42 39
     
    
    ... ... @@ -64,11 +61,12 @@ public class SetNonTargetCatchReleaseUIModelStates extends GeneratedSetNonTarget
    64 61
             newTableBean.setAcquisitionMode(AcquisitionMode.individual.ordinal());
    
    65 62
         }
    
    66 63
     
    
    67
    -    @Override
    
    68
    -    public boolean canSave(SetNonTargetCatchReleaseDto originalBean, SetNonTargetCatchReleaseDto bean, List<NonTargetCatchReleaseDto> data) {
    
    69
    -        AskToDelete<SetNonTargetCatchReleaseDto> ask = new AskToDelete<>(
    
    70
    -                SetNonTargetCatchReleaseDto::getRemovedUnsafeSpecies,
    
    71
    -                I18n.n("observe.data.ps.observation.NonTargetCatchRelease.message.will.delete.sub.data"));
    
    72
    -        return ask.needDelete(this.getClientUIContext().getDecoratorService(), originalBean, bean);
    
    73
    -    }
    
    64
    +    //FIXME: #1768
    
    65
    +//    @Override
    
    66
    +//    public boolean canSave(SetNonTargetCatchReleaseDto originalBean, SetNonTargetCatchReleaseDto bean, List<NonTargetCatchReleaseDto> data) {
    
    67
    +//        AskToDelete<SetNonTargetCatchReleaseDto> ask = new AskToDelete<>(
    
    68
    +//                SetNonTargetCatchReleaseDto::getRemovedUnsafeSpecies,
    
    69
    +//                I18n.n("observe.data.ps.observation.NonTargetCatchRelease.message.will.delete.sub.data"));
    
    70
    +//        return ask.needDelete(this.getClientUIContext().getDecoratorService(), originalBean, bean);
    
    71
    +//    }
    
    74 72
     }

  • client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/SetNonTargetCatchReleaseUITableModel.java
    ... ... @@ -31,8 +31,6 @@ import fr.ird.observe.dto.referential.ps.observation.NonTargetCatchReleaseStatus
    31 31
     import javax.swing.JTable;
    
    32 32
     import java.util.List;
    
    33 33
     
    
    34
    -import static io.ultreia.java4all.i18n.I18n.t;
    
    35
    -
    
    36 34
     /**
    
    37 35
      * Created on 12/4/14.
    
    38 36
      *
    
    ... ... @@ -81,16 +79,17 @@ public class SetNonTargetCatchReleaseUITableModel extends GeneratedSetNonTargetC
    81 79
             super.onSelectedRowChanged(ui, editingRow, tableEditBean, previousRowBean, notPersisted, newRow);
    
    82 80
         }
    
    83 81
     
    
    84
    -    @Override
    
    85
    -    protected String getDeleteExtraMessage(NonTargetCatchReleaseDto bean) {
    
    86
    -        if (bean.isHasSample()) {
    
    87
    -            int count = getBean().getUnsafeSpeciesUsageCount(bean.getSpecies());
    
    88
    -            if (count == 1) {
    
    89
    -                // while deleting this one, this species won't be available on sample
    
    90
    -                return t("observe.data.ps.observation.NonTargetCatchRelease.message.will.delete.sub.data.for.species", bean.getSpecies());
    
    91
    -            }
    
    92
    -        }
    
    93
    -        // No specific message
    
    94
    -        return null;
    
    95
    -    }
    
    82
    +    //FIXME: #1768
    
    83
    +//    @Override
    
    84
    +//    protected String getDeleteExtraMessage(NonTargetCatchReleaseDto bean) {
    
    85
    +//        if (bean.isHasSample()) {
    
    86
    +//            int count = getBean().getUnsafeSpeciesUsageCount(bean.getSpecies());
    
    87
    +//            if (count == 1) {
    
    88
    +//                // while deleting this one, this species won't be available on sample
    
    89
    +//                return t("observe.data.ps.observation.NonTargetCatchRelease.message.will.delete.sub.data.for.species", bean.getSpecies());
    
    90
    +//            }
    
    91
    +//        }
    
    92
    +//        // No specific message
    
    93
    +//        return null;
    
    94
    +//    }
    
    96 95
     }

  • models/persistence/src/main/java/fr/ird/observe/entities/data/ps/observation/SetImpl.java
    ... ... @@ -316,7 +316,7 @@ public class SetImpl extends SetAbstract {
    316 316
             // do normal copy
    
    317 317
             super.fromDto(referentialLocale, dto);
    
    318 318
             // delete any discarded sample which not using the given species ids
    
    319
    -        //FIXME should we also check in non target catches ???
    
    319
    +        //FIXME: #1768
    
    320 320
     //        TargetSample targetSample = getTargetSample(true);
    
    321 321
     //        if (targetSample != null) {
    
    322 322
     //            List<NonTargetCatchReleaseDto> targetCatch = dto.getNonTargetCatchRelease();