@@ -1240,7 +1335,7 @@ export default class Tool extends localization.LocalizedReactComponent {
message={warningForLatestVersion} />
}
{
- !this.defaultTag && this.props.versions.loaded &&
+ !this.defaultTag && this.versions &&
{
- if (!this.props.tool.loaded || !this.historyAvailableForUser()) {
+ if (!this.tool || !this.historyAvailableForUser()) {
return undefined;
}
return (
@@ -1417,18 +1512,18 @@ export default class Tool extends localization.LocalizedReactComponent {
onCloseIssuePanel={this.closeIssuesPanel}
entityId={this.props.toolId}
entityClass="TOOL"
- entity={this.props.tool.value} />
+ entity={this.tool} />
}
{
this.state.metadata &&
}
{
- this.state.instanceTypesManagementPanel && (roleModel.isOwner(this.props.tool.value) || this.isAdmin()) &&
+ this.state.instanceTypesManagementPanel && (roleModel.isOwner(this.tool) || this.isAdmin()) &&
0 &&
(!additionalCriteria || additionalCriteria(parameter));
- const [versionSettings] = (this.props.versionSettings.value || [])
+ const [versionSettings] = (this.versionSettings || [])
.filter(v => v.version === version);
- const [defaultVersionSettings] = (this.props.versionSettings.value || [])
+ const [defaultVersionSettings] = (this.versionSettings || [])
.filter(v => v.version === this.defaultTag);
const versionSettingValue = (settingName) => {
if (versionSettings &&
@@ -1511,7 +1606,7 @@ export default class Tool extends localization.LocalizedReactComponent {
}
return settingsValue;
};
- const registry = this.registries.find(r => r.id === this.props.tool.value.registryId);
+ const registry = this.registries.find(r => r.id === this.tool.registryId);
const prepareParameters = (parameters) => {
const result = {};
if (parameters) {
@@ -1528,7 +1623,7 @@ export default class Tool extends localization.LocalizedReactComponent {
}
return currentUserAttributes.extendLaunchParameters(
result,
- this.props.tool.value.allowSensitive
+ this.tool.allowSensitive
);
};
const cloudRegionIdValue = parameterIsNotEmpty(versionSettingValue('cloudRegionId'))
@@ -1547,24 +1642,24 @@ export default class Tool extends localization.LocalizedReactComponent {
instanceType:
chooseDefaultValue(
versionSettingValue('instance_size'),
- this.props.tool.value.instanceType,
+ this.tool.instanceType,
this.props.preferences.getPreferenceValue('cluster.instance.type')
),
hddSize: +chooseDefaultValue(
versionSettingValue('instance_disk'),
- this.props.tool.value.disk,
+ this.tool.disk,
this.props.preferences.getPreferenceValue('cluster.instance.hdd'),
p => +p > 0
),
- timeout: +(this.props.tool.value.timeout || 0),
+ timeout: +(this.tool.timeout || 0),
cmdTemplate: chooseDefaultValue(
versionSettingValue('cmd_template'),
- this.props.tool.value.defaultCommand,
+ this.tool.defaultCommand,
this.props.preferences.getPreferenceValue('launch.cmd.template')
),
dockerImage: registry
- ? `${registry.path}/${this.props.tool.value.image}${version ? `:${version}` : ''}`
- : `${this.props.tool.value.image}${version ? `:${version}` : ''}`,
+ ? `${registry.path}/${this.tool.image}${version ? `:${version}` : ''}`
+ : `${this.tool.image}${version ? `:${version}` : ''}`,
params: prepareParameters(versionSettingValue('parameters')),
isSpot: isSpotValue,
nodeCount: parameterIsNotEmpty(versionSettingValue('node_count'))
@@ -1637,13 +1732,13 @@ export default class Tool extends localization.LocalizedReactComponent {
navigateBack = () => {
this.props.docker.fetch();
- this.props.router.push(`/tools/${this.props.tool.value.registryId}/${this.props.tool.value.toolGroupId}`);
+ this.props.router.push(`/tools/${this.tool.registryId}/${this.tool.toolGroupId}`);
};
@computed
get versionsScanResObject () {
const versions = {};
- this.props.versions.value.versions.forEach(version => {
+ this.versions.forEach(version => {
versions[version.version] = version;
});
return versions;
@@ -1651,8 +1746,7 @@ export default class Tool extends localization.LocalizedReactComponent {
@computed
get defaultTag () {
- if (this.props.versions.loaded &&
- this.props.versions.value && this.props.versions.value.versions) {
+ if (this.versions) {
const versions = this.versionsScanResObject;
if (versions['latest']) {
return 'latest';
@@ -1665,9 +1759,7 @@ export default class Tool extends localization.LocalizedReactComponent {
@computed
get anyTag () {
- if (this.props.versions.loaded &&
- this.props.versions.value &&
- this.props.versions.value.versions) {
+ if (this.versions) {
const versions = this.versionsScanResObject;
if (Object.keys(versions).length > 0) {
return Object.keys(versions)[0];
@@ -1679,8 +1771,8 @@ export default class Tool extends localization.LocalizedReactComponent {
getVersionRunningInformation = (version) => {
return getVersionRunningInfo(
version,
- this.props.versions.loaded ? this.versionsScanResObject : null,
- this.props.scanPolicy.loaded ? this.props.scanPolicy.value : null,
+ this.versions ? this.versionsScanResObject : null,
+ this.scanPolicy,
this.isAdmin(),
this.props.preferences,
this.dockerRegistry
@@ -1693,9 +1785,9 @@ export default class Tool extends localization.LocalizedReactComponent {
parameter !== undefined &&
`${parameter}`.trim().length > 0 &&
(!additionalCriteria || additionalCriteria(parameter));
- const [versionSettings] = (this.props.versionSettings.value || [])
+ const [versionSettings] = (this.versionSettings || [])
.filter(v => v.version === (version || this.defaultTag));
- const [defaultVersionSettings] = (this.props.versionSettings.value || [])
+ const [defaultVersionSettings] = (this.versionSettings || [])
.filter(v => v.version === this.defaultTag);
const versionSettingValue = (settingName) => {
if (versionSettings &&
@@ -1714,15 +1806,15 @@ export default class Tool extends localization.LocalizedReactComponent {
};
const defaultCommandIsNotEmpty =
parameterIsNotEmpty(versionSettingValue('cmd_template')) ||
- parameterIsNotEmpty(this.props.tool.value.defaultCommand) ||
+ parameterIsNotEmpty(this.tool.defaultCommand) ||
parameterIsNotEmpty(this.props.preferences.getPreferenceValue('launch.cmd.template'));
const instanceTypeIsNotEmpty =
parameterIsNotEmpty(versionSettingValue('instance_size')) ||
- parameterIsNotEmpty(this.props.tool.value.instanceType) ||
+ parameterIsNotEmpty(this.tool.instanceType) ||
parameterIsNotEmpty(this.props.preferences.getPreferenceValue('cluster.instance.type'));
const diskIsNotEmpty =
parameterIsNotEmpty(versionSettingValue('instance_disk'), p => +p > 0) ||
- parameterIsNotEmpty(this.props.tool.value.disk, p => +p > 0) ||
+ parameterIsNotEmpty(this.tool.disk, p => +p > 0) ||
parameterIsNotEmpty(
this.props.preferences.getPreferenceValue('cluster.instance.hdd'),
p => +p > 0
@@ -1910,7 +2002,7 @@ export default class Tool extends localization.LocalizedReactComponent {
);
- if (roleModel.isOwner(this.props.tool.value) || this.isAdmin()) {
+ if (roleModel.isOwner(this.tool) || this.isAdmin()) {
displayOptionsMenuItems.push(
;
}
- if (this.props.tool.error) {
- return ;
+ if (this.toolRequest && this.toolRequest.error) {
+ return ;
}
if (this.props.docker.error) {
return ;
}
- if (this.props.versionSettings.error) {
+ if (this.versionSettingsRequest && this.versionSettingsRequest.error) {
return ;
}
- if (!roleModel.readAllowed(this.props.tool.value)) {
+ if (!roleModel.readAllowed(this.tool)) {
return (
- {this.props.tool.value.image}
+ {this.tool.image}
-
+
{this.renderMenu()}
@@ -2144,10 +2236,10 @@ export default class Tool extends localization.LocalizedReactComponent {
this.renderCreateLinkButton()
}
{
- roleModel.isOwner(this.props.tool.value) && this.renderActionsMenu()
+ roleModel.isOwner(this.tool) && this.renderActionsMenu()
}
{
- roleModel.executeAllowed(this.props.tool.value) && this.renderRunButton()
+ roleModel.executeAllowed(this.tool) && this.renderRunButton()
}
@@ -2159,7 +2251,7 @@ export default class Tool extends localization.LocalizedReactComponent {
visible={this.state.createLinkFormVisible}
onSubmit={this.onCreateLink}
onClose={this.closeCreateLinkForm}
- source={this.props.tool.loaded ? this.props.tool.value : null}
+ source={this.tool || null}
/>