Merge pull request #3352 from codyrancher/master

Add more context to the title of deletion modals
This commit is contained in:
Vincent Fiduccia 2019-09-13 17:13:33 -07:00 committed by GitHub
commit a7f8eabc1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 67 additions and 15 deletions

View File

@ -8,6 +8,12 @@ import layout from './template';
import { eachLimit } from 'async';
import C from 'ui/utils/constants';
function hasSomeOfResourceType(resourceType) {
console.log(get(this, 'resources'));
return get(this, 'resources')
.some((resource) => get(resource, 'type') === resourceType);
}
export default Component.extend(ModalBase, {
settings: service(),
@ -101,4 +107,31 @@ export default Component.extend(ModalBase, {
return get(namespaces, 'length') > 0;
}),
hasNamespaceResourceType: computed('resources', function() {
return hasSomeOfResourceType.call(this, C.RESOURCE_TYPES.NAMESPACE);
}),
hasProjectResourceType: computed('resources', function() {
return hasSomeOfResourceType.call(this, C.RESOURCE_TYPES.PROJECT);
}),
hasClusterResourceType: computed('resources', function() {
return hasSomeOfResourceType.call(this, C.RESOURCE_TYPES.CLUSTER);
}),
resourceType: computed('resources', function() {
if (get(this, 'hasNamespaceResourceType')) {
return C.RESOURCE_TYPES.NAMESPACE;
}
if (get(this, 'hasProjectResourceType')) {
return C.RESOURCE_TYPES.PROJECT;
}
if (get(this, 'hasClusterResourceType')) {
return C.RESOURCE_TYPES.CLUSTER;
}
return null;
}),
});

View File

