Skip to content

Commit

Permalink
Merge pull request #356 from weni-ai/nexus-1732-remove-sentence-sugge…
Browse files Browse the repository at this point in the history
…stions

[Nexus-1732] Process of Deprecating the Classification Artificial Intelligence: Remove Sentence Suggestions
  • Loading branch information
cristiantela authored Aug 8, 2024
2 parents 5b3fc11 + 9af19a4 commit d3458af
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1,088 deletions.
72 changes: 0 additions & 72 deletions src/components/form-generator/FormGenerator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,64 +36,6 @@
@input="update()"
/>
</b-field>
<entity-accordion
v-if="shouldShowAdvancedGroup"
:open.sync="isOpen"
>
<div slot="header" class="level">
<div class="badges-card__header">
<p
class="unnnic-form__label my-0"
>
{{ $t('webapp.settings.settings_accordion') }}
</p>
</div>
</div>
<div slot="icon" class="level example-accordion__btns-wrapper">
<unnnic-icon-svg
:icon="`${isOpen ? 'arrow-button-down-1' : 'arrow-right-1-1'}`"
scheme="neutral-cleanest"
size="xs"
/>
</div>
<div slot="body">
<div class="group">
<b-field
v-for="field in advancedGroup"
v-show="field.type !== 'hidden'"
:key="field.name"
:type="field.errors && 'is-danger'"
:class="{[`field-${field.type}`]: true}">
<div
v-if="showLabels && field.type !== 'boolean'"
slot="label"
:class="{'field-label': true, [`field-${field.type}__title`]: true}">
</div>
<div
v-if="showLabels && field.type !== 'boolean'"
slot="label"
:class="{'field-label': true, [`field-${field.type}__title`]: true}">
<unnnic-label class="my-0" :label="field.label" />
</div>
<component
:v-if="field.inputComponent"
:is="field.inputComponent"
v-bind="field.inputProps"
:label-placeholder="showLabels ? '' : field.label"
:show-max-length="showLabels"
v-model="formData[field.name]"
:initial-data="initialData[field.name]"
:label="field.label"
:fetch="field.fetch"
:help-text="hideHelp ? '' : field.helpText"
:compact="!showLabels"
:name="field.name"
@input="update()"
/>
</b-field>
</div>
</div>
</entity-accordion>
</component>
</div>
</template>
Expand Down Expand Up @@ -181,16 +123,6 @@ export default {
};
},
computed: {
shouldShowAdvancedGroup() {
const isDefault =
this.initialData.algorithm === 'transformer_network_diet_bert' &&
this.initialData.use_competing_intents === false &&
this.initialData.use_name_entities === false &&
this.initialData.use_analyze_char === false;
return !isDefault;
},
fields() {
const fields = Object.keys(this.schema)
Expand Down Expand Up @@ -222,10 +154,6 @@ export default {
})
.filter(field => !!field)
},
advancedGroup() {
const items = this.fields
return items.splice(5)
},
generalGroup() {
const items = this.fields
this.swapElements(this.fields, 2, 3)
Expand Down
85 changes: 24 additions & 61 deletions src/components/repository/sidebar/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -198,61 +198,30 @@
: 'sidebar-wrapper__body__element',
]"
/>
<section class="training-menu">
<UnnnicSidebarItem
v-if="getCurrentRepository.authorization.can_contribute"
:icon="
dropSelect === 'isTrainActive'
? 'graph-status-circle-1-1'
: 'graph-status-circle-1'
"
:text="$t('webapp.menu.training')"
:enableTooltip="!collapse"
:active="dropSelect === 'isTrainActive'"
:class="{
'sidebar-wrapper__body--dropdown-open':
dropSelect === 'isTrainActive',
'sidebar-wrapper__body__element': true,
}"
@click.native="openDropdown('isTrainActive')"
>
</UnnnicSidebarItem>
<div
v-show="dropSelect === 'isTrainActive' && collapse"
class="sidebar-wrapper__body__item"
>
<UnnnicSidebarItem
:text="$t('webapp.menu.train')"
:class="[
checkSelectedMenu('repository-training')
? 'sidebar-wrapper__body--active'
: 'sidebar-wrapper__body__element',
]"
@click="
setSelectMenu({
name: 'repository-training',
to: 'repository-training',
closeDrop: false,
})
"
/>
<UnnnicSidebarItem
:text="$t('webapp.menu.suggestion')"
:class="[
checkSelectedMenu('repository-suggestion')
? 'sidebar-wrapper__body--active'
: 'sidebar-wrapper__body__element',
]"
@click="
setSelectMenu({
name: 'repository-suggestion',
to: 'repository-suggestion',
closeDrop: false,
})
"
/>
</div>
</section>

<UnnnicSidebarItem
v-if="getCurrentRepository.authorization.can_contribute"
:icon="
checkSelectedMenu('repository-training')
? 'graph-status-circle-1-1'
: 'graph-status-circle-1'
"
:text="$t('webapp.menu.training')"
:enableTooltip="!collapse"
:active="checkSelectedMenu('repository-training')"
:class="[
checkSelectedMenu('repository-training')
? 'sidebar-wrapper__body--active'
: 'sidebar-wrapper__body__element',
]"
@click="
setSelectMenu({
name: 'repository-training',
to: 'repository-training',
closeDrop: true,
})
"
/>

<UnnnicSidebarItem
v-if="getCurrentRepository.authorization.can_contribute"
Expand Down Expand Up @@ -631,12 +600,6 @@ export default {
) {
this.dropSelect = 'isTestsActive';
}
if (
this.$router.currentRoute.name === 'repository-training' ||
this.$router.currentRoute.name === 'repository-suggestion'
) {
this.dropSelect = 'isTrainActive';
}
},
checkSelectedMenu(menu) {
return menu === this.selectedMenu;
Expand Down
6 changes: 0 additions & 6 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import RepositoryResults from '@/views/repository/Results';
import RepositoryResult from '@/views/repository/Result';
import RepositoryVersions from '@/views/repository/Versions';
import RepositoryLog from '@/views/repository/Log';
import PhraseSuggestion from '@/views/repository/PhraseSuggestion';
import Entity from '@/views/repository/Entity';
import Intent from '@/views/repository/Intent';
import NotFound from '@/views/NotFound';
Expand Down Expand Up @@ -186,11 +185,6 @@ const router = new Router({
name: 'repository-training',
component: RepositoryTrainings,
},
{
path: ':ownerNickname/:slug/suggestions/',
name: 'repository-suggestion',
component: PhraseSuggestion,
},
{
path: ':ownerNickname/:slug/database/',
name: 'repository-database',
Expand Down
Loading

0 comments on commit d3458af

Please sign in to comment.