Skip to content

Commit

Permalink
feat: added delete intelligence confirmation modal
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiantela committed Jan 4, 2024
1 parent b3c62e3 commit e9dd719
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 12 deletions.
48 changes: 39 additions & 9 deletions src/components/repository/home/HomeRepositoryCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,18 @@
</div>
</unnnic-dropdown-item>

<unnnic-dropdown-item>
<!--
waiting backend for integration
<unnnic-dropdown-item @click="isDeleteIntelligenceConfirmationOpen = true">
<div class="unnnic-card-intelligence__header__buttons__dropdown">
<unnnic-icon-svg size="sm" icon="delete" scheme="feedback-red"/>
<div :style="{color: '#E53E3E'}">
<!-- {{
$tc(
"webapp.intelligences_lib.show_languages",
this.repositoryDetail.available_languages.length
)
}} -->
Excluir inteligência
{{ $t('intelligences.delete_intelligence') }}
</div>
</div>
</unnnic-dropdown-item>
</unnnic-dropdown-item> -->

</div>

Expand Down Expand Up @@ -344,6 +342,37 @@
:name="repositoryDetail.name"
:intelligence-uuid="repositoryDetail.uuid"
/>

<unnnic-modal
:showModal="isDeleteIntelligenceConfirmationOpen"
:text="$t('intelligences.delete_intelligence')"
scheme="aux-red-500"
modal-icon="error"
@close="isDeleteIntelligenceConfirmationOpen = false"
>
<span
slot="message"
v-html="
$t('intelligences.delete_intelligence_confirmation_modal_description', {
name: repositoryDetail.name
})
"
></span>

<unnnic-button
slot="options"
type="tertiary"
@click="isDeleteIntelligenceConfirmationOpen = false"
>
{{ $t("cancel") }}
</unnnic-button>
<unnnic-button
slot="options"
type="warning"
>
{{ $t("delete") }}
</unnnic-button>
</unnnic-modal>
</div>
</template>

Expand All @@ -369,6 +398,7 @@ export default {
notificationModalMessage: '',
selectedIntelligence: '',
isViewBasesOpen: false,
isDeleteIntelligenceConfirmationOpen: false,
};
},
props: {
Expand Down
6 changes: 5 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"delete": "Delete",
"cancel": "Cancel",
"announcements": {
"new_artificial_intelligence_module_is_here": "The new Artificial Intelligence module is here! Explore what's new and learn how to create even more amazing chatbots!"
},
Expand All @@ -12,7 +14,9 @@
"no_intelligence_added": "No Intelligence added",
"view_bases": "Visualizar bases",
"sidebar_view_content_bases_title": "{name}'s content bases",
"sidebar_view_content_bases_description": "Visualize the content bases that are part of this AI."
"sidebar_view_content_bases_description": "View the content bases that are part of this AI.",
"delete_intelligence": "Delete Intelligence",
"delete_intelligence_confirmation_modal_description": "Are you sure you want to delete <b>{name}</b> intelligence?<br>This action cannot be reversed."
},
"webapp": {
"layout": {
Expand Down
6 changes: 5 additions & 1 deletion src/locales/es.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"delete": "Eliminar",
"cancel": "Cancelar",
"announcements": {
"new_artificial_intelligence_module_is_here": "¡Ya está aquí el nuevo módulo de Inteligencia Artificial! Explora las novedades y aprende a crear chatbots aún más increíbles."
},
Expand All @@ -12,7 +14,9 @@
"no_intelligence_added": "Ninguna Inteligencia añadida",
"view_bases": "Visualizar bases",
"sidebar_view_content_bases_title": "Bases de contenidos de {name}",
"sidebar_view_content_bases_description": "Visualizar las bases de contenidos que forman parte de esta IA."
"sidebar_view_content_bases_description": "Visualizar las bases de contenidos que forman parte de esta IA.",
"delete_intelligence": "Eliminar Inteligencia",
"delete_intelligence_confirmation_modal_description": "¿Está seguro de que quiere excluir a la inteligencia <b>{name}</b>?<br>Esta acción no puede ser revertida."
},
"webapp": {
"layout": {
Expand Down
6 changes: 5 additions & 1 deletion src/locales/pt_br.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"delete": "Excluir",
"cancel": "Cancelar",
"announcements": {
"new_artificial_intelligence_module_is_here": "Chegou o novo módulo de Inteligência Artificial! Explore as novidades e saiba como criar chatbots ainda mais incríveis!"
},
Expand All @@ -12,7 +14,9 @@
"no_intelligence_added": "Nenhuma Inteligência adicionada",
"view_bases": "Visualizar bases",
"sidebar_view_content_bases_title": "Bases de conteúdo de {name}",
"sidebar_view_content_bases_description": "Visualize as bases de conteúdo que fazem parte dessa IA."
"sidebar_view_content_bases_description": "Visualize as bases de conteúdo que fazem parte dessa IA.",
"delete_intelligence": "Excluir Inteligência",
"delete_intelligence_confirmation_modal_description": "Tem certeza que deseja excluir a inteligência <b>{name}</b>?<br>Essa ação não poderá ser revertida."
},
"webapp": {
"layout": {
Expand Down

0 comments on commit e9dd719

Please sign in to comment.