Skip to content

Commit

Permalink
Remove always disabled checkbox and commented code (#4919)
Browse files Browse the repository at this point in the history
  • Loading branch information
YohannParis authored Sep 25, 2024
1 parent 77600d4 commit 1aeb7a4
Showing 1 changed file with 1 addition and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@
<Button label="Cancel" severity="secondary" outlined @click="closeDialog" />
<Button label="Enrich" :disabled="isDialogDisabled" @click="confirm" />
</div>
<!--TODO: Overwrite is how we enrich, handle appending content in another pass-->
<div class="flex items-center">
<Checkbox v-model="overwriteContent" inputId="overwriteContent" binary disabled />
<div class="ml-3">
<label for="overwriteContent">Overwrite existing content</label>
<p class="text-subdued">If unselected, new content will be appended</p>
</div>
</div>
</template>
</tera-modal>
</template>
Expand All @@ -57,7 +49,6 @@ import { AssetType, ClientEventType, ProvenanceType, TaskStatus } from '@/types/
import { isDocumentAsset } from '@/utils/asset';
import Button from 'primevue/button';
import RadioButton from 'primevue/radiobutton';
import Checkbox from 'primevue/checkbox';
import { computed, ref, watch } from 'vue';
import { logger } from '@/utils/logger';
import { modelCard } from '@/services/goLLM';
Expand Down Expand Up @@ -92,32 +83,16 @@ enum DialogType {
const dialogType = ref<DialogType>(DialogType.ENRICH);
const isLoading = ref(false);
const isModalVisible = ref(false);
const overwriteContent = ref(true);
const selectedResourceId = ref<string>('');
const relatedDocuments = ref<Array<{ name: string; id: string }>>([]);
// Disable the dialog action button if no resources are selected
// and the dialog type is not enrichment
// Disable the dialog action button if no resources are selected and the dialog type is not enrichment
const isDialogDisabled = computed(() => {
if (dialogType.value === DialogType.ENRICH) return false;
return !selectedResourceId.value;
});
// FIXME: If we are keeping extractions, something like this may help when we add them back in
// const dialogActionCopy = computed(() => {
// let result: string = '';
// if (dialogType.value === DialogType.ENRICH) {
// result = props.assetType === AssetType.Model ? 'Enrich description' : 'Generate descriptions';
// } else if (dialogType.value === DialogType.EXTRACT) {
// result = 'Extract variables';
// }
// if (isEmpty(selectedResources.value)) {
// return result;
// }
// return `Use Document to ${result.toLowerCase()}`;
// });
const documents = computed<{ name: string; id: string }[]>(() =>
useProjects()
.getActiveProjectAssets(AssetType.Document)
Expand Down Expand Up @@ -245,8 +220,4 @@ ul {
gap: var(--gap-2);
margin-left: auto;
}
.text-subdued {
color: var(--text-color-subdued);
}
</style>

0 comments on commit 1aeb7a4

Please sign in to comment.