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

Extenders- Opening a Favorite data set results in a document path temp/_D_/Favorites/dataset(member) - the actual profile name is not included #778

Closed
Tracked by #1791
travatine opened this issue May 5, 2020 · 2 comments
Labels
enhancement New feature or request priority-low Legit issue but cosmetic or nice-to-have

Comments

@travatine
Copy link

Hi,

When a "non favorite" data set is opened, the document path is:
temp/_D_/profile name/dataset(member)

This is great as it allows extenders to parse the document path to extract profile and resource name.

However "favorite" data sets result in the profile name of "favorite" instead, e.g.
temp/_D_/favorite/dataset(member)

This makes it impossible to determine which profile was used to open the resource.

Would it be possible to include the profile name in path for favorite data set too?

I think the issue is in the openPS() call to getDocumentFilePath().


export async function openPS(node: IZoweDatasetTreeNode, previewMember: boolean, datasetProvider?: IZoweTree<IZoweDatasetTreeNode>) {
    ...
const documentFilePath = , node);

...

In get document path there is a call to getProfile:

export function getDocumentFilePath(label: string, node: IZoweTreeNode) {
    return path.join(globals.DS_DIR, "/" + getProfile(node) + "/" + appendSuffix(label) );
}

...

The cause of the problem seems to be in getProfile (). The label is used in stead of the profile name.

export function getProfile(node: IZoweTreeNode) {
    let profile = node.getSessionNode().label.trim();
    // if this is a favorite node, further extraction is necessary
    if (profile.includes("[")) {
        profile = profile.substring(profile.indexOf("[") + 1, profile.indexOf("]"));
    }
    return profile;
}

Please would it be possible to use the node getProfileName() function instead?

(That way the path would always include profile name instead of Favorite?)

Thanks.
Travis Thorne.

@venkatzhub
Copy link

I would prefer to have an API call to figure out what profile a particular resource belongs to rather than having the extenders parse the document paths.

@zdmullen zdmullen added this to the 1.9 Release milestone Jun 26, 2020
@zdmullen zdmullen modified the milestones: 1.9 Release, Developer Aug 6, 2020
@JillieBeanSim JillieBeanSim removed this from the Developer milestone Oct 6, 2022
@JillieBeanSim JillieBeanSim added the priority-low Legit issue but cosmetic or nice-to-have label Jan 25, 2023
@zFernand0 zFernand0 added the enhancement New feature or request label Mar 14, 2023
@github-actions
Copy link

Thank you for raising this issue.
The community has 90 days to upvote 👍 the issue.
If it receives 10 upvotes, we will move it to our backlog. If not, we will close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority-low Legit issue but cosmetic or nice-to-have
Projects
None yet
Development

No branches or pull requests

5 participants