@@ -2,7 +2,7 @@ import {reactive} from 'vue';
22import { GET , POST } from '../../modules/fetch.ts' ;
33import { showErrorToast } from '../../modules/toast.ts' ;
44
5- type WorkflowFiltersState = {
5+ type WorkflowFilters = {
66 issue_type : string ;
77 source_column : string ;
88 target_column : string ;
@@ -11,22 +11,22 @@ type WorkflowFiltersState = {
1111
1212type WorkflowIssueStateAction = '' | 'close' | 'reopen' ;
1313
14- type WorkflowActionsState = {
14+ type WorkflowActions = {
1515 column : string ;
1616 add_labels : string [ ] ;
1717 remove_labels : string [ ] ;
1818 issue_state : WorkflowIssueStateAction ;
1919} ;
2020
2121type WorkflowDraftState = {
22- filters : WorkflowFiltersState ;
23- actions : WorkflowActionsState ;
22+ filters : WorkflowFilters ;
23+ actions : WorkflowActions ;
2424} ;
2525
26- const createDefaultFilters = ( ) : WorkflowFiltersState => ( { issue_type : '' , source_column : '' , target_column : '' , labels : [ ] } ) ;
27- const createDefaultActions = ( ) : WorkflowActionsState => ( { column : '' , add_labels : [ ] , remove_labels : [ ] , issue_state : '' } ) ;
26+ const createDefaultFilters = ( ) : WorkflowFilters => ( { issue_type : '' , source_column : '' , target_column : '' , labels : [ ] } ) ;
27+ const createDefaultActions = ( ) : WorkflowActions => ( { column : '' , add_labels : [ ] , remove_labels : [ ] , issue_state : '' } ) ;
2828
29- function convertFilters ( workflow : any ) : WorkflowFiltersState {
29+ function convertFilters ( workflow : any ) : WorkflowFilters {
3030 const filters = createDefaultFilters ( ) ;
3131 if ( workflow ?. filters && Array . isArray ( workflow . filters ) ) {
3232 for ( const filter of workflow . filters ) {
@@ -44,7 +44,7 @@ function convertFilters(workflow: any): WorkflowFiltersState {
4444 return filters ;
4545}
4646
47- function convertActions ( workflow : any ) : WorkflowActionsState {
47+ function convertActions ( workflow : any ) : WorkflowActions {
4848 const actions = createDefaultActions ( ) ;
4949
5050 if ( workflow ?. actions && Array . isArray ( workflow . actions ) ) {
@@ -66,14 +66,14 @@ function convertActions(workflow: any): WorkflowActionsState {
6666 return actions ;
6767}
6868
69- const cloneFilters = ( filters : WorkflowFiltersState ) : WorkflowFiltersState => ( {
69+ const cloneFilters = ( filters : WorkflowFilters ) : WorkflowFilters => ( {
7070 issue_type : filters . issue_type ,
7171 source_column : filters . source_column ,
7272 target_column : filters . target_column ,
7373 labels : Array . from ( filters . labels ) ,
7474} ) ;
7575
76- const cloneActions = ( actions : WorkflowActionsState ) : WorkflowActionsState => ( {
76+ const cloneActions = ( actions : WorkflowActions ) : WorkflowActions => ( {
7777 column : actions . column ,
7878 add_labels : Array . from ( actions . add_labels ) ,
7979 remove_labels : Array . from ( actions . remove_labels ) ,
@@ -101,7 +101,7 @@ export function createWorkflowStore(props: any) {
101101 return store . workflowDrafts [ eventId ] ;
102102 } ,
103103
104- updateDraft ( eventId : string , filters : WorkflowFiltersState , actions : WorkflowActionsState ) {
104+ updateDraft ( eventId : string , filters : WorkflowFilters , actions : WorkflowActions ) {
105105 store . workflowDrafts [ eventId ] = {
106106 filters : cloneFilters ( filters ) ,
107107 actions : cloneActions ( actions ) ,
0 commit comments