Skip to content

Commit

Permalink
remove all train components
Browse files Browse the repository at this point in the history
  • Loading branch information
leire committed Jun 12, 2024
1 parent 7251ab5 commit 097083a
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 199 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@
@breadcrumb-action="$emit('breadcrumb-action', $event)"
/>
<template v-if="datasetId">
<BaseButton
ref="trainButtonRef"
class="header__button small"
@on-click="onClickTrain"
v-if="isAdminOrOwnerRole && showTrainButton"
>
<svgicon name="code" width="20" height="20" />Train
</BaseButton>
<NuxtLink
v-if="showSettingButton"
:to="{ name: 'dataset-id-settings', params: { id: this.datasetId } }"
Expand All @@ -39,10 +31,6 @@ export default {
type: Array,
default: () => [],
},
showTrainButton: {
type: Boolean,
default: false,
},
showSettingButton: {
type: Boolean,
default: false,
Expand All @@ -52,35 +40,8 @@ export default {
default: false,
},
},
methods: {
onClickTrain() {
this.$emit("on-click-train");
},
},
setup() {
return useRole();
},
};
</script>

<style lang="scss" scoped>
$header-button-color: #262a2e;
.header__button {
background: $header-button-color;
color: palette(white);
margin-right: $base-space;
padding: 10px 12px 10px 10px;
font-weight: 600;
@include font-size(14px);
box-shadow: $shadow-200;
@include media("<=tablet") {
display: none;
}
&:hover {
background: lighten($header-button-color, 3%);
}
svg {
fill: palette(white);
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const options = {
},
],
datasetId: "65931567-0b51-4e74-9aff-834c32a3d898",
showTrainButton: true,
},
};

Expand All @@ -41,52 +40,4 @@ describe("HeaderFeedbackTask", () => {

expect(wrapper.is(HeaderFeedbackTask)).toBeTruthy();
});

describe("Train button", () => {
describe("show when", () => {
test("render Train button if user role is admin or owner", () => {
jest.spyOn(useRole, "useRole").mockReturnValue({
isAdminOrOwnerRole: true,
});

const wrapper = shallowMount(HeaderFeedbackTask, options);

expect(
wrapper.findComponent({ ref: "trainButtonRef" }).exists()
).toBeTruthy();
});
});

describe("hide when", () => {
test("no render Train button if user role is not admin or owner", () => {
jest.spyOn(useRole, "useRole").mockReturnValue({
isAdminOrOwnerRole: false,
});

const wrapper = shallowMount(HeaderFeedbackTask, options);

expect(
wrapper.findComponent({ ref: "trainButtonRef" }).exists()
).toBeFalsy();
});

test("no render Train button if showTrainButton is false", () => {
jest.spyOn(useRole, "useRole").mockReturnValue({
isAdminOrOwnerRole: true,
});

const wrapper = shallowMount(HeaderFeedbackTask, {
...options,
propsData: {
...options.propsData,
showTrainButton: false,
},
});

expect(
wrapper.findComponent({ ref: "trainButtonRef" }).exists()
).toBeFalsy();
});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ describe("AnnotationModePage", () => {
"DatasetFilters",
"PaginationFeedbackTask",
"BaseModal",
"DatasetTrainComponent",
"BaseLoading",
"PersistentStorageBanner",
],
Expand Down Expand Up @@ -65,7 +64,6 @@ describe("AnnotationModePage", () => {
"DatasetFilters",
"PaginationFeedbackTask",
"BaseModal",
"DatasetTrainComponent",
"BaseLoading",
"PersistentStorageBanner",
],
Expand Down
26 changes: 0 additions & 26 deletions argilla-frontend/pages/dataset/_id/annotation-mode/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,9 @@
:key="datasetId"
:datasetId="datasetId"
:breadcrumbs="breadcrumbs"
:showTrainButton="true"
:showSettingButton="true"
:showCopyButton="true"
@on-click-train="showTrainModal(true)"
/>
<BaseModal
:modal-custom="true"
:prevent-body-scroll="true"
modal-class="modal-auto"
modal-position="modal-top-center"
:modal-visible="visibleTrainModal"
allow-close
@close-modal="showTrainModal(false)"
>
<DatasetTrain
:datasetName="dataset.name"
:workspaceName="dataset.workspace"
/>
</BaseModal>
</template>
<template v-slot:center>
<PersistentStorageBanner />
Expand All @@ -44,16 +28,6 @@ export default {
components: {
AnnotationPage,
},
data() {
return {
visibleTrainModal: false,
};
},
methods: {
showTrainModal(value) {
this.visibleTrainModal = value;
},
},
watch: {
"recordCriteria.committed"() {
this.updateQueryParams();
Expand Down

0 comments on commit 097083a

Please sign in to comment.