Add loader image + weather city to configuration + clean config
This commit is contained in:
parent
cc89f7b717
commit
04c6e01e50
@ -22,6 +22,8 @@ namespace Manager.Interfaces.DTO
|
||||
public string longitude { get; set; } // MyVisit - True if for mobile (MyVisit)*/
|
||||
public string instanceId { get; set; }
|
||||
public List<string> sectionIds { get; set; }
|
||||
public int pinCode { get; set; } // 4 number
|
||||
public string loaderImageId { get; set; } // == ResourceId
|
||||
public string loaderImageUrl { get; set; } // == Image url
|
||||
public string weatherCity { get; set; } // weatherCity
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,8 +55,14 @@ namespace Manager.Interfaces.Models
|
||||
[BsonRequired]
|
||||
public string InstanceId { get; set; }
|
||||
|
||||
[BsonElement("PinCode")]
|
||||
public int PinCode { get; set; }
|
||||
[BsonElement("LoaderImageId")]
|
||||
public string LoaderImageId { get; set; }
|
||||
|
||||
[BsonElement("LoaderImageUrl")]
|
||||
public string LoaderImageUrl { get; set; }
|
||||
|
||||
[BsonElement("WeatherCity")]
|
||||
public string WeatherCity { get; set; }
|
||||
|
||||
public ConfigurationDTO ToDTO(List<string> sectionIds)
|
||||
{
|
||||
@ -67,6 +73,9 @@ namespace Manager.Interfaces.Models
|
||||
title = Title,
|
||||
imageId = ImageId,
|
||||
imageSource = ImageSource,
|
||||
loaderImageId = LoaderImageId,
|
||||
loaderImageUrl = LoaderImageUrl,
|
||||
weatherCity = WeatherCity,
|
||||
dateCreation = DateCreation,
|
||||
primaryColor = PrimaryColor,
|
||||
languages = Languages,
|
||||
@ -75,7 +84,6 @@ namespace Manager.Interfaces.Models
|
||||
isTablet = IsTablet,
|
||||
isOffline = IsOffline,
|
||||
instanceId = InstanceId,
|
||||
pinCode = PinCode,
|
||||
sectionIds = sectionIds
|
||||
};
|
||||
}
|
||||
@ -88,6 +96,9 @@ namespace Manager.Interfaces.Models
|
||||
title= Title,
|
||||
imageId = ImageId,
|
||||
imageSource = ImageSource,
|
||||
loaderImageId = LoaderImageId,
|
||||
loaderImageUrl = LoaderImageUrl,
|
||||
weatherCity = WeatherCity,
|
||||
dateCreation = DateCreation,
|
||||
primaryColor = PrimaryColor,
|
||||
languages = Languages,
|
||||
@ -98,7 +109,6 @@ namespace Manager.Interfaces.Models
|
||||
sections = sections,
|
||||
resources = resources,
|
||||
instanceId = InstanceId,
|
||||
pinCode = PinCode,
|
||||
sectionIds = sections.Select(s => s.id).ToList()
|
||||
};
|
||||
}
|
||||
|
||||
@ -164,6 +164,9 @@ namespace ManagerService.Controllers
|
||||
configuration.ImageSource = newConfiguration.imageSource;
|
||||
configuration.PrimaryColor = newConfiguration.primaryColor;
|
||||
configuration.SecondaryColor = newConfiguration.secondaryColor;
|
||||
configuration.LoaderImageId = newConfiguration.loaderImageId;
|
||||
configuration.LoaderImageUrl = newConfiguration.loaderImageUrl;
|
||||
configuration.WeatherCity = newConfiguration.weatherCity;
|
||||
|
||||
configuration.Languages = _configuration.GetSection("SupportedLanguages").Get<List<string>>();
|
||||
|
||||
@ -227,6 +230,9 @@ namespace ManagerService.Controllers
|
||||
configuration.IsMobile = updatedConfiguration.isMobile;
|
||||
configuration.IsTablet = updatedConfiguration.isTablet;
|
||||
configuration.IsOffline = updatedConfiguration.isOffline;
|
||||
configuration.LoaderImageId = updatedConfiguration.loaderImageId;
|
||||
configuration.LoaderImageUrl = updatedConfiguration.loaderImageUrl;
|
||||
configuration.WeatherCity = updatedConfiguration.weatherCity;
|
||||
|
||||
Configuration configurationModified = _configurationService.Update(updatedConfiguration.id, configuration);
|
||||
|
||||
@ -500,6 +506,15 @@ namespace ManagerService.Controllers
|
||||
configuration.IsMobile = exportConfiguration.isMobile;
|
||||
configuration.IsTablet = exportConfiguration.isTablet;
|
||||
configuration.IsOffline = exportConfiguration.isOffline;
|
||||
configuration.LoaderImageId = exportConfiguration.loaderImageId;
|
||||
configuration.LoaderImageUrl = exportConfiguration.loaderImageUrl;
|
||||
|
||||
if (configuration.LoaderImageId != null)
|
||||
{
|
||||
createResource(exportConfiguration.resources.Where(r => r.id == configuration.LoaderImageId).FirstOrDefault());
|
||||
}
|
||||
|
||||
configuration.WeatherCity = exportConfiguration.weatherCity;
|
||||
|
||||
_configurationService.Create(configuration);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user