@@ -76,7 +76,7 @@ tags: tagC"
7676 variant =" outlined"
7777 @keydown.ctrl.enter =" saveEditedCard"
7878 ></v-textarea >
79-
79+
8080 <div class =" my-4" >
8181 <div class =" d-flex align-center mb-2" >
8282 <h3 class =" text-subtitle-1 mr-2" >Tags</h3 >
@@ -87,24 +87,18 @@ tags: tagC"
8787 placeholder =" Add a tag"
8888 variant =" outlined"
8989 class =" mr-2"
90- @keydown.enter.prevent =" addTag"
90+ @keydown.enter.prevent =" addTag"
9191 @keydown.esc =" closeEditDialog"
9292 ></v-text-field >
9393 <v-btn size =" small" color =" primary" variant =" text" @click =" addTag" >Add</v-btn >
9494 </div >
9595 <div class =" d-flex flex-wrap" >
96- <v-chip
97- v-for =" tag in editedTags"
98- :key =" tag"
99- closable
100- class =" mr-1 mb-1"
101- @click:close =" removeTag(tag)"
102- >
96+ <v-chip v-for =" tag in editedTags" :key =" tag" closable class =" mr-1 mb-1" @click:close =" removeTag(tag)" >
10397 {{ tag }}
10498 </v-chip >
10599 </div >
106100 </div >
107-
101+
108102 <v-text-field
109103 v-model.number =" editedElo"
110104 label =" ELO Rating (optional)"
@@ -128,7 +122,7 @@ tags: tagC"
128122 </v-card-actions >
129123 </v-card >
130124 </v-dialog >
131-
125+
132126 <v-row >
133127 <v-col cols =" 12" >
134128 <!-- Button for initial parsing -->
@@ -166,7 +160,7 @@ tags: tagC"
166160 @click =" resetToInputStage"
167161 >
168162 <v-icon start >mdi-pencil</v-icon >
169- Edit Again
163+ Back to bulk-editor.
170164 </v-btn >
171165 <v-btn
172166 v-if =" importAttempted"
@@ -230,8 +224,7 @@ import {
230224 isValidBulkFormat ,
231225} from ' @vue-skuilder/common' ;
232226import { BlanksCardDataShapes , allCourses } from ' @vue-skuilder/courses' ;
233- import { ViewComponent } from ' @vue-skuilder/common-ui/src/composables' ;
234- import { getCurrentUser , alertUser } from ' @vue-skuilder/common-ui/src/index' ;
227+ import { ViewComponent , getCurrentUser , alertUser } from ' @vue-skuilder/common-ui' ;
235228import {
236229 getDataLayer ,
237230 CourseDBInterface ,
@@ -314,91 +307,88 @@ export default defineComponent({
314307 // The card is already removed from the parsedCards array via v-model
315308 // This method can be used for additional processing if needed
316309 console .log (` [BulkImportView] Card at index ${index } was deleted ` );
317-
310+
318311 // Show alert to confirm deletion
319312 alertUser ({
320313 text: ' Card removed from import list' ,
321- status: Status .warning , // Use warning instead of info
314+ status: Status .info ,
322315 });
323316 },
324-
317+
325318 handleEditCard(card : ParsedCard , index : number ) {
326319 // Disable keyboard shortcuts while editing
327320 if (this .$refs .cardPreviewList ) {
328- const previewComp = this .$refs .cardPreviewList as { toggleShortcuts: (enable : boolean ) => void };
329- previewComp .toggleShortcuts (false );
321+ (this .$refs .cardPreviewList as any ).toggleShortcuts (false );
330322 }
331-
323+
332324 this .editingCard = { ... card }; // Create a copy
333325 this .editingCardIndex = index ;
334326 this .editedMarkdown = card .markdown ;
335327 this .editedTags = [... card .tags ];
336328 this .editedElo = card .elo ;
337329 this .showEditDialog = true ;
338-
330+
339331 // Focus the text area after dialog opens
340332 this .$nextTick (() => {
341333 if (this .$refs .markdownTextarea ) {
342- const textareaComp = this .$refs .markdownTextarea as { $el: HTMLElement ; focus? : () => void };
343- textareaComp .$el .querySelector (' textarea' )?.focus ();
334+ (this .$refs .markdownTextarea as any ).$el .querySelector (' textarea' )?.focus ();
344335 }
345336 });
346337 },
347-
338+
348339 saveEditedCard() {
349340 if (this .editingCardIndex < 0 || ! this .editingCard ) return ;
350-
341+
351342 // Create updated card
352343 const updatedCard: ParsedCard = {
353344 markdown: this .editedMarkdown ,
354345 tags: this .editedTags ,
355346 elo: this .editedElo ,
356347 };
357-
348+
358349 // Update the card in the array
359350 const updatedCards = [... this .parsedCards ];
360351 updatedCards [this .editingCardIndex ] = updatedCard ;
361352 this .parsedCards = updatedCards ;
362-
353+
363354 // Reset editing state
364355 this .closeEditDialog ();
365-
356+
366357 // Show alert to confirm edit
367358 alertUser ({
368359 text: ' Card updated successfully' ,
369- status: Status .ok ,
360+ status: Status .success ,
370361 });
371362 },
372-
363+
373364 closeEditDialog() {
374365 this .showEditDialog = false ;
375366 this .editingCard = null ;
376367 this .editingCardIndex = - 1 ;
377368 this .editedMarkdown = ' ' ;
378369 this .editedTags = [];
379370 this .editedElo = undefined ;
380-
371+
381372 // Re-enable keyboard shortcuts after editing
382373 setTimeout (() => {
383374 if (this .$refs .cardPreviewList ) {
384- const previewComp = this .$refs .cardPreviewList as { toggleShortcuts: (enable : boolean ) => void };
385- previewComp .toggleShortcuts (true );
375+ (this .$refs .cardPreviewList as any ).toggleShortcuts (true );
386376 }
387377 }, 100 );
388378 },
389-
379+
390380 addTag() {
391381 const newTag = this .newTagText .trim ();
392382 if (newTag && ! this .editedTags .includes (newTag )) {
393383 this .editedTags .push (newTag );
394384 this .newTagText = ' ' ;
395385 }
396386 },
397-
387+
398388 removeTag(tag : string ) {
399- this .editedTags = this .editedTags .filter (t => t !== tag );
389+ this .editedTags = this .editedTags .filter (( t ) => t !== tag );
400390 },
401-
391+
402392 initializeCardPreviewComponents() {
403393 // Use the first data shape from the course config
404394 const configDataShape = this .courseCfg ?.dataShapes ?.[0 ];
@@ -592,7 +582,7 @@ export default defineComponent({
592582 // this.bulkText = ''; // Clear input text
593583 // this.parsingComplete = false; // Go back to input stage
594584 // this.parsedCards = [];
595- alertUser ({ text: ` ${this .results .length } card(s) imported successfully! ` , status: Status .ok });
585+ alertUser ({ text: ` ${this .results .length } card(s) imported successfully! ` , status: Status .success });
596586 } else if (this .results .some ((r ) => r .status === ' error' )) {
597587 alertUser ({ text: ' Some cards failed to import. Please review the results below.' , status: Status .warning });
598588 }
0 commit comments