mirror of
https://github.com/enso-org/enso.git
synced 2024-11-25 21:25:20 +03:00
Always write Config's namespace and dashboard accepts a default one (#10572)
Closes #10564. Dashboard accepts only projects with non-empty namespace. The change in project-manager ensures that we serialize `namespace` even if it is a default one. The change in dashboard ensures that namespace can be empty.
This commit is contained in:
parent
0f31fee5ef
commit
473a51cee7
@ -412,7 +412,7 @@ function extractProjectMetadata(yamlObj: unknown, jsonObj: unknown): ProjectMeta
|
|||||||
}
|
}
|
||||||
const name = 'name' in yamlObj && typeof yamlObj.name === 'string' ? yamlObj.name : null
|
const name = 'name' in yamlObj && typeof yamlObj.name === 'string' ? yamlObj.name : null
|
||||||
const namespace =
|
const namespace =
|
||||||
'namespace' in yamlObj && typeof yamlObj.namespace === 'string' ? yamlObj.namespace : null
|
'namespace' in yamlObj && typeof yamlObj.namespace === 'string' ? yamlObj.namespace : 'local'
|
||||||
const engineVersion =
|
const engineVersion =
|
||||||
'edition' in yamlObj && typeof yamlObj.edition === 'string' ? yamlObj.edition : null
|
'edition' in yamlObj && typeof yamlObj.edition === 'string' ? yamlObj.edition : null
|
||||||
const id = 'id' in jsonObj && typeof jsonObj.id === 'string' ? jsonObj.id : null
|
const id = 'id' in jsonObj && typeof jsonObj.id === 'string' ? jsonObj.id : null
|
||||||
@ -424,7 +424,7 @@ function extractProjectMetadata(yamlObj: unknown, jsonObj: unknown): ProjectMeta
|
|||||||
'lastOpened' in jsonObj && typeof jsonObj.lastOpened === 'string' ?
|
'lastOpened' in jsonObj && typeof jsonObj.lastOpened === 'string' ?
|
||||||
validDateString(jsonObj.lastOpened)
|
validDateString(jsonObj.lastOpened)
|
||||||
: null
|
: null
|
||||||
if (name != null && namespace != null && id != null && created != null) {
|
if (name != null && id != null && created != null) {
|
||||||
return {
|
return {
|
||||||
name,
|
name,
|
||||||
namespace,
|
namespace,
|
||||||
|
@ -249,8 +249,7 @@ object Config {
|
|||||||
value.normalizedName.foreach(v =>
|
value.normalizedName.foreach(v =>
|
||||||
elements.add((JsonFields.NormalizedName, v))
|
elements.add((JsonFields.NormalizedName, v))
|
||||||
)
|
)
|
||||||
if (value.namespace != DefaultNamespace)
|
elements.add((JsonFields.Namespace, value.namespace))
|
||||||
elements.add((JsonFields.Namespace, value.namespace))
|
|
||||||
if (value.version != DefaultVersion)
|
if (value.version != DefaultVersion)
|
||||||
elements.add(
|
elements.add(
|
||||||
(JsonFields.Version, value.version)
|
(JsonFields.Version, value.version)
|
||||||
|
Loading…
Reference in New Issue
Block a user