Skip to content

Commit d9f1d15

Browse files
committed
refactor: simplify BulkSearchControls activeStep logic, remove watchers, update styling
1 parent f20a79a commit d9f1d15

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed

openlibrary/components/BulkSearch/components/BulkSearchControls.vue

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,18 @@ export default {
169169
loadingMatchedBooks: false,
170170
matchBooksDisabled: true,
171171
createListDisabled: true,
172-
activeStep: 1,
173172
}
174173
},
175174
computed: {
175+
activeStep() {
176+
if (!this.createListDisabled) {
177+
return 3;
178+
} else if (!this.matchBooksDisabled) {
179+
return 2;
180+
} else {
181+
return 1;
182+
}
183+
},
176184
showApiKey(){
177185
if (this.bulkSearchState.activeExtractor) return 'model' in this.bulkSearchState.activeExtractor
178186
return false
@@ -195,22 +203,6 @@ export default {
195203
if (newValue!==''){
196204
this.bulkSearchState.inputText = newValue;
197205
}
198-
},
199-
matchBooksDisabled(newValue) {
200-
if (!newValue) {
201-
this.activeStep = 2;
202-
this.$nextTick(() => {
203-
this.$refs.step2?.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' });
204-
});
205-
}
206-
},
207-
createListDisabled(newValue) {
208-
if (!newValue) {
209-
this.activeStep = 3;
210-
this.$nextTick(() => {
211-
this.$refs.step3?.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' });
212-
});
213-
}
214206
}
215207
},
216208
methods: {
@@ -288,6 +280,12 @@ textarea {
288280
display:flex;
289281
column-gap:16px;
290282
flex-shrink:0;
283+
border: 1px solid transparent;
284+
border-bottom: 5px solid transparent;
285+
286+
&.activeStep {
287+
border-color: #0376B8;
288+
}
291289
.info{
292290
display:flex;
293291
flex-direction:column;
@@ -341,12 +339,6 @@ textarea {
341339
opacity:50%;
342340
}
343341
344-
.activeStep{
345-
border: 1px solid #0376B8;
346-
border-bottom: 5px solid #0376B8;
347-
}
348-
349-
350342
.api-key-bar{
351343
width:100%;
352344
box-sizing:border-box;

openlibrary/components/BulkSearch/components/MatchRow.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ th {
6060
align-items: center;
6161
overflow-x:auto;
6262
scrollbar-width:thin;
63+
64+
.book-card--primary {
65+
margin-right: 20px;
66+
}
6367
}
6468
6569

0 commit comments

Comments
 (0)