Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export function designerDirective($log, $state, $q, iconGenerator, catalogApi, b

switch (entity.family) {
case EntityFamily.ENTITY:
if ($scope.onSelectionChange) $scope.onSelectionChange(undefined);
entity.delete();
break;
case EntityFamily.POLICY:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,16 @@ export function specEditorDirective($rootScope, $templateCache, $injector, $sani
scope: {
model: '='
},
controller: ['$scope', '$element', controller],
controller: ['$scope', '$element', 'paletteService', controller],
templateUrl: function (tElement, tAttrs) {
return tAttrs.templateUrl || TEMPLATE_URL;
},
link: link,
controllerAs: 'specEditor',
};

function controller($scope, $element) {
function controller($scope, $element, paletteService) {
$scope.paletteService = paletteService;
(composerOverrides.configureSpecEditorController || function() {})(this, $scope, $element);

// does very little currently, but link adds to this
Expand All @@ -103,6 +104,19 @@ export function specEditorDirective($rootScope, $templateCache, $injector, $sani
scope.RESERVED_KEYS = RESERVED_KEYS;
scope.REPLACED_DSL_ENTITYSPEC = REPLACED_DSL_ENTITYSPEC;

specEditor.sections = scope.paletteService.getSections();
specEditor.hasParentEntity = element.parent().children()[0].tagName == "SECTION"
&& element.parent().children()[0].classList.contains("spec-parent");
specEditor.needToolbar = !["policy", "enricher", "location", "other"].includes(element.attr("model"));

if (specEditor.hasParentEntity) {
$rootScope.oldSelectedSection = $rootScope.selectedSection
$rootScope.selectedSection = specEditor.sections.entities;
} else if ($rootScope.oldSelectedSection) {
$rootScope.selectedSection = $rootScope.oldSelectedSection;
$rootScope.oldSelectedSection = undefined;
}

let defaultState = {
config: {
add: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@

spec-editor {
display: block;
margin-top: 15px;
color: @gray;

.config-panel {
padding: 20px 15px;
flex-basis: 100%;
border-right: 1px solid @navbar-default-border;
min-width: 0;
}

.toolbar-button-affordance() {
color: mix(@gray, @gray-lighter);
cursor: pointer;
Expand Down Expand Up @@ -76,6 +82,7 @@ spec-editor {

.panel-header-body {
padding-left: 2em;
width: initial;
.panel-header-icon {
width: 30px;
margin-left: -30px;
Expand Down Expand Up @@ -196,6 +203,66 @@ spec-editor {
.spec-actions {
flex-grow: 0;
}
h2 {
margin-bottom: 0px;
input {
color: @gray-light;
}
}
.btn-group {
display: flex;
align-items: center;

& br-svg {
display: block;
height: 20px;
width: 20px;
cursor: pointer;
}

.fa-bars {
font-size: 20px;
}
}
}

.media {
display: flex;

.panel-header-body {
min-width: 0;
padding-left: 0;

div {
display: flex;
}

.fa-bookmark {
display: block;
min-width: 28px;
margin-left: 0;
}

.fa-id-card-o {
margin-left: 0;
margin-right: 0;
}

.entity-type-header {
text-overflow: ellipsis;
overflow: hidden;
display: block;
}

.version {
margin-left: 28px;
}

.identifier {
margin-top: 0;
align-items: center;
}
}
}

.spec-actions {
Expand All @@ -215,6 +282,26 @@ spec-editor {
}
}

.core-config-panel {
margin-top: 20px;

> div:first-child {
display:flex;
align-items: center;

div:first-child {
color: @gray-light;
font-size: 16px;
}
span {
margin-left: 6px;
}
div:last-child {
margin-left: auto;
}
}
}

.spec-type,
.spec-configuration,
.spec-policies,
Expand Down Expand Up @@ -781,7 +868,7 @@ spec-editor {
border: 1px solid @gray-light;
transition: 0.15s ease all;
padding: 0.5em;
margin-top: -12px;
margin-top: 0px;
margin-bottom: 24px;
.dropdown-menu li a {
// quite a lot of padding in normal dropdown, in the ul and in the a
Expand Down Expand Up @@ -857,3 +944,10 @@ dsl-viewer {
cursor: alias;
}
}

.pane-configuration .pane-palette {
width: initial;
left: initial;
border-left: initial;
box-shadow: initial;
}
Loading