Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/BlueBrain/nexus-web into…
Browse files Browse the repository at this point in the history
… feature/org-welcome-page-bg

# Conflicts:
#	src/shared/containers/ResourceViewActionsContainer.tsx
  • Loading branch information
danburonline committed Dec 6, 2023
2 parents 164fb50 + 4a6f0ce commit b2672eb
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/shared/containers/ResourceListContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import * as React from 'react';
import { useHistory, useLocation } from 'react-router-dom';
import { useNexusContext } from '@bbp/react-nexus';
import {
DEFAULT_ELASTIC_SEARCH_VIEW_ID,
ElasticSearchViewQueryResponse,
Resource,
} from '@bbp/nexus-sdk';
import { DEFAULT_ELASTIC_SEARCH_VIEW_ID, Resource } from '@bbp/nexus-sdk';
import { isEmpty } from 'lodash';

import ResourceListComponent, {
ResourceBoardList,
Expand Down Expand Up @@ -152,7 +149,7 @@ const ResourceListContainer: React.FunctionComponent<{
'@id': list.query.q,
},
},
],
].filter(query => !isEmpty(query)),
},
},
{
Expand All @@ -168,7 +165,7 @@ const ResourceListContainer: React.FunctionComponent<{
_self: list.query.q,
},
},
],
].filter(query => !isEmpty(query)),
},
},
],
Expand Down
58 changes: 58 additions & 0 deletions src/shared/containers/ResourceViewActionsContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,64 @@ const ResourceViewActionsContainer: React.FC<{
{isInCart ? 'Remove from' : 'Add to'} Cart
</Button>
</Col>
<Col>
<Popover
destroyTooltipOnHide
showArrow={false}
key={resource._rev}
trigger={['click']}
title={
<div>
<div style={{ fontSize: 16 }}>Tag Resource</div>
<i style={{ fontSize: 12 }}>
The tag will be applied to revision{' '}
<strong>{resource._rev}</strong>
</i>
</div>
}
content={
<Form<{ tag: string }>
autoComplete="off"
name="tag-resource-form"
initialValues={{ tag: '' }}
onFinish={handleTagResource}
style={{ width: 300, padding: '8px 8px O' }}
>
<Form.Item
name="tag"
rules={[
{
pattern: /^[\x00-\x7F]/,
message: 'Tag should include only ASCII characters.',
},
{
max: 64,
message: 'Tag should not exceed 64 characters.',
},
{
pattern: /^(?!latest$)/,
message:
"Please choose a different name, 'latest' is a reserved word.",
},
]}
style={{ marginBottom: 8 }}
>
<Input placeholder="Resource tag" style={{ width: '100%' }} />
</Form.Item>
<Form.Item
wrapperCol={{ offset: 8, span: 8 }}
style={{ marginBottom: 0 }}
>
<Button type="primary" htmlType="submit">
Confirm
</Button>
</Form.Item>
</Form>
}
>
<Button>Tag Resource</Button>
</Popover>
</Col>
<Col>
<Popover
destroyTooltipOnHide
Expand Down

0 comments on commit b2672eb

Please sign in to comment.