Cosmetic fix (it's not a bug)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
1 ano atrás
If the nopcommerce has a lot of stores (multistore) we have the not user-friendly look and performance issues when we open the Message Template list in nop admin.
If the template has LimitedToStore==0 then we need to show "For all stores". Now we create the list of all stores.
old code
                    //fill in additional values (not existing in the entity)
                    var storeNames = stores.Select(store => store.Name);
                    if (messageTemplate.LimitedToStores)
                    {
                        await _storeMappingSupportedModelFactory.PrepareModelStoresAsync(messageTemplateModel, messageTemplate, false);
                        storeNames = stores
                            .Where(store => messageTemplateModel.SelectedStoreIds.Contains(store.Id)).Select(store => store.Name);
                    }
                    messageTemplateModel.ListOfStores = string.Join(", ", storeNames);


new code
                    if (messageTemplate.LimitedToStores)
                    {
                        await _storeMappingSupportedModelFactory.PrepareModelStoresAsync(messageTemplateModel, messageTemplate, false);
                        var storeNames = stores
                            .Where(store => messageTemplateModel.SelectedStoreIds.Contains(store.Id)).Select(store => store.Name);
                        messageTemplateModel.ListOfStores = string.Join(", ", storeNames);
                    }
                    else
{
var allstores = await _localizationService.GetResourceAsync("Admin.Configuration.Settings.AllSettings.Fields.StoreName.AllStores");
                        messageTemplateModel.ListOfStores = allstores;
}
1 ano atrás
Thanks for your suggestion, we applied it here.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.