-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Convert to material table, allow horizontal scroll * Add some tests * Add loading bar * Move booleans into component file * Refactor * Remove unneeded style
- Loading branch information
Showing
7 changed files
with
196 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,3 @@ | |
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { inject, TestBed } from '@angular/core/testing'; | ||
import { ToolDescriptor } from '../../shared/swagger'; | ||
import { ToolTabService } from './tool-tab.service'; | ||
|
||
describe('Service: ToolTab', () => { | ||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
providers: [ToolTabService] | ||
}); | ||
}); | ||
|
||
it('should ...', inject([ToolTabService], (service: ToolTabService) => { | ||
expect(service).toBeTruthy(); | ||
})); | ||
|
||
it('should determines the correct workflow excerpt row heading', inject([ToolTabService], (service: ToolTabService) => { | ||
expect(service.descriptorTypeToWorkflowExcerptRowHeading(ToolDescriptor.TypeEnum.CWL)).toEqual('tool\xa0ID'); | ||
expect(service.descriptorTypeToWorkflowExcerptRowHeading(ToolDescriptor.TypeEnum.WDL)).toEqual('task\xa0ID'); | ||
expect(service.descriptorTypeToWorkflowExcerptRowHeading(ToolDescriptor.TypeEnum.NFL)).toEqual('process\xa0name'); | ||
expect(service.descriptorTypeToWorkflowExcerptRowHeading(<ToolDescriptor.TypeEnum>'Potato')).toEqual('tool\xa0ID'); | ||
})); | ||
|
||
it('should determines the correct workflow excerpt row heading', inject([ToolTabService], (service: ToolTabService) => { | ||
expect(service.descriptorTypeToHeaderName(ToolDescriptor.TypeEnum.CWL)).toEqual('Tool Excerpt'); | ||
expect(service.descriptorTypeToHeaderName(ToolDescriptor.TypeEnum.WDL)).toEqual('Task Excerpt'); | ||
expect(service.descriptorTypeToHeaderName(ToolDescriptor.TypeEnum.NFL)).toEqual('Process Excerpt'); | ||
expect(service.descriptorTypeToHeaderName(<ToolDescriptor.TypeEnum>'Potato')).toEqual('Tool Excerpt'); | ||
})); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { ToolDescriptor } from '../../shared/swagger'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class ToolTabService { | ||
|
||
constructor() { } | ||
|
||
/** | ||
* Determines the second column's header name. No break needed because headings are always short. | ||
* | ||
* @param {ToolDescriptor.TypeEnum} descriptorType The current workflow's descriptor type | ||
* @returns {string} The heading | ||
* @memberof ToolTabService | ||
*/ | ||
descriptorTypeToHeaderName(descriptorType: ToolDescriptor.TypeEnum): string { | ||
switch (descriptorType) { | ||
case ToolDescriptor.TypeEnum.CWL: | ||
return 'Tool Excerpt'; | ||
case ToolDescriptor.TypeEnum.WDL: | ||
return 'Task Excerpt'; | ||
case ToolDescriptor.TypeEnum.NFL: | ||
return 'Process Excerpt'; | ||
default: | ||
console.error('Unknown descriptor type found: ' + descriptorType); | ||
return 'Tool Excerpt'; | ||
} | ||
} | ||
|
||
/** | ||
* In the Workflow Excerpt column, each row will have a heading before the tool.id. | ||
* This determines that heading. | ||
* | ||
* @param {ToolDescriptor.TypeEnum} descriptorType The current workflow's descriptor type | ||
* @returns {string} The heading | ||
* @memberof ToolTabService | ||
*/ | ||
descriptorTypeToWorkflowExcerptRowHeading(descriptorType: ToolDescriptor.TypeEnum): string { | ||
switch (descriptorType) { | ||
case ToolDescriptor.TypeEnum.CWL: | ||
return 'tool\xa0ID'; | ||
case ToolDescriptor.TypeEnum.WDL: | ||
return 'task\xa0ID'; | ||
case ToolDescriptor.TypeEnum.NFL: | ||
return 'process\xa0name'; | ||
default: | ||
console.error('Unknown descriptor type found: ' + descriptorType); | ||
return 'tool\xa0ID'; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters