-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: warning when tries to start an empty workspace
Signed-off-by: Oleksii Orel <oorel@redhat.com>
- Loading branch information
Showing
5 changed files
with
73 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/dashboard-frontend/src/services/devfile/helper.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) 2018-2023 Red Hat, Inc. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
|
||
import devfileApi from '../devfileApi'; | ||
|
||
export function getAttributesFromDevfileV2(devfile: devfileApi.Devfile) { | ||
let attributes = {}; | ||
if (devfile.schemaVersion?.startsWith('2.0')) { | ||
if (!devfile.metadata.attributes) { | ||
devfile.metadata.attributes = attributes; | ||
} else { | ||
attributes = devfile.metadata.attributes; | ||
} | ||
} else { | ||
if (!devfile.attributes) { | ||
devfile.attributes = attributes; | ||
} else { | ||
attributes = devfile.attributes; | ||
} | ||
} | ||
|
||
return attributes; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters