Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{({ value }) => {
setTransition(value);
let waitTime = '';
let allowedNames = '';
let activityName = '';
if (transition) {
const attributes = attributesFor(transition);
activityName = attributes['initial-state'];
allowedNames = getAllowedNames(attributes);
waitTime = getWaitTime(attributes, workTask, relativeTimeAgo, dataStore);
}
return (
<div>
{transition && (
<div>
<span>{t('tasks.waiting', { waitTime })}</span>
{t('tasks.forNames', { allowedNames, activityName })}
{foundCurrentUser && (
{t('common.continue')}
)}
{isSuperAdmin && (</div></div>
{organizations.map((organization) => {
const organizationName = attributesFor(organization).name;
const roleProps = {
organization,
user,
roles,
userRoles,
};
return (
<div>
<span data-test-role-organization="">
{organizationName}
</span>
<br>
</div>
);
export function userRolesContainRoleNamed(
dataStore: Store,
userRoles: UserRoleResource[],
name: ROLE
) {
for (let i = 0; i < userRoles.length; i++) {
let userRole = userRoles[i];
let role = dataStore.cache.query((q) => q.findRelatedRecord(userRole, 'role'));
if (attributesFor(role).roleName === name) {
return true;
}
}
return false;
}
export default ({ project }) => {
const { workflowProjectUrl } = attributesFor(project);
const { t } = useTranslations();
return (
<div>
<div>
<details>
</details></div>
<div>
{workflowProjectUrl && (
<div data-input-copy-field="">
<h4>{t('project.side.repositoryLocation')}</h4>
</div></div></div>
{productDefinitions.map((productDefinition) => {
const id = productDefinition.id;
const { name, description } = attributesFor(productDefinition);
const isProductSelected = isSelected(id);
return (
<div data-test-item=""> toggle(id)}
>
</div>
) => {
if (transitionType != 1) {
return '';
}
let userName = t('appName');
if (dateTransition === null) {
if (allowedName != null) {
userName = allowedName;
}
} else {
if (workflowId != null) {
const users = dataStore.cache.query((q) =>
q.findRecords('user').filter({ attribute: 'workflowUserId', value: workflowId })
);
if (users.length === 1) {
const { name } = attributesFor(users[0]);
userName = name;
}
}
}
return userName;
};
const getFormattedDate = (dateTransition: string) => {
const toggleArchiveProject = async () => {
const { dateArchived } = attributesFor(project);
const nextValue = !dateArchived ? new Date() : null;
try {
await updateAttribute('dateArchived', nextValue);
toast.success(
!dateArchived
? t('project.operations.archive.success')
: t('project.operations.reactivate.success')
);
} catch (e) {
toast.error(e);
}
};
(n) => attributesFor(n).dateRead !== null
);
toast.error(t('errors.generic', { errorMessage: e.message }));
}
};
let _updateOwner = async (userId) => {
try {
await updateOwner(userId);
toast.success(t('updated'));
} catch (e) {
toast.error(t('errors.generic', { errorMessage: e.message }));
}
};
const groupId = group.id;
const ownerId = owner.id;
const { name: orgName } = attributesFor(organization);
return (
<div>
<div>
<h4>{t('project.side.organization')}</h4>
<div>
<span>{orgName}</span>
</div>
</div>
<div>
<h4>{t('project.side.projectOwner')}</h4>
<div>
<div>
</div></div></div></div>