Skip to content

Commit

Permalink
DOCK-2533-followup: Fix regex in Register Workflow dialog (#2028)
Browse files Browse the repository at this point in the history
* fix regex

* fix test

* added $

* added $
  • Loading branch information
hyunnaye authored Oct 8, 2024
1 parent 3683f63 commit 88a2a0f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/app/descriptor-languages/CWL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const extendedCWL: ExtendedDescriptorLanguageBean = {
shortFriendlyName: 'CWL',
friendlyName: 'Common Workflow Language',
defaultDescriptorPath: '/Dockstore.cwl',
descriptorPathPattern: '^/([^/?:*|<>]+/)*[^/?:*|<>]+.(cwl|yaml|yml)',
descriptorPathPattern: '^\\/([^\\/?:*\\|<>]+\\/)*[^\\/?:*\\|<>]+.(cwl|yaml|yml)$',
descriptorPathPlaceholder: 'e.g. /Dockstore.cwl',
toolDescriptorEnum: ToolDescriptor.TypeEnum.CWL,
workflowDescriptorEnum: Workflow.DescriptorTypeEnum.CWL,
Expand Down
2 changes: 1 addition & 1 deletion src/app/descriptor-languages/Galaxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const extendedGalaxy: ExtendedDescriptorLanguageBean = {
shortFriendlyName: 'Galaxy',
friendlyName: 'Galaxy Workflow Format',
defaultDescriptorPath: '/workflow-name.yml',
descriptorPathPattern: '^/([^/?:*|<>]+/)*[^/?:*|<>]+.(ga|yaml|yml)',
descriptorPathPattern: '^\\/([^\\/?:*\\|<>]+\\/)*[^\\/?:*\\|<>]+.(ga|yaml|yml)$',
descriptorPathPlaceholder: 'e.g. /workflow-name.yml',
toolDescriptorEnum: ToolDescriptor.TypeEnum.GALAXY,
workflowDescriptorEnum: Workflow.DescriptorTypeEnum.Gxformat2,
Expand Down
2 changes: 1 addition & 1 deletion src/app/descriptor-languages/Jupyter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const extendedJupyter: ExtendedDescriptorLanguageBean = {
shortFriendlyName: 'Jupyter',
friendlyName: 'Jupyter notebook',
defaultDescriptorPath: '/notebook.ipynb',
descriptorPathPattern: '^/([^/?:*|<>]+/)*[^/?:*|<>]+.ipynb$',
descriptorPathPattern: '^^\\/([^\\/?:*\\|<>]+\\/)*[^\\/?:*\\|<>]+.ipynb$',
descriptorPathPlaceholder: 'e.g. /notebook.ipynb',
toolDescriptorEnum: ToolDescriptor.TypeEnum.JUPYTER,
workflowDescriptorEnum: Workflow.DescriptorTypeEnum.Jupyter,
Expand Down
2 changes: 1 addition & 1 deletion src/app/descriptor-languages/Nextflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const extendedNFL: ExtendedDescriptorLanguageBean = {
shortFriendlyName: 'Nextflow',
friendlyName: 'Nextflow',
defaultDescriptorPath: '/nextflow.config',
descriptorPathPattern: '^/([^/?:*|<>]+/)*[^/?:*|<>]+.(config)',
descriptorPathPattern: '^\\/([^\\/?:*\\|<>]+\\/)*[^\\/?:*\\|<>]+.(config)$',
descriptorPathPlaceholder: 'e.g. /nextflow.config',
toolDescriptorEnum: ToolDescriptor.TypeEnum.NFL,
workflowDescriptorEnum: Workflow.DescriptorTypeEnum.NFL,
Expand Down
2 changes: 1 addition & 1 deletion src/app/descriptor-languages/Snakemake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const extendedSMK: ExtendedDescriptorLanguageBean = {
shortFriendlyName: 'Snakemake',
friendlyName: 'Snakemake',
defaultDescriptorPath: '/Snakefile',
descriptorPathPattern: '^/([^/?:*|<>]++/)*(Snakefile|[^./?:*|<>]++.smk))$',
descriptorPathPattern: '^\\/([^\\/?:*\\|<>]+\\/)*(Snakefile|[^.\\/?:*\\|<>]+.smk)$',
descriptorPathPlaceholder: 'e.g. /Snakefile',

toolDescriptorEnum: ToolDescriptor.TypeEnum.SMK,
Expand Down
2 changes: 1 addition & 1 deletion src/app/descriptor-languages/WDL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const extendedWDL: ExtendedDescriptorLanguageBean = {
shortFriendlyName: 'WDL',
friendlyName: 'Workflow Description Language',
defaultDescriptorPath: '/Dockstore.wdl',
descriptorPathPattern: '^/([^/?:*|<>]+/)*[^/?:*|<>]+.wdl$',
descriptorPathPattern: '^\\/([^\\/?:*\\|<>]+\\/)*[^\\/?:*\\|<>]+.wdl$',
descriptorPathPlaceholder: 'e.g. /Dockstore.wdl',
toolDescriptorEnum: ToolDescriptor.TypeEnum.WDL,
workflowDescriptorEnum: Workflow.DescriptorTypeEnum.WDL,
Expand Down
8 changes: 4 additions & 4 deletions src/app/shared/entry/descriptor-language.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ describe('Service: DescriptorLanguage', () => {
metadataServiceSpy.getDescriptorLanguages.and.returnValue(observableOf(descriptorLanguageBeans));
const descriptorLanguageService = new DescriptorLanguageService(metadataServiceSpy, workflowQuerySpy);
let placeholder = descriptorLanguageService.getDescriptorPattern(ToolDescriptor.TypeEnum.SMK);
expect(placeholder).toEqual('^/([^/?:*|<>]++/)*(Snakefile|[^./?:*|<>]++.smk))$');
expect(placeholder).toEqual('^\\/([^\\/?:*\\|<>]+\\/)*(Snakefile|[^.\\/?:*\\|<>]+.smk)$');
placeholder = descriptorLanguageService.getDescriptorPattern(ToolDescriptor.TypeEnum.CWL);
expect(placeholder).toEqual('^/([^/?:*|<>]+/)*[^/?:*|<>]+.(cwl|yaml|yml)');
expect(placeholder).toEqual('^\\/([^\\/?:*\\|<>]+\\/)*[^\\/?:*\\|<>]+.(cwl|yaml|yml)$');
placeholder = descriptorLanguageService.getDescriptorPattern(ToolDescriptor.TypeEnum.WDL);
expect(placeholder).toEqual('^/([^/?:*|<>]+/)*[^/?:*|<>]+.wdl$');
expect(placeholder).toEqual('^\\/([^\\/?:*\\|<>]+\\/)*[^\\/?:*\\|<>]+.wdl$');
placeholder = descriptorLanguageService.getDescriptorPattern(ToolDescriptor.TypeEnum.NFL);
expect(placeholder).toEqual('^/([^/?:*|<>]+/)*[^/?:*|<>]+.(config)');
expect(placeholder).toEqual('^\\/([^\\/?:*\\|<>]+\\/)*[^\\/?:*\\|<>]+.(config)$');
placeholder = descriptorLanguageService.getDescriptorPattern(ToolDescriptor.TypeEnum.SERVICE);
expect(placeholder).toEqual('.*');
placeholder = descriptorLanguageService.getDescriptorPattern(<ToolDescriptor.TypeEnum>'UnrecognizedType');
Expand Down

0 comments on commit 88a2a0f

Please sign in to comment.