diff --git a/models/registration/register.go b/models/registration/register.go index 02dde7f5..14005b7f 100644 --- a/models/registration/register.go +++ b/models/registration/register.go @@ -51,9 +51,13 @@ func (rh *RegistrationHelper) register(pkg PackagingUnit) { //silently exit if the model does not conatin any components or relationships return } + ignored := model.ModelDefinitionStatusIgnored // 1. Register the model model := pkg.Model - + modelstatus := model.Status + if modelstatus == ignored { + return + } // Don't register anything else if registrant is not there if model.Registrant.Kind == "" { err := ErrMissingRegistrant(model.Name) @@ -100,6 +104,11 @@ func (rh *RegistrationHelper) register(pkg PackagingUnit) { var registeredRelationships []relationship.RelationshipDefinition // 2. Register components for _, comp := range pkg.Components { + status := *comp.Status + if status == component.Ignored { + continue + } + comp.Model = model if comp.Styles != nil { diff --git a/utils/utils.go b/utils/utils.go index 737ca1c0..25a7338a 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -402,7 +402,9 @@ func CreateDirectory(path string) error { func ReplaceSpacesAndConvertToLowercase(s string) string { return strings.ToLower(strings.ReplaceAll(s, " ", "")) } - +func ReplaceSpacesWithHyphenAndConvertToLowercase(s string) string { + return strings.ToLower(strings.ReplaceAll(s, " ", "-")) +} func ExtractDomainFromURL(location string) string { parsedURL, err := url.Parse(location) // If unable to extract domain return the location as is.