@ -1,6 +1,14 @@
<div class="container-header-text">
<h3>
{{t "confirmDelete.title"}}:
{{#if resourceType}}
{{t
"confirmDelete.titleWithResourceType"
resourceType=(t (concat "confirmDelete.resourceType." resourceType))
htmlSafe=true
}}
{{else}}
{{t "confirmDelete.titleWithoutResourceType"}}
{{/if}}
</h3>
<hr/>
{{#if isSystemProject}}

View File

@ -905,4 +905,10 @@ C.SYSTEM_CHART_APPS = [
'monitoring-operator',
]
C.RESOURCE_TYPES = {
NAMESPACE: 'namespace',
PROJECT: 'project',
CLUSTER: 'cluster'
};
export default C;

View File

@ -2124,7 +2124,7 @@ resourceEventList:
noData: Keine Ereignisse
noMatch: Keine Ereignisse gefunden, die den Suchkriterien entsprechen
confirmDelete:
title: 'Sind SIe sicher, dass Sie Löschen wollen?'
titleWithoutResourceType: 'Sind SIe sicher, dass Sie Löschen wollen?'
environmentNote: 'Hinweis: Alle Ressourcen in diesem Projekt werden dauerhaft entfernt, einschließlich der durch {appName} erstellten Namespaces.'
clusterNote: 'Hinweis: Zugehörige Ressourcen wie Volumes, Balancer und Netzwerke, die im Cloud-Anbieter erstellt wurden, werden nicht automatisch entfernt.'
clusterRoleTemplateBindingNote: "Hinweis: Die Projektberechtigungen des Benutzers werden nicht entfernt."

View File

@ -3557,7 +3557,12 @@ resourceEventList:
noMatch: No events match the current search
confirmDelete:
title: 'Are you sure you want to delete'
titleWithoutResourceType: 'Are you sure you want to delete:'
titleWithResourceType: 'Are you sure you want to delete the <b>{resourceType}</b>:'
resourceType:
namespace: 'namespace'
project: 'project'
cluster: 'cluster'
environmentNote: 'Note: All resources inside this Project will be permanently removed, including any namespaces that were created through {appName}.'
clusterNote: 'Note: Associated resources such as volumes, balancers, and networks that were created in the cloud provider will not be automatically removed.'
clusterRoleTemplateBindingNote: "Note: User's project permissions will not be removed."

View File

@ -2087,7 +2087,7 @@ resourceEventList:
noData: No hay eventos
noMatch: No hay eventos de coincidencia con la búsqueda actual
confirmDelete:
title: '¿Está seguro que desea eliminar'
titleWithoutResourceType: '¿Está seguro que desea eliminar'
environmentNote: 'Nota: Todos los recursos dentro de este Proyecto se eliminará de forma permanente, incluyendo cualquier espacio de nombres que fueron creados a través de {appName}.'
clusterNote: 'Nota: Los recursos asociados como volúmenes, equilibradores y redes que se crearon en el proveedor de la nube no se eliminarán automáticamente.'
clusterRoleTemplateBindingNote: "Nota: los permisos de proyecto no será eliminado."

View File

@ -1480,7 +1480,7 @@ clusterNew:
label: Projet
placeholder: p.ex. mon-projet
confirmDelete:
title: 'Êtes-vous sûr de vouloir le supprimer'
titleWithoutResourceType: 'Êtes-vous sûr de vouloir le supprimer'
protip: 'Astuce Pro : Maintenez la touche {key} tout en cliquant sur Supprimer afin de contourner cette confirmation.'
confirmAction: Supprimer
cancelAction: Annuler

View File

@ -657,7 +657,7 @@ catalogSettings:
label: Branch
placeholder: 'pl. master'
confirmDelete:
title: 'Biztosan törölni szeretné?'
titleWithoutResourceType: 'Biztosan törölni szeretné?'
protip: 'Profi tipp: Tartsd nyomva a {key} billenytűt, miközben a Törlés-re kattintasz, hogy kikerüld a megerősítést.'
confirmAction: Törlés
cancelAction: Mégsem

View File

@ -2012,7 +2012,7 @@ resourceEventList:
noData: イベントはありません
noMatch: 検索条件に一致するイベントはありません
confirmDelete:
title: '本当に削除してもよろしいですか?'
titleWithoutResourceType: '本当に削除してもよろしいですか?'
environmentNote: 'ノート: このプロジェクト内にある {appName} により作られた名前空間を含むの全てのリソースは完全に削除されます'
clusterNote: '注意: クラウドプロバイダーにより作成されたボリューム、ロードバランサー、ネットワークなどの関連リソースは自動的には削除されません。'
protip: 'ProTip: この確認画面を飛ばす場合は削除ボタンのクリック時に {key} キーを長押ししてください。'

View File

@ -884,7 +884,7 @@ clusterNew:
ignoreDockerVersion:
label: 노드의 도커 버전
confirmDelete:
title: '삭제하시겠습니까?'
titleWithoutResourceType: '삭제하시겠습니까?'
confirmAction: 제거
cancelAction: 취소
containerLogs:

View File

@ -519,7 +519,7 @@ clusterNew:
user:
label: Brukernavn
confirmDelete:
title: 'Er du sikker på at du ønsker å slette'
titleWithoutResourceType: 'Er du sikker på at du ønsker å slette'
confirmAction: Slett
cancelAction: Avbryt
containerLogs:

View File

@ -1975,7 +1975,7 @@ clusterNew:
password:
label: Senha
confirmDelete:
title: 'Tem certeza de que deseja excluir'
titleWithoutResourceType: 'Tem certeza de que deseja excluir'
protip: 'Dica: Mantenha a chave {key} enquanto clicar Delete para ignorar essa confirmação.'
confirmAction: Excluir
cancelAction: Cancelar

View File

@ -1625,7 +1625,7 @@ conditionSections:
noData: Нет условий
noMatch: Никакие условия не соответствуют текущему поиску
confirmDelete:
title: 'Вы действительно хотите удалить'
titleWithoutResourceType: 'Вы действительно хотите удалить'
protip: 'Совет: удерживайте клавишу {key} во время нажатия "Удалить", чтобы обойти это подтверждение.'
confirmAction: Удалить
cancelAction: Отмена

View File

@ -1863,7 +1863,7 @@ resourceEventList:
noData: Olay yok
noMatch: Mevcut aramayla eşleşen olay yok
confirmDelete:
title: 'Silmek istediğinizden emin misiniz'
titleWithoutResourceType: 'Silmek istediğinizden emin misiniz'
environmentNote: 'Not: Bu Proje içindeki tüm kaynaklar, {appName} ile oluşturulan ad alanları da dahil olmak üzere kalıcı olarak silinecektir.'
clusterNote: 'Not: Bulut sağlayıcısında oluşturulan birimler, balancer''lar ve ağlar gibi ilişkili kaynaklar otomatik olarak kaldırılmaz.'
clusterRoleTemplateBindingNote: "Not: Kullanıcının proje izinleri kaldırılmayacak."

View File

@ -1874,7 +1874,7 @@ resourceEventList:
message: Повідомлення
noData: Немає подій
confirmDelete:
title: 'Ви впевнені, що бажаєте видалити'
titleWithoutResourceType: 'Ви впевнені, що бажаєте видалити'
protip: 'Порада: Утримуйте клавішу {key} при натисканні Delete, щоб обійти це підтвердження.'
confirmAction: Видалити
cancelAction: Скасувати

View File

@ -3552,7 +3552,7 @@ resourceEventList:
noMatch: 没有事件与当前搜索匹配
confirmDelete:
title: '是否确认要删除'
titleWithoutResourceType: '是否确认要删除'
environmentNote: '注意: 此环境内的所有资源都将被永久性的删除,包括通过{appName}创建的主机。'
clusterNote: '注意: 在云平台中创建的关联资源(如卷,负载均衡器和网络)不会自动删除。'
clusterRoleTemplateBindingNote: "注意: 此用户的权限直接添加到项目中将不会被删除."

View File

@ -2284,7 +2284,7 @@ resourceEventList:
noMatch: 沒有事件與當前搜索匹配
confirmDelete:
title: '是否確認要刪除'
titleWithoutResourceType: '是否確認要刪除'
environmentNote: '注意: 此環境內的所有資源都將被永久性的刪除,包括通過{appName}創建的主機。'
clusterNote: '注意: 在雲平台中創建的關聯資源(如卷,負載均衡器和網絡)不會自動刪除。'
clusterRoleTemplateBindingNote: "注意: 此用戶的權限直接添加到項目中將不會被刪除."