Capgemini / xrm-datamigration-xrmtoolbox

Export and import data for Microsoft Dataverse as an XrmToolBox plugin. Supports JSON and CSV.
MIT License
8 stars 4 forks source link

Refactor/export lookup mappings #73

Closed danroche10 closed 2 years ago

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 8 Code Smells

87.0% 87.0% Coverage
0.0% 0.0% Duplication

tdashworth commented 2 years ago

If in its own PR, feel free to merge this

danroche10 commented 2 years ago

I will do the loading of mappings in separate pr as I need to do it for import as well.

I'll also remove temporary solution for critical failure in this new PR

Thanks,

Dan

On Mon, 29 Aug 2022, 14:04 Tom Ashworth, @.***> wrote:

@.**** commented on this pull request.

Could we implement that last bit or are you doing that in its own PR?

In Capgemini.Xrm.CdsDataMigrator/Capgemini.Xrm.CdsDataMigratorLibrary/Forms/ExportLookupMappingsForm.cs https://github.com/Capgemini/xrm-datamigration-xrmtoolbox/pull/73#discussion_r957272577 :

  • (dgvMappings.Rows[dgvMappings.CurrentRow.Index].Cells[2] as DataGridViewComboBoxCell).DataSource = value.Select(x => x.LogicalName).OrderBy(n => n).ToArray();
  • }
  • }
  • public List Mappings
  • {
  • get
  • {
  • List mappings = new List();
  • foreach (DataGridViewRow row in dgvMappings.Rows)
  • {
  • mappings.Add(row);
  • }
  • return mappings;
  • }
  • // setter needed to load existing mappings. Still needs to be implemented

Has this been done?

In Capgemini.Xrm.CdsDataMigrator/Capgemini.Xrm.CdsDataMigratorLibrary/Forms/ExportLookupMappingsForm.cs https://github.com/Capgemini/xrm-datamigration-xrmtoolbox/pull/73#discussion_r957273634 :

  • {
  • this.OnRefFieldChanged?.Invoke(sender, e);
  • }
  • }
  • [ExcludeFromCodeCoverage]
  • private void ButtonCloseClick(object sender, EventArgs e)
  • {
  • Close();
  • }
  • [ExcludeFromCodeCoverage]
  • private void dgvMappings_DataError(object sender, DataGridViewDataErrorEventArgs e)
  • {
  • //Temporary solution to hide critical failure
  • e.Cancel = true;

Is this still required?

In Capgemini.Xrm.CdsDataMigrator/Capgemini.Xrm.CdsDataMigratorLibrary/Forms/ImportMappingsForm.cs https://github.com/Capgemini/xrm-datamigration-xrmtoolbox/pull/73#discussion_r957275667 :

@@ -45,6 +45,7 @@ public List Mappings } return mappings; }

  • // setter needed to load existing mappings. Still needs to be implemented

Has this been done?

In Capgemini.Xrm.CdsDataMigrator/Capgemini.Xrm.CdsDataMigratorLibrary/Presenters/ExportMappingsFormPresenster.cs https://github.com/Capgemini/xrm-datamigration-xrmtoolbox/pull/73#discussion_r957277874 :

  • this.view.OnVisible += OnVisible;
  • this.view.OnEntityColumnChanged += OnEntityColumnChanged;
  • this.view.OnRefFieldChanged += OnRefFieldChanged;
  • }
  • [ExcludeFromCodeCoverage]
  • public IMetadataService MetaDataService { get; set; }
  • [ExcludeFromCodeCoverage]
  • public IOrganizationService OrganizationService { get; set; }
  • [ExcludeFromCodeCoverage]
  • public IExceptionService ExceptionService { get; set; }
  • [ExcludeFromCodeCoverage]
  • public void OnVisible(object sender, EventArgs e)

It looks like the loading of existing mappings haven't been done

— Reply to this email directly, view it on GitHub https://github.com/Capgemini/xrm-datamigration-xrmtoolbox/pull/73#pullrequestreview-1088599955, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMP2GLRCC6F663FL7UAP273V3SYMZANCNFSM575JCIGA . You are receiving this because you authored the thread.Message ID: @.*** com>