Skip to content

Commit

Permalink
style: improve install image list (#2777)
Browse files Browse the repository at this point in the history
**Changes:**

This PR enhances the ImageInstallModal component by:

1. Importing Typography from antd.
2. Improving the layout and styling of the image list:
   - Removed border from the List component. Because previous list looks like input field.
   - Set width to 100% for better responsiveness.
   - Added pagination with 5 items per page.
3. Using Typography.Text to make list items bold.
4. Combining description texts into a single Typography.Text component.

**Rationale:**

These changes improve the visual presentation and user experience of the image installation modal. The pagination feature helps manage long lists of images more effectively, while the styling changes create a cleaner, more modern look.

**Effects:**

Users will experience a more polished and user-friendly interface when installing images. The paginated list makes it easier to navigate through multiple images, and the bold text for image names improves readability.

**Screenshots:**
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/b1f141fd-c717-4164-8382-cc02d6bbca08.png)

**Checklist:**

- [ ] Documentation
- [ ] Test case(s) to demonstrate the difference of before/after
  • Loading branch information
agatha197 committed Oct 28, 2024
1 parent 58c5aac commit b28d645
Show file tree
Hide file tree
Showing 22 changed files with 66 additions and 27 deletions.
30 changes: 24 additions & 6 deletions react/src/components/ImageInstallModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { usePainKiller } from '../hooks/usePainKiller';
import BAIModal, { BAIModalProps } from './BAIModal';
import Flex from './Flex';
import { EnvironmentImage } from './ImageList';
import { List } from 'antd';
import { List, Typography } from 'antd';
import { Dispatch, SetStateAction } from 'react';
import { useTranslation } from 'react-i18next';

