Skip to content

Commit

Permalink
fix: support multiple icons for assets [CORE-3097] (#60)
Browse files Browse the repository at this point in the history
Allows using different icons for light and dark theme, and adds it to all
assets.
  • Loading branch information
wejendorp authored Jun 26, 2024
1 parent 512d146 commit 385fcb1
Show file tree
Hide file tree
Showing 41 changed files with 472 additions and 214 deletions.
429 changes: 230 additions & 199 deletions packages/go/model/model.go

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions packages/go/schemas/abstracts/core/block-definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
"title": "BlockDefinition",
"type": "object",
"additionalProperties": false,
"required": [
"kind",
"metadata",
"spec"
],
"required": ["kind", "metadata", "spec"],
"properties": {
"kind": {
"type": "string"
Expand Down Expand Up @@ -38,6 +34,12 @@
},
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
}
}
},
Expand All @@ -48,4 +50,4 @@
}
}
}
}
}
6 changes: 6 additions & 0 deletions packages/go/schemas/concepts/core/block-type-executable.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"dependencies": {
"$ref": "/core/dependencies"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/go/schemas/concepts/core/block-type-operator.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"dependencies": {
"$ref": "/core/dependencies"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/go/schemas/concepts/core/block-type.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"dependencies": {
"$ref": "/core/dependencies"
},
Expand Down
12 changes: 12 additions & 0 deletions packages/go/schemas/concepts/core/deployment-target.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"color": {
"$ref": "/core/color-value"
},
Expand Down Expand Up @@ -58,6 +64,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"service": {
"$ref": "/core/remote-service"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/go/schemas/concepts/core/language-target.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"local": {
"title": "LocalDevContainer",
"description": "if type is \"docker\" or empty - Local development container using a fixed docker image. User code will be mounted into the container.\nif type is \"dockerfile\" - Local development container using a Dockerfile. User code will be built into the container.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"schema": {
"$ref": "/core/schema"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/go/schemas/concepts/core/resource-type-internal.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"configuration": {
"$ref": "/core/configuration-schema"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/go/schemas/concepts/core/resource-type-operator.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"ports": {
"type": "array",
"minItems": 1,
Expand Down
7 changes: 7 additions & 0 deletions packages/go/schemas/types/core/icon-value.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
},
"value": {
"type": "string"
},
"theme": {
"type": "string",
"enum": [
"light",
"dark"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ public class BlockDefinitionSpec {
private EntityList configuration;
private List<Resource> consumers;
private EntityList entities;
@Deprecated
private IconValue icon;
private List<IconValue> icons;
private List<Resource> providers;
private LanguageTargetReference target;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
public class BlockTypeExecutableSpec {
private ConfigurationSchema configuration;
private List<Dependency> dependencies;
@Deprecated
private IconValue icon;
private List<IconValue> icons;
private Map<String, Object> schema;
private List<Versioning> versioning;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
public class BlockTypeOperatorSpec {
private ConfigurationSchema configuration;
private List<Dependency> dependencies;
@Deprecated
private IconValue icon;
private List<IconValue> icons;
private LocalInstance local;
private OperatorPorts ports;
private Map<String, Object> schema;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
public class BlockTypeSpec {
private Port defaultPort;
private List<Dependency> dependencies;
@Deprecated
private IconValue icon;
private List<IconValue> icons;
private Map<String, Object> schema;
private List<Versioning> versioning;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package com.kapeta.schemas.entity;

import java.util.List;

@lombok.Data
public class DeploymentTargetOperator {
private ColorValue color;
private ConfigurationSchema configuration;
private String description;
@Deprecated
private IconValue icon;
private List<IconValue> icons;
private URLValue link;
private String title;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
@lombok.Data
public class DeploymentTargetSpec {
private ConfigurationSchema configuration;
@Deprecated
private IconValue icon;
private List<IconValue> icons;
private Map<String, DeploymentTargetOperator> operators;
private RemoteService service;
private List<Versioning> versioning;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
public class IconValue {
private IconType type;
private String value;
private String theme;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

@lombok.Data
public class LanguageTargetSpec {
@Deprecated
private IconValue icon;
private List<IconValue> icons;
private LocalDevContainer local;
private Map<String, Object> schema;
private List<Versioning> versioning;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
@lombok.Data
public class ResourceTypeExtensionSpec {
private ConfigurationSchema configuration;
@Deprecated
private IconValue icon;
private List<IconValue> icons;
private List<Port> ports;
private Map<String, Object> schema;
private List<Versioning> versioning;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
@lombok.Data
public class ResourceTypeInternalSpec {
private ConfigurationSchema configuration;
@Deprecated
private IconValue icon;
private List<IconValue> icons;
private List<Port> ports;
private Map<String, Object> schema;
private List<Versioning> versioning;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
public class ResourceTypeOperatorSpec {
private ColorValue color;
private ConfigurationSchema configuration;
@Deprecated
private IconValue icon;
private List<IconValue> icons;
private LocalInstance local;
private List<Port> ports;
private Map<String, Object> schema;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
},
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"dependencies": {
"$ref": "/core/dependencies"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"dependencies": {
"$ref": "/core/dependencies"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"dependencies": {
"$ref": "/core/dependencies"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"color": {
"$ref": "/core/color-value"
},
Expand Down Expand Up @@ -58,6 +64,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"service": {
"$ref": "/core/remote-service"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"local": {
"title": "LocalDevContainer",
"description": "if type is \"docker\" or empty - Local development container using a fixed docker image. User code will be mounted into the container.\nif type is \"dockerfile\" - Local development container using a Dockerfile. User code will be built into the container.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"schema": {
"$ref": "/core/schema"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
"icon": {
"$ref": "/core/icon-value"
},
"icons": {
"type": "array",
"items": {
"$ref": "/core/icon-value"
}
},
"configuration": {
"$ref": "/core/configuration-schema"
},
Expand Down
Loading

0 comments on commit 385fcb1

Please sign in to comment.