Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: show status text during state changes
When an object is being deleted there is no indication in the UI. Mairin suggested two changes: - Change status icon to a spinner. (This will be done separately, and although it shows _something_ is happening, it doesn't tell you what it is) - Replacing the age column in the Container/PodList to show Starting/Stopping/ Deleting when one of these state changes is happening, and adding the equivalent message below the action buttons in the corresponding Details page. Since the same state message will appear in all 4 places, I created a really simple StateChange component. It just shows a simple message when in these states, and if you want to hide something when these messages are shown you can use its slot. Fixes #3529. Signed-off-by: Tim deBoer <git@tdeboer.ca>
- Loading branch information
1 parent
c400d70
commit b5f4679
Showing
6 changed files
with
67 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/********************************************************************** | ||
* Copyright (C) 2023 Red Hat, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
***********************************************************************/ | ||
|
||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
|
||
import '@testing-library/jest-dom/vitest'; | ||
import { test, expect } from 'vitest'; | ||
import { render, screen } from '@testing-library/svelte'; | ||
import StateChange from './StateChange.svelte'; | ||
|
||
test('Check status starting', async () => { | ||
render(StateChange, { state: 'STARTING' }); | ||
|
||
const step = screen.getByText('Starting...'); | ||
expect(step).toBeInTheDocument(); | ||
}); | ||
|
||
test('Check status stopping', async () => { | ||
render(StateChange, { state: 'STOPPING' }); | ||
|
||
const status = screen.getByText('Stopping...'); | ||
expect(status).toBeInTheDocument(); | ||
}); | ||
|
||
test('Check status deleting', async () => { | ||
render(StateChange, { state: 'DELETING' }); | ||
|
||
const status = screen.getByText('Deleting...'); | ||
expect(status).toBeInTheDocument(); | ||
}); |
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,7 @@ | ||
<script lang="ts"> | ||
export let state: string; | ||
</script> | ||
|
||
{#if state === 'STARTING'}Starting...{:else if state === 'STOPPING'}Stopping...{:else if state === 'DELETING'}Deleting...{:else} | ||
<slot /> | ||
{/if} |