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 longitude { get; set; } // MyVisit - True if for mobile (MyVisit)*/
|
||||||
public string instanceId { get; set; }
|
public string instanceId { get; set; }
|
||||||
public List<string> sectionIds { 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]
|
[BsonRequired]
|
||||||
public string InstanceId { get; set; }
|
public string InstanceId { get; set; }
|
||||||
|
|
||||||
[BsonElement("PinCode")]
|
[BsonElement("LoaderImageId")]
|
||||||
public int PinCode { get; set; }
|
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)
|
public ConfigurationDTO ToDTO(List<string> sectionIds)
|
||||||
{
|
{
|
||||||
@ -67,6 +73,9 @@ namespace Manager.Interfaces.Models
|
|||||||
title = Title,
|
title = Title,
|
||||||
imageId = ImageId,
|
imageId = ImageId,
|
||||||
imageSource = ImageSource,
|
imageSource = ImageSource,
|
||||||
|
loaderImageId = LoaderImageId,
|
||||||
|
loaderImageUrl = LoaderImageUrl,
|
||||||
|
weatherCity = WeatherCity,
|
||||||
dateCreation = DateCreation,
|
dateCreation = DateCreation,
|
||||||
primaryColor = PrimaryColor,
|
primaryColor = PrimaryColor,
|
||||||
languages = Languages,
|
languages = Languages,
|
||||||
@ -75,7 +84,6 @@ namespace Manager.Interfaces.Models
|
|||||||
isTablet = IsTablet,
|
isTablet = IsTablet,
|
||||||
isOffline = IsOffline,
|
isOffline = IsOffline,
|
||||||
instanceId = InstanceId,
|
instanceId = InstanceId,
|
||||||
pinCode = PinCode,
|
|
||||||
sectionIds = sectionIds
|
sectionIds = sectionIds
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -88,6 +96,9 @@ namespace Manager.Interfaces.Models
|
|||||||
title= Title,
|
title= Title,
|
||||||
imageId = ImageId,
|
imageId = ImageId,
|
||||||
imageSource = ImageSource,
|
imageSource = ImageSource,
|
||||||
|
loaderImageId = LoaderImageId,
|
||||||
|
loaderImageUrl = LoaderImageUrl,
|
||||||
|
weatherCity = WeatherCity,
|
||||||
dateCreation = DateCreation,
|
dateCreation = DateCreation,
|
||||||
primaryColor = PrimaryColor,
|
primaryColor = PrimaryColor,
|
||||||
languages = Languages,
|
languages = Languages,
|
||||||
@ -98,7 +109,6 @@ namespace Manager.Interfaces.Models
|
|||||||
sections = sections,
|
sections = sections,
|
||||||
resources = resources,
|
resources = resources,
|
||||||
instanceId = InstanceId,
|
instanceId = InstanceId,
|
||||||
pinCode = PinCode,
|
|
||||||
sectionIds = sections.Select(s => s.id).ToList()
|
sectionIds = sections.Select(s => s.id).ToList()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -164,6 +164,9 @@ namespace ManagerService.Controllers
|
|||||||
configuration.ImageSource = newConfiguration.imageSource;
|
configuration.ImageSource = newConfiguration.imageSource;
|
||||||
configuration.PrimaryColor = newConfiguration.primaryColor;
|
configuration.PrimaryColor = newConfiguration.primaryColor;
|
||||||
configuration.SecondaryColor = newConfiguration.secondaryColor;
|
configuration.SecondaryColor = newConfiguration.secondaryColor;
|
||||||
|
configuration.LoaderImageId = newConfiguration.loaderImageId;
|
||||||
|
configuration.LoaderImageUrl = newConfiguration.loaderImageUrl;
|
||||||
|
configuration.WeatherCity = newConfiguration.weatherCity;
|
||||||
|
|
||||||
configuration.Languages = _configuration.GetSection("SupportedLanguages").Get<List<string>>();
|
configuration.Languages = _configuration.GetSection("SupportedLanguages").Get<List<string>>();
|
||||||
|
|
||||||
@ -227,6 +230,9 @@ namespace ManagerService.Controllers
|
|||||||
configuration.IsMobile = updatedConfiguration.isMobile;
|
configuration.IsMobile = updatedConfiguration.isMobile;
|
||||||
configuration.IsTablet = updatedConfiguration.isTablet;
|
configuration.IsTablet = updatedConfiguration.isTablet;
|
||||||
configuration.IsOffline = updatedConfiguration.isOffline;
|
configuration.IsOffline = updatedConfiguration.isOffline;
|
||||||
|
configuration.LoaderImageId = updatedConfiguration.loaderImageId;
|
||||||
|
configuration.LoaderImageUrl = updatedConfiguration.loaderImageUrl;
|
||||||
|
configuration.WeatherCity = updatedConfiguration.weatherCity;
|
||||||
|
|
||||||
Configuration configurationModified = _configurationService.Update(updatedConfiguration.id, configuration);
|
Configuration configurationModified = _configurationService.Update(updatedConfiguration.id, configuration);
|
||||||
|
|
||||||
@ -500,6 +506,15 @@ namespace ManagerService.Controllers
|
|||||||
configuration.IsMobile = exportConfiguration.isMobile;
|
configuration.IsMobile = exportConfiguration.isMobile;
|
||||||
configuration.IsTablet = exportConfiguration.isTablet;
|
configuration.IsTablet = exportConfiguration.isTablet;
|
||||||
configuration.IsOffline = exportConfiguration.isOffline;
|
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);
|
_configurationService.Create(configuration);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user