mirror of https://github.com/rancher/ui.git
Merge pull request #3352 from codyrancher/master
Add more context to the title of deletion modals
This commit is contained in:
commit
a7f8eabc1a
|
|
@ -8,6 +8,12 @@ import layout from './template';
|
||||||
import { eachLimit } from 'async';
|
import { eachLimit } from 'async';
|
||||||
import C from 'ui/utils/constants';
|
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, {
|
export default Component.extend(ModalBase, {
|
||||||
settings: service(),
|
settings: service(),
|
||||||
|
|
@ -101,4 +107,31 @@ export default Component.extend(ModalBase, {
|
||||||
return get(namespaces, 'length') > 0;
|
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;
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,14 @@
|
||||||
<div class="container-header-text">
|
<div class="container-header-text">
|
||||||
<h3>
|
<h3>
|
||||||
{{t "confirmDelete.title"}}:
|
{{#if resourceType}}
|
||||||
|
{{t
|
||||||
|
"confirmDelete.titleWithResourceType"
|
||||||
|
resourceType=(t (concat "confirmDelete.resourceType." resourceType))
|
||||||
|
htmlSafe=true
|
||||||
|
}}
|
||||||
|
{{else}}
|
||||||
|
{{t "confirmDelete.titleWithoutResourceType"}}
|
||||||
|
{{/if}}
|
||||||
</h3>
|
</h3>
|
||||||
<hr/>
|
<hr/>
|
||||||
{{#if isSystemProject}}
|
{{#if isSystemProject}}
|
||||||
|
|
|
||||||
|
|
@ -905,4 +905,10 @@ C.SYSTEM_CHART_APPS = [
|
||||||
'monitoring-operator',
|
'monitoring-operator',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
C.RESOURCE_TYPES = {
|
||||||
|
NAMESPACE: 'namespace',
|
||||||
|
PROJECT: 'project',
|
||||||
|
CLUSTER: 'cluster'
|
||||||
|
};
|
||||||
|
|
||||||
export default C;
|
export default C;
|
||||||
|
|
|
||||||
|
|
@ -2124,7 +2124,7 @@ resourceEventList:
|
||||||
noData: Keine Ereignisse
|
noData: Keine Ereignisse
|
||||||
noMatch: Keine Ereignisse gefunden, die den Suchkriterien entsprechen
|
noMatch: Keine Ereignisse gefunden, die den Suchkriterien entsprechen
|
||||||
confirmDelete:
|
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.'
|
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.'
|
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."
|
clusterRoleTemplateBindingNote: "Hinweis: Die Projektberechtigungen des Benutzers werden nicht entfernt."
|
||||||
|
|
|
||||||
|
|
@ -3557,7 +3557,12 @@ resourceEventList:
|
||||||
noMatch: No events match the current search
|
noMatch: No events match the current search
|
||||||
|
|
||||||
confirmDelete:
|
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}.'
|
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.'
|
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."
|
clusterRoleTemplateBindingNote: "Note: User's project permissions will not be removed."
|
||||||
|
|
|
||||||
|
|
@ -2087,7 +2087,7 @@ resourceEventList:
|
||||||
noData: No hay eventos
|
noData: No hay eventos
|
||||||
noMatch: No hay eventos de coincidencia con la búsqueda actual
|
noMatch: No hay eventos de coincidencia con la búsqueda actual
|
||||||
confirmDelete:
|
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}.'
|
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.'
|
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."
|
clusterRoleTemplateBindingNote: "Nota: los permisos de proyecto no será eliminado."
|
||||||
|
|
|
||||||
|
|
@ -1480,7 +1480,7 @@ clusterNew:
|
||||||
label: Projet
|
label: Projet
|
||||||
placeholder: p.ex. mon-projet
|
placeholder: p.ex. mon-projet
|
||||||
confirmDelete:
|
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.'
|
protip: 'Astuce Pro : Maintenez la touche {key} tout en cliquant sur Supprimer afin de contourner cette confirmation.'
|
||||||
confirmAction: Supprimer
|
confirmAction: Supprimer
|
||||||
cancelAction: Annuler
|
cancelAction: Annuler
|
||||||
|
|
|
||||||
|
|
@ -657,7 +657,7 @@ catalogSettings:
|
||||||
label: Branch
|
label: Branch
|
||||||
placeholder: 'pl. master'
|
placeholder: 'pl. master'
|
||||||
confirmDelete:
|
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.'
|
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
|
confirmAction: Törlés
|
||||||
cancelAction: Mégsem
|
cancelAction: Mégsem
|
||||||
|
|
|
||||||
|
|
@ -2012,7 +2012,7 @@ resourceEventList:
|
||||||
noData: イベントはありません
|
noData: イベントはありません
|
||||||
noMatch: 検索条件に一致するイベントはありません
|
noMatch: 検索条件に一致するイベントはありません
|
||||||
confirmDelete:
|
confirmDelete:
|
||||||
title: '本当に削除してもよろしいですか?'
|
titleWithoutResourceType: '本当に削除してもよろしいですか?'
|
||||||
environmentNote: 'ノート: このプロジェクト内にある {appName} により作られた名前空間を含むの全てのリソースは完全に削除されます'
|
environmentNote: 'ノート: このプロジェクト内にある {appName} により作られた名前空間を含むの全てのリソースは完全に削除されます'
|
||||||
clusterNote: '注意: クラウドプロバイダーにより作成されたボリューム、ロードバランサー、ネットワークなどの関連リソースは自動的には削除されません。'
|
clusterNote: '注意: クラウドプロバイダーにより作成されたボリューム、ロードバランサー、ネットワークなどの関連リソースは自動的には削除されません。'
|
||||||
protip: 'ProTip: この確認画面を飛ばす場合は削除ボタンのクリック時に {key} キーを長押ししてください。'
|
protip: 'ProTip: この確認画面を飛ばす場合は削除ボタンのクリック時に {key} キーを長押ししてください。'
|
||||||
|
|
|
||||||
|
|
@ -884,7 +884,7 @@ clusterNew:
|
||||||
ignoreDockerVersion:
|
ignoreDockerVersion:
|
||||||
label: 노드의 도커 버전
|
label: 노드의 도커 버전
|
||||||
confirmDelete:
|
confirmDelete:
|
||||||
title: '삭제하시겠습니까?'
|
titleWithoutResourceType: '삭제하시겠습니까?'
|
||||||
confirmAction: 제거
|
confirmAction: 제거
|
||||||
cancelAction: 취소
|
cancelAction: 취소
|
||||||
containerLogs:
|
containerLogs:
|
||||||
|
|
|
||||||
|
|
@ -519,7 +519,7 @@ clusterNew:
|
||||||
user:
|
user:
|
||||||
label: Brukernavn
|
label: Brukernavn
|
||||||
confirmDelete:
|
confirmDelete:
|
||||||
title: 'Er du sikker på at du ønsker å slette'
|
titleWithoutResourceType: 'Er du sikker på at du ønsker å slette'
|
||||||
confirmAction: Slett
|
confirmAction: Slett
|
||||||
cancelAction: Avbryt
|
cancelAction: Avbryt
|
||||||
containerLogs:
|
containerLogs:
|
||||||
|
|
|
||||||
|
|
@ -1975,7 +1975,7 @@ clusterNew:
|
||||||
password:
|
password:
|
||||||
label: Senha
|
label: Senha
|
||||||
confirmDelete:
|
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.'
|
protip: 'Dica: Mantenha a chave {key} enquanto clicar Delete para ignorar essa confirmação.'
|
||||||
confirmAction: Excluir
|
confirmAction: Excluir
|
||||||
cancelAction: Cancelar
|
cancelAction: Cancelar
|
||||||
|
|
|
||||||
|
|
@ -1625,7 +1625,7 @@ conditionSections:
|
||||||
noData: Нет условий
|
noData: Нет условий
|
||||||
noMatch: Никакие условия не соответствуют текущему поиску
|
noMatch: Никакие условия не соответствуют текущему поиску
|
||||||
confirmDelete:
|
confirmDelete:
|
||||||
title: 'Вы действительно хотите удалить'
|
titleWithoutResourceType: 'Вы действительно хотите удалить'
|
||||||
protip: 'Совет: удерживайте клавишу {key} во время нажатия "Удалить", чтобы обойти это подтверждение.'
|
protip: 'Совет: удерживайте клавишу {key} во время нажатия "Удалить", чтобы обойти это подтверждение.'
|
||||||
confirmAction: Удалить
|
confirmAction: Удалить
|
||||||
cancelAction: Отмена
|
cancelAction: Отмена
|
||||||
|
|
|
||||||
|
|
@ -1863,7 +1863,7 @@ resourceEventList:
|
||||||
noData: Olay yok
|
noData: Olay yok
|
||||||
noMatch: Mevcut aramayla eşleşen olay yok
|
noMatch: Mevcut aramayla eşleşen olay yok
|
||||||
confirmDelete:
|
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.'
|
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.'
|
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."
|
clusterRoleTemplateBindingNote: "Not: Kullanıcının proje izinleri kaldırılmayacak."
|
||||||
|
|
|
||||||
|
|
@ -1874,7 +1874,7 @@ resourceEventList:
|
||||||
message: Повідомлення
|
message: Повідомлення
|
||||||
noData: Немає подій
|
noData: Немає подій
|
||||||
confirmDelete:
|
confirmDelete:
|
||||||
title: 'Ви впевнені, що бажаєте видалити'
|
titleWithoutResourceType: 'Ви впевнені, що бажаєте видалити'
|
||||||
protip: 'Порада: Утримуйте клавішу {key} при натисканні Delete, щоб обійти це підтвердження.'
|
protip: 'Порада: Утримуйте клавішу {key} при натисканні Delete, щоб обійти це підтвердження.'
|
||||||
confirmAction: Видалити
|
confirmAction: Видалити
|
||||||
cancelAction: Скасувати
|
cancelAction: Скасувати
|
||||||
|
|
|
||||||
|
|
@ -3552,7 +3552,7 @@ resourceEventList:
|
||||||
noMatch: 没有事件与当前搜索匹配
|
noMatch: 没有事件与当前搜索匹配
|
||||||
|
|
||||||
confirmDelete:
|
confirmDelete:
|
||||||
title: '是否确认要删除'
|
titleWithoutResourceType: '是否确认要删除'
|
||||||
environmentNote: '注意: 此环境内的所有资源都将被永久性的删除,包括通过{appName}创建的主机。'
|
environmentNote: '注意: 此环境内的所有资源都将被永久性的删除,包括通过{appName}创建的主机。'
|
||||||
clusterNote: '注意: 在云平台中创建的关联资源(如卷,负载均衡器和网络)不会自动删除。'
|
clusterNote: '注意: 在云平台中创建的关联资源(如卷,负载均衡器和网络)不会自动删除。'
|
||||||
clusterRoleTemplateBindingNote: "注意: 此用户的权限直接添加到项目中将不会被删除."
|
clusterRoleTemplateBindingNote: "注意: 此用户的权限直接添加到项目中将不会被删除."
|
||||||
|
|
|
||||||
|
|
@ -2284,7 +2284,7 @@ resourceEventList:
|
||||||
noMatch: 沒有事件與當前搜索匹配
|
noMatch: 沒有事件與當前搜索匹配
|
||||||
|
|
||||||
confirmDelete:
|
confirmDelete:
|
||||||
title: '是否確認要刪除'
|
titleWithoutResourceType: '是否確認要刪除'
|
||||||
environmentNote: '注意: 此環境內的所有資源都將被永久性的刪除,包括通過{appName}創建的主機。'
|
environmentNote: '注意: 此環境內的所有資源都將被永久性的刪除,包括通過{appName}創建的主機。'
|
||||||
clusterNote: '注意: 在雲平台中創建的關聯資源(如卷,負載均衡器和網絡)不會自動刪除。'
|
clusterNote: '注意: 在雲平台中創建的關聯資源(如卷,負載均衡器和網絡)不會自動刪除。'
|
||||||
clusterRoleTemplateBindingNote: "注意: 此用戶的權限直接添加到項目中將不會被刪除."
|
clusterRoleTemplateBindingNote: "注意: 此用戶的權限直接添加到項目中將不會被刪除."
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue