Add imagesource to sectionDTO + delete sectionIds for configuration + add order to section
This commit is contained in:
parent
a4a95c00e2
commit
37c667cd46
@ -8,7 +8,6 @@ namespace Manager.Interfaces.DTO
|
|||||||
{
|
{
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
public string Label { get; set; }
|
public string Label { get; set; }
|
||||||
public List<string> SectionIds { get; set; }
|
|
||||||
public string PrimaryColor { get; set; }
|
public string PrimaryColor { get; set; }
|
||||||
public string SecondaryColor { get; set; }
|
public string SecondaryColor { get; set; }
|
||||||
public List<string> Languages { get; set; } // fr, en, de, nl => Sélection dans une liste déjà établie dans l'application !
|
public List<string> Languages { get; set; } // fr, en, de, nl => Sélection dans une liste déjà établie dans l'application !
|
||||||
|
|||||||
@ -12,11 +12,13 @@ namespace Manager.Interfaces.DTO
|
|||||||
public List<TranslationDTO> Title { get; set; }
|
public List<TranslationDTO> Title { get; set; }
|
||||||
public List<TranslationDTO> Description { get; set; }
|
public List<TranslationDTO> Description { get; set; }
|
||||||
public string ImageId { get; set; } // == ResourceId
|
public string ImageId { get; set; } // == ResourceId
|
||||||
|
public string ImageSource { get; set; } // == Image url
|
||||||
public string ConfigurationId { get; set; }
|
public string ConfigurationId { get; set; }
|
||||||
public bool IsSubSection { get; set; } // true if part of menu type
|
public bool IsSubSection { get; set; } // true if part of menu type
|
||||||
public string ParentId { get; set; } // only if it's an subsection
|
public string ParentId { get; set; } // only if it's an subsection
|
||||||
public SectionType Type { get; set; } // !! If IsSubSection == true => Type can't not be menu !
|
public SectionType Type { get; set; } // !! If IsSubSection == true => Type can't not be menu !
|
||||||
public string Data { get; set; } // == Include section type info
|
public string Data { get; set; } // == Include section type info
|
||||||
public DateTime DateCreation { get; set; } // == Include section type info
|
public DateTime DateCreation { get; set; } // == Include section type info
|
||||||
|
public int Order { get; set; } // Order to show
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,6 @@ namespace Manager.Interfaces.Models
|
|||||||
DateCreation = DateCreation,
|
DateCreation = DateCreation,
|
||||||
PrimaryColor = PrimaryColor,
|
PrimaryColor = PrimaryColor,
|
||||||
Languages = Languages,
|
Languages = Languages,
|
||||||
SectionIds = SectionIds, // Maybe get direct from db
|
|
||||||
SecondaryColor = SecondaryColor
|
SecondaryColor = SecondaryColor
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,6 +28,9 @@ namespace Manager.Interfaces.Models
|
|||||||
[BsonElement("Description")]
|
[BsonElement("Description")]
|
||||||
public List<TranslationDTO> Description { get; set; }
|
public List<TranslationDTO> Description { get; set; }
|
||||||
|
|
||||||
|
[BsonElement("Order")]
|
||||||
|
public int Order { get; set; }
|
||||||
|
|
||||||
[BsonElement("ConfigurationId")]
|
[BsonElement("ConfigurationId")]
|
||||||
[BsonRequired]
|
[BsonRequired]
|
||||||
public string ConfigurationId { get; set; } // Parent id
|
public string ConfigurationId { get; set; } // Parent id
|
||||||
@ -36,6 +39,10 @@ namespace Manager.Interfaces.Models
|
|||||||
[BsonRequired]
|
[BsonRequired]
|
||||||
public string ImageId { get; set; }
|
public string ImageId { get; set; }
|
||||||
|
|
||||||
|
[BsonElement("ImageSource")]
|
||||||
|
[BsonRequired]
|
||||||
|
public string ImageSource { get; set; }
|
||||||
|
|
||||||
[BsonElement("Type")]
|
[BsonElement("Type")]
|
||||||
[BsonRequired]
|
[BsonRequired]
|
||||||
public SectionType Type { get; set; }
|
public SectionType Type { get; set; }
|
||||||
@ -62,8 +69,10 @@ namespace Manager.Interfaces.Models
|
|||||||
Label = Label,
|
Label = Label,
|
||||||
Title = Title.OrderBy(t => t.Language).ToList(),
|
Title = Title.OrderBy(t => t.Language).ToList(),
|
||||||
Description = Description.OrderBy(d => d.Language).ToList(),
|
Description = Description.OrderBy(d => d.Language).ToList(),
|
||||||
|
Order = Order,
|
||||||
Type = Type,
|
Type = Type,
|
||||||
ImageId = ImageId,
|
ImageId = ImageId,
|
||||||
|
ImageSource = ImageSource,
|
||||||
ConfigurationId = ConfigurationId,
|
ConfigurationId = ConfigurationId,
|
||||||
IsSubSection = IsSubSection,
|
IsSubSection = IsSubSection,
|
||||||
ParentId = ParentId,
|
ParentId = ParentId,
|
||||||
|
|||||||
@ -99,8 +99,7 @@ namespace ManagerService.Controllers
|
|||||||
configuration.Label = newConfiguration.Label;
|
configuration.Label = newConfiguration.Label;
|
||||||
configuration.PrimaryColor = newConfiguration.PrimaryColor;
|
configuration.PrimaryColor = newConfiguration.PrimaryColor;
|
||||||
configuration.SecondaryColor = newConfiguration.SecondaryColor;
|
configuration.SecondaryColor = newConfiguration.SecondaryColor;
|
||||||
configuration.SectionIds = newConfiguration.SectionIds;
|
configuration.Languages = new List<string> { "FR", "NL", "EN", "DE" }; // by default all languages
|
||||||
configuration.Languages = newConfiguration.Languages;
|
|
||||||
configuration.DateCreation = DateTime.Now;
|
configuration.DateCreation = DateTime.Now;
|
||||||
|
|
||||||
Configuration configurationCreated = _configurationService.Create(configuration);
|
Configuration configurationCreated = _configurationService.Create(configuration);
|
||||||
@ -148,7 +147,6 @@ namespace ManagerService.Controllers
|
|||||||
configuration.PrimaryColor = updatedConfiguration.PrimaryColor;
|
configuration.PrimaryColor = updatedConfiguration.PrimaryColor;
|
||||||
configuration.SecondaryColor = updatedConfiguration.SecondaryColor;
|
configuration.SecondaryColor = updatedConfiguration.SecondaryColor;
|
||||||
configuration.Languages = updatedConfiguration.Languages;
|
configuration.Languages = updatedConfiguration.Languages;
|
||||||
configuration.SectionIds = updatedConfiguration.SectionIds;
|
|
||||||
|
|
||||||
Configuration configurationModified = _configurationService.Update(updatedConfiguration.Id, configuration);
|
Configuration configurationModified = _configurationService.Update(updatedConfiguration.Id, configuration);
|
||||||
|
|
||||||
|
|||||||
@ -224,6 +224,7 @@ namespace ManagerService.Controllers
|
|||||||
Section section = new Section();
|
Section section = new Section();
|
||||||
section.Label = newSection.Label;
|
section.Label = newSection.Label;
|
||||||
section.ImageId = newSection.ImageId;
|
section.ImageId = newSection.ImageId;
|
||||||
|
section.ImageSource = newSection.ImageSource;
|
||||||
section.ConfigurationId = newSection.ConfigurationId;
|
section.ConfigurationId = newSection.ConfigurationId;
|
||||||
section.DateCreation = DateTime.Now;
|
section.DateCreation = DateTime.Now;
|
||||||
section.IsSubSection = newSection.IsSubSection;
|
section.IsSubSection = newSection.IsSubSection;
|
||||||
@ -231,6 +232,7 @@ namespace ManagerService.Controllers
|
|||||||
section.Type = newSection.Type;
|
section.Type = newSection.Type;
|
||||||
section.Title = new List<TranslationDTO>();
|
section.Title = new List<TranslationDTO>();
|
||||||
section.Description = new List<TranslationDTO>();
|
section.Description = new List<TranslationDTO>();
|
||||||
|
section.Order = _sectionService.GetAllFromConfiguration(newSection.ConfigurationId).Count;
|
||||||
// Preparation
|
// Preparation
|
||||||
List<string> languages = new List<string> { "FR", "NL", "EN", "DE" };//_configurationService.GetById(newSection.ConfigurationId).Languages;
|
List<string> languages = new List<string> { "FR", "NL", "EN", "DE" };//_configurationService.GetById(newSection.ConfigurationId).Languages;
|
||||||
|
|
||||||
@ -436,6 +438,7 @@ namespace ManagerService.Controllers
|
|||||||
section.Description = updatedSection.Description;
|
section.Description = updatedSection.Description;
|
||||||
section.Type = updatedSection.Type;
|
section.Type = updatedSection.Type;
|
||||||
section.ImageId = updatedSection.ImageId;
|
section.ImageId = updatedSection.ImageId;
|
||||||
|
section.ImageSource = updatedSection.ImageSource;
|
||||||
section.ConfigurationId = updatedSection.ConfigurationId;
|
section.ConfigurationId = updatedSection.ConfigurationId;
|
||||||
section.IsSubSection = updatedSection.IsSubSection;
|
section.IsSubSection = updatedSection.IsSubSection;
|
||||||
section.ParentId = updatedSection.ParentId;
|
section.ParentId = updatedSection.ParentId;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user