Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix [Job Inputs, Job Artifacts] opening a new tab outside the dashboard #339

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/components/DetailsArtifacts/detailsArtifacts.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ export const generateArtifactsPreviewContent = (selectedJob, artifacts) => {
}

export const generateArtifactsTabContent = (artifacts, params, iteration, showArtifact) => {
return artifacts.map((artifact, index) => {
return artifacts.map(artifact => {
const artifactScreenLinks = {
model: `/projects/${params.projectName || artifact.project}/models/${MODELS_TAB}/${
model: `${process.env.PUBLIC_URL}/projects/${params.projectName || artifact.project}/models/${MODELS_TAB}/${
artifact.db_key || artifact.key
}/${artifact.tag ? artifact.tag : artifact.tree ?? TAG_FILTER_LATEST}${
}/${artifact.tag ? artifact.tag : (artifact.tree ?? TAG_FILTER_LATEST)}${
iteration ? `/${iteration}` : ''
}/overview`,
dataset: `/projects/${params.projectName || artifact.project}/${DATASETS_TAB}/${artifact.db_key || artifact.key}/${
artifact.tag ? artifact.tag : artifact.tree ?? TAG_FILTER_LATEST
dataset: `${process.env.PUBLIC_URL}/projects/${params.projectName || artifact.project}/${DATASETS_TAB}/${artifact.db_key || artifact.key}/${
artifact.tag ? artifact.tag : (artifact.tree ?? TAG_FILTER_LATEST)
}${iteration ? `/${iteration}` : ''}/overview`
}

Expand Down Expand Up @@ -120,11 +120,10 @@ export const generateArtifactsTabContent = (artifacts, params, iteration, showAr
<CopyToClipboard textToCopy={artifact.target_path} tooltipText="Copy path" />
<RoundedIcon tooltipText="Show Details" id="show-details">
<Link
target="_blank"
to={
artifactScreenLinks[artifact.kind] ??
`/projects/${params.projectName || artifact.project}/files/${artifact.db_key || artifact.key}/${
artifact.tag ? artifact.tag : artifact.tree ?? TAG_FILTER_LATEST
`${process.env.PUBLIC_URL}/projects/${params.projectName || artifact.project}/files/${artifact.db_key || artifact.key}/${
artifact.tag ? artifact.tag : (artifact.tree ?? TAG_FILTER_LATEST)
}${iteration ? `/${iteration}` : ''}/overview`
}
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/DetailsInputs/detailsInputs.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const generateInputsTabContent = (inputs, showArtifact) => {
disabled={!input.ui.isShowDetailsActive}
>
{input.ui.isShowDetailsActive ? (
<Link target="_blank" to={input.ui.inputResourceLink}>
<Link to={input.ui.inputResourceLink}>
<DetailsIcon />
</Link>
) : (
Expand Down
18 changes: 12 additions & 6 deletions src/utils/generateStoreResourceLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ illegal under applicable law, and the grant of the foregoing license
under the Apache 2.0 license is conditioned upon your compliance with
such restriction.
*/
import { DATASETS_TAB, FEATURE_VECTORS_TAB, FILES_TAB, MODELS_TAB, TAG_FILTER_LATEST } from '../constants'
import {
DATASETS_TAB,
FEATURE_VECTORS_TAB,
FILES_TAB,
MODELS_TAB,
TAG_FILTER_LATEST
} from '../constants'

export const generateStoreResourceLink = (input, projectName) => {
if ([MODELS_TAB, DATASETS_TAB].includes(input.kind)) {
Expand All @@ -27,17 +33,17 @@ export const generateStoreResourceLink = (input, projectName) => {
}

const inputsLinks = {
model: `/projects/${projectName}/models/${MODELS_TAB}/${
model: `${process.env.PUBLIC_URL}/projects/${projectName}/models/${MODELS_TAB}/${
input.db_key || input.key
}/${input.tag ?? input.tree ?? TAG_FILTER_LATEST}${input.iter ? `/${input.iter}` : ''}/overview`,
dataset: `/projects/${projectName}/${DATASETS_TAB}/${
dataset: `${process.env.PUBLIC_URL}/projects/${projectName}/${DATASETS_TAB}/${
input.db_key || input.key
}/${input.tag ?? input.tree ?? TAG_FILTER_LATEST}${input.iter ? `/${input.iter}` : ''}/overview`,
files: `/projects/${projectName}/${FILES_TAB}/${input.db_key || input.key}/${input.tag ?? input.tree ?? TAG_FILTER_LATEST}${
files: `${process.env.PUBLIC_URL}/projects/${projectName}/${FILES_TAB}/${input.db_key || input.key}/${input.tag ?? input.tree ?? TAG_FILTER_LATEST}${
input.iter ? `/${input.iter}` : ''
}/overview`,
FeatureVector: `/projects/${projectName}/feature-store/${FEATURE_VECTORS_TAB}/${input.name ?? input.key}/${input.tag ?? input.uid ?? TAG_FILTER_LATEST}/overview`
FeatureVector: `${process.env.PUBLIC_URL}/projects/${projectName}/feature-store/${FEATURE_VECTORS_TAB}/${input.name ?? input.key}/${input.tag ?? input.uid ?? TAG_FILTER_LATEST}/overview`
}

return input ? inputsLinks[input.kind] ?? inputsLinks.files : ''
return input ? (inputsLinks[input.kind] ?? inputsLinks.files) : ''
}
Loading