Expand Down Expand Up @@ -153,18 +153,36 @@ const ImageInstallModal: React.FC<ImageInstallModalInterface> = ({
>
<Flex direction="column" gap="md" align="start">
{hasInstalledImage ? t('environment.InstalledImagesAreExcluded') : null}
<Flex direction="column" align="start">
<Flex
direction="column"
align="start"
style={{
width: '100%',
}}
>
<List
size="small"
bordered
dataSource={imagesToInstall.map(
(image) => `${image?.registry}/${image?.name}/${image?.tag}`,
)}
renderItem={(item) => <List.Item>{item}</List.Item>}
style={{
width: '100%',
}}
renderItem={(item) => (
<List.Item>
<Typography.Text strong>{item}</Typography.Text>
</List.Item>
)}
pagination={{
pageSize: 5,
showTotal: (total) => t('general.TotalItems', { total }),
}}
/>
</Flex>
{t('environment.DescSignificantInstallTime')}
{t('dialog.ask.DoYouWantToProceed')}
<Typography.Text>
{t('environment.DescSignificantInstallTime')}&nbsp;
{t('dialog.ask.DoYouWantToProceed')}
</Typography.Text>
</Flex>
</BAIModal>
);
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@
"Extend": "Verlängern",
"RemainingLoginSessionTime": "Zeit bis zur automatischen Abmeldung",
"Change": "Ändern Sie",
"MaxValueNotification": "{{name}} muss maximal {{max}} sein"
"MaxValueNotification": "{{name}} muss maximal {{max}} sein",
"TotalItems": "Insgesamt {{Gesamt}} Artikel"
},
"credential": {
"Permission": "Genehmigung",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@
"Extend": "Επεκτείνω",
"RemainingLoginSessionTime": "Χρόνος μέχρι την αυτόματη αποσύνδεση",
"Change": "Αλλαγή",
"MaxValueNotification": "{{name}} πρέπει να είναι το μέγιστο {{max}}"
"MaxValueNotification": "{{name}} πρέπει να είναι το μέγιστο {{max}}",
"TotalItems": "Σύνολο {{total}} στοιχείων"
},
"credential": {
"Permission": "Αδεια",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,8 @@
"Extend": "Extend",
"RemainingLoginSessionTime": "Time until auto logout",
"Change": "Change",
"MaxValueNotification": "{{name}} must be maximum {{max}}"
"MaxValueNotification": "{{name}} must be maximum {{max}}",
"TotalItems": "Total {{total}} items"
},
"credential": {
"Permission": "Permission",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,8 @@
"Extend": "Extender",
"RemainingLoginSessionTime": "Tiempo hasta el cierre de sesión automático",
"Change": "Cambia",
"MaxValueNotification": "{{name}} debe ser máximo {{max}}"
"MaxValueNotification": "{{name}} debe ser máximo {{max}}",
"TotalItems": "Total {{total}} artículos"
},
"import": {
"CleanUpImportTask": "Tarea de importación de limpieza...",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,8 @@
"Extend": "Laajenna",
"RemainingLoginSessionTime": "Aika automaattiseen uloskirjautumiseen asti",
"Change": "Muuta",
"MaxValueNotification": "{{name}} on oltava maksimi {{max}}"
"MaxValueNotification": "{{name}} on oltava maksimi {{max}}",
"TotalItems": "Yhteensä {{total}} kohteita"
},
"import": {
"CleanUpImportTask": "Tuontitehtävän siivous...",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@
"Extend": "Étendre",
"RemainingLoginSessionTime": "Délai avant déconnexion automatique",
"Change": "Changer",
"MaxValueNotification": "{{nom}} doit être maximum {{max}}"
"MaxValueNotification": "{{nom}} doit être maximum {{max}}",
"TotalItems": "Total des éléments {{total}}"
},
"credential": {
"Permission": "Autorisation",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,8 @@
"Extend": "Memperpanjang",
"RemainingLoginSessionTime": "Waktu Hingga Keluar Otomatis",
"Change": "Perubahan",
"MaxValueNotification": "{{nama}} harus maksimal {{max}}"
"MaxValueNotification": "{{nama}} harus maksimal {{max}}",
"TotalItems": "Total item {{total}}"
},
"credential": {
"Permission": "Izin",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,8 @@
"Extend": "Estendere",
"RemainingLoginSessionTime": "Tempo fino alla disconnessione automatica",
"Change": "Cambiamento",
"MaxValueNotification": "{{nome}} deve essere massimo {{max}}"
"MaxValueNotification": "{{nome}} deve essere massimo {{max}}",
"TotalItems": "Totale articoli {{totale}}"
},
"credential": {
"Permission": "Autorizzazione",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@
"Extend": "伸ばす",
"RemainingLoginSessionTime": "自動ログアウトまでの時間",
"Change": "変更",
"MaxValueNotification": "{{ name }}最大値は{{ max }}です"
"MaxValueNotification": "{{ name }}最大値は{{ max }}です",
"TotalItems": "合計{{total}}項目"
},
"credential": {
"Permission": "許可",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,8 @@
"Extend": "연장",
"RemainingLoginSessionTime": "자동 로그아웃까지 남은 시간",
"Change": "변경",
"MaxValueNotification": "{{ name }} 최대 값은 {{ max }}입니다"
"MaxValueNotification": "{{ name }} 최대 값은 {{ max }}입니다",
"TotalItems": "총 {{ total }}개"
},
"credential": {
"Permission": "권한",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/mn.json
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,8 @@
"Extend": "Сунгах",
"RemainingLoginSessionTime": "Автоматаар гарах хүртэл хугацаа",
"Change": "Өөрчлөх",
"MaxValueNotification": "{{name}} хамгийн ихдээ {{max}} байх ёстой"
"MaxValueNotification": "{{name}} хамгийн ихдээ {{max}} байх ёстой",
"TotalItems": "Нийт {{total}} зүйл"
},
"credential": {
"Permission": "Зөвшөөрөл",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/ms.json
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,8 @@
"NSelected": "{{count}} item yang dipilih",
"Extend": "Panjangkan",
"Change": "Berubah",
"MaxValueNotification": "{{nama}} mestilah maksimum {{maks}}"
"MaxValueNotification": "{{nama}} mestilah maksimum {{maks}}",
"TotalItems": "Jumlah {{total}} item"
},
"credential": {
"Permission": "Kebenaran",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@
"Extend": "Rozszerzyć",
"RemainingLoginSessionTime": "Czas do automatycznego wylogowania",
"Change": "Zmiana",
"MaxValueNotification": "{{name}} musi być maksymalna {{max}}."
"MaxValueNotification": "{{name}} musi być maksymalna {{max}}.",
"TotalItems": "Łącznie {{total}} pozycji"
},
"credential": {
"Permission": "Pozwolenie",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@
"Extend": "Ampliar",
"RemainingLoginSessionTime": "Tempo até ao encerramento automático da sessão",
"Change": "Alterar",
"MaxValueNotification": "{{nome}} deve ser o máximo {{max}}"
"MaxValueNotification": "{{nome}} deve ser o máximo {{max}}",
"TotalItems": "Total de itens {{total}}"
},
"credential": {
"Permission": "Permissão",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@
"Extend": "Ampliar",
"RemainingLoginSessionTime": "Tempo até ao encerramento automático da sessão",
"Change": "Alterar",
"MaxValueNotification": "{{nome}} deve ser o máximo {{max}}"
"MaxValueNotification": "{{nome}} deve ser o máximo {{max}}",
"TotalItems": "Total de itens {{total}}"
},
"credential": {
"Permission": "Permissão",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@
"Extend": "Продлевать",
"RemainingLoginSessionTime": "Время до автоматического выхода из системы",
"Change": "Изменить",
"MaxValueNotification": "{{name}} должен быть максимальным {{max}}"
"MaxValueNotification": "{{name}} должен быть максимальным {{max}}",
"TotalItems": "Всего {{total}} предметов"
},
"credential": {
"Permission": "Разрешение",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/th.json
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,8 @@
"Extend": "ขยาย",
"RemainingLoginSessionTime": "เวลาจนกระทั่งออกจากระบบอัตโนมัติ",
"Change": "เปลี่ยน",
"MaxValueNotification": "{{name}} ต้องมีค่าสูงสุด {{max}}"
"MaxValueNotification": "{{name}} ต้องมีค่าสูงสุด {{max}}",
"TotalItems": "รวม {{total}} รายการ"
},
"credential": {
"Permission": "สิทธิ์",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@
"Extend": "Uzatmak",
"RemainingLoginSessionTime": "Otomatik Çıkışa Kadar Geçen Süre",
"Change": "Değişim",
"MaxValueNotification": "{{name}} maksimum {{max}} olmalıdır"
"MaxValueNotification": "{{name}} maksimum {{max}} olmalıdır",
"TotalItems": "Toplam {{toplam}} öğe"
},
"credential": {
"Permission": "izin",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@
"Extend": "Mở rộng",
"RemainingLoginSessionTime": "Thời gian cho đến khi tự động đăng xuất",
"Change": "Thay đổi",
"MaxValueNotification": "{{name}} phải tối đa {{max}}"
"MaxValueNotification": "{{name}} phải tối đa {{max}}",
"TotalItems": "Tổng số {{total}} mặt hàng"
},
"credential": {
"Permission": "Sự cho phép",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@
"Extend": "延长",
"RemainingLoginSessionTime": "自动注销前的时间",
"Change": "改变",
"MaxValueNotification": "{{name}} 必须是最大值 {{max}}"
"MaxValueNotification": "{{name}} 必须是最大值 {{max}}",
"TotalItems": "{{总计}}项目总数"
},
"credential": {
"Permission": "允许",
Expand Down
3 changes: 2 additions & 1 deletion resources/i18n/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@
"Extend": "延長",
"RemainingLoginSessionTime": "自动注销前的时间",
"Change": "改变",
"MaxValueNotification": "{{name}} 必须是最大值 {{max}}"
"MaxValueNotification": "{{name}} 必须是最大值 {{max}}",
"TotalItems": "{{总计}}项目总数"
},
"credential": {
"Permission": "允許",
Expand Down

0 comments on commit b28d645

Please sign in to comment.