Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla@contractors.roche.com>
cy.createGroup(activeUser.token, {
name: `Test root project ${Math.floor(Math.random() * 999999)}`,
group_class: 'project',
- }).as('testProject1');
+ }).as('testProject1').then((testProject1) => {
+
+ cy.shareWith(adminUser.token, activeUser.user.uuid, testCollection2.uuid, 'can_write');
+ });
cy.getAll('@testProject1').then(function([testProject1]) {
cy.loginAs(activeUser);
});
it('opens advanced popup for project with username', () => {
- const projectName = `Test root project ${Math.floor(Math.random() * 999999)}`;
-
- cy.createProject({
- owningUser: adminUser,
- targetUser: activeUser,
- projectName,
- canWrite: true,
- addToFavorites: true
- }).as('mySharedProject');
-
- cy.getAll('@mySharedProject')
- .then(function ([mySharedProject]) {
- cy.loginAs(activeUser);
+ const projectName = `Test project ${Math.floor(Math.random() * 999999)}`;
+
+ cy.createGroup(adminUser.token, {
+ name: projectName,
+ group_class: 'project',
+ }).as('mainProject')
+
+ cy.getAll('@mainProject')
+ .then(function ([mainProject]) {
+ cy.loginAs(adminUser);
- cy.get('[data-cy=side-panel-tree]').contains('Shared with me').click();
+ cy.get('[data-cy=side-panel-tree]').contains('Groups').click();
+
+ cy.get('[data-cy=uuid]').eq(0).invoke('text').then(uuid => {
+ cy.createLink(adminUser.token, {
+ name: 'can_write',
+ link_class: 'permission',
+ head_uuid: mainProject.uuid,
+ tail_uuid: uuid
+ });
- cy.get('main').contains(projectName).rightclick();
+ cy.createLink(adminUser.token, {
+ name: 'can_write',
+ link_class: 'permission',
+ head_uuid: mainProject.uuid,
+ tail_uuid: activeUser.user.uuid
+ });
+
+ cy.get('[data-cy=side-panel-tree]').contains('Projects').click();
+
+ cy.get('main').contains(projectName).rightclick();
- cy.get('[data-cy=context-menu]').contains('Advanced').click();
+ cy.get('[data-cy=context-menu]').contains('Advanced').click();
- cy.get('[role=tablist]').contains('METADATA').click();
+ cy.get('[role=tablist]').contains('METADATA').click();
- cy.get('td').contains('User: Active User').should('exist');
+ cy.get('td').contains(uuid).should('exist');
+
+ cy.get('td').contains('Active User').should('exist');
+ });
});
});
});
\ No newline at end of file
import { RepositoryResource } from 'models/repositories';
import { SshKeyResource } from 'models/ssh-key';
import { VirtualMachinesResource } from 'models/virtual-machines';
-import { UserResource } from 'models/user';
+import { UserResource, getUserDisplayName } from 'models/user';
import { LinkResource } from 'models/link';
import { KeepServiceResource } from 'models/keep-services';
import { ApiClientAuthorization } from 'models/api-client-authorization';
});
let user;
- try {
- if (metadata.itemsAvailable && metadata.items[0].tailKind === ResourceKind.USER) {
- user = await services.userService.get(metadata.items[0].tailUuid || '');
- }
- } catch {};
+ if (metadata.itemsAvailable) {
+ metadata.items.forEach(async (item) => {
+ const {tailKind, tailUuid, properties} = item;
+ properties['tail'] = tailUuid;
+ try {
+ if (tailKind === ResourceKind.USER && tailUuid) {
+ user = await services.userService.get(tailUuid);
+ properties['tail'] = getUserDisplayName(user);
+ }
+ } catch {};
+ });
+ }
return { data, metadata, user };
};
</Tabs>
<DialogContent className={classes.content}>
{value === 0 && <div>{dialogContentExample(apiResponse, classes)}</div>}
- {value === 1 && <div>{metadata !== '' && metadata.items.length > 0 ? <MetadataTab items={metadata.items} uuid={uuid} user={user} /> : dialogContentHeader('(No metadata links found)')}</div>}
+ {value === 1 && <div>
+ {metadata !== '' && metadata.items.length > 0 ?
+ <MetadataTab items={metadata.items} uuid={uuid} user={user} />
+ : dialogContentHeader('(No metadata links found)')}
+ </div>}
{value === 2 && dialogContent(pythonHeader, pythonExample, classes)}
{value === 3 && <div>
{dialogContent(cliGetHeader, cliGetExample, classes)}
import React from "react";
import { Table, TableHead, TableCell, TableRow, TableBody, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core';
-import { UserResource, getUserDisplayName } from "models/user";
+import { UserResource } from "models/user";
type CssRules = 'cell';
<TableCell className={props.classes.cell}>{it.uuid}</TableCell>
<TableCell className={props.classes.cell}>{it.linkClass}</TableCell>
<TableCell className={props.classes.cell}>{it.name}</TableCell>
- <TableCell className={props.classes.cell}>{props.user && `User: ${getUserDisplayName(props.user)}`}</TableCell>
+ <TableCell className={props.classes.cell}>{it.properties.tail}</TableCell>
<TableCell className={props.classes.cell}>{it.headUuid === props.uuid ? 'this' : it.headUuid}</TableCell>
- <TableCell className={props.classes.cell}>{JSON.stringify(it.properties)}</TableCell>
+ <TableCell className={props.classes.cell}>{JSON.stringify(it.properties, (key, value) => { return key === 'tail' ? undefined : value; })}</TableCell>
</TableRow>
)}
</TableBody>