Skip to content

Commit

Permalink
fixed displaying shared files' paths
Browse files Browse the repository at this point in the history
  • Loading branch information
magc authored and diocas committed Jan 24, 2022
1 parent 6ae505b commit 4206553
Show file tree
Hide file tree
Showing 4 changed files with 269 additions and 14 deletions.
2 changes: 1 addition & 1 deletion cs3api4lab/api/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def get_reference(file_id, endpoint=None):
if endpoint == 'default' or endpoint is None:
raise IOError('A CS3API-compatible storage endpoint must be identified by a storage UUID')
# assume we have an opaque fileid
return storage_provider.Reference(id=storage_provider.ResourceId(storage_id=endpoint, opaque_id=file_id))
return storage_provider.Reference(resource_id=storage_provider.ResourceId(storage_id=endpoint, opaque_id=file_id))

@staticmethod
def _check_and_transform_file_path(file_id):
Expand Down
15 changes: 4 additions & 11 deletions cs3api4lab/api/share_api_facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,10 @@ def map_shares_to_model(self, list_response, received=False):
continue
model = self._map_share_to_dir_model(share, stat)
model['writable'] = True if ShareUtils.map_permissions_to_role(share.permissions.permissions) == 'editor' else False
except:
model = {'name': share.resource_id.opaque_id.rsplit('/', 1)[-1],
'path': share.resource_id.opaque_id,
'last_modified': '',
'created': '',
'content': None,
'format': None,
'writable': False,
'size': 13,
'type': 'file',
'mimetype': 'text/plain'}
except Exception as e:
self.log.error("Unable to map share " + share.resource_id.opaque_id + ", " + e.__str__())
continue

if received:
model['accepted'] = ShareUtils.is_accepted(list_response.shares[share_no].state)
if model['path'] not in path_list:
Expand Down
3 changes: 2 additions & 1 deletion cs3api4lab/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ def setup_handlers(web_app, url_path):
(r"/api/cs3/ocm/received", OcmReceivedSharesHandler),
(r"/api/cs3/user", UserInfoHandler),
(r"/api/cs3/user/claim", UserInfoClaimHandler),
(r"/api/cs3/user/query", UserQueryHandler)
(r"/api/cs3/user/query", UserQueryHandler),
(r"/api/cs3/file/home", GetHome)
]

for handler in handlers:
Expand Down
263 changes: 262 additions & 1 deletion style/index.css
Original file line number Diff line number Diff line change
@@ -1 +1,262 @@
@import url('base.css');
.jp-file-info div
{
display: flex;
}

.jp-bottom-div
{
text-align: right;
margin-bottom: 5px;
}

.jp-file-info
{
flex-direction: column;
min-width: 350px;
min-height: 250px;

background: var(--jp-layout-color1);
color: var(--jp-ui-font-color1);
}

.jp-file-info-header
{
margin-bottom: 15px;
}

.jp-file-detail td
{
text-transform: capitalize;
}

.jp-file-info-header .jp-file-info-header-icon
{
flex-grow: 0;
width: 64px;
height: 64px;
}

.jp-file-info-header .jp-file-info-header-icon svg
{
width: 64px;
height: 64px;
}

.jp-file-info-header .file-info-header-title
{
margin-left: 5px;
flex-grow: 1;
vertical-align: middle;
align-items: center;

font-weight: bold;
font-size: var(--jp-ui-font-size2);
}

.jp-file-info-header
{
flex-direction: row;
}

.jp-file-info-menu ul
{
display: flex;
list-style-type: none;
width: 100%;
padding: 0;
margin: 0;
}

.jp-file-info-menu li
{
flex: 3;
cursor: pointer;
background: var(--jp-layout-color1);
padding: 7px;
text-align: center;
}

.jp-file-info li.active
{
background: var(--jp-layout-color2);
border-radius: 6px 6px 0 0;
font-weight: bold;
font-size: var(--jp-ui-font-size1);
}

.jp-file-info-menu-separator
{
margin: 0;
padding: 0;

width: 100%;
height: 2px;

background: var(--jp-layout-color2);
border: 0;
}

.jp-file-info-content
{
margin: 5px 5px 5px 5px;
padding-top: 10px;

font-size: var(--jp-ui-font-size1);
font-family: var(--jp-ui-font-family);
}

.jp-file-info-content th
{
text-align: left;
}

.jp-shares
{
width: 100%;
flex-direction: column;
}

.jp-shares-list-container
{
width: 100%;
flex-direction: column;
}

.jp-shares-list-container .jp-shares-element
{
flex-direction: row;
padding: 10px 0 0 0;
}

.jp-shares-list-container .jp-shares-element > div
{
flex-grow: 1;
}

.jp-shares-element .jp-shares-owner
{
width: 90%;
justify-content: left;
}

.jp-shares-element .jp-shares-label
{
justify-content: right;
}

.jp-shares-list-container .label
{
color: white;
padding: 3px;
}

.jp-shares-list-container .write-label
{
background: var(--jp-accent-color1);
}

.jp-shares-list-container .read-label
{
background: var(--jp-brand-color1);
}

.jp-shares-search-container
{
width: 100%;
justify-content: center;
padding-bottom: 10px;
}

.jp-shares-search
{
width: 96%;

background: var(--jp-layout-color1);
color: var(--jp-ui-font-color1);
border: 1px solid;
border-color: var(--jp-layout-color2);
padding: 7px;
background-image: var(--jp-icon-search);
background-repeat: no-repeat;
background-position: 97%;
}

.jp-shares-list-container
{
width: 100%;
}

.cs3_tab_toolbar
{
width: 100%;
}

.c3-panel-header
{
height: 75px !important;
}

.c3-panel-bottom
{
height: 25px !important;
}

.c3-panel-bottom > div
{
padding-left: 10px;
}

#cs3-dock-panel-header h1
{
margin-top: 5px;
margin-bottom: 5px;
margin-left: 10px;
}

.c3-title-widget
{
padding-left: 10px;
font-weight: bold;
}

#cs3-share-with-me-box-panel
{
border-top: 3px solid #aaaaaa;
padding-top: 5px;
}

#cs3-share-by-me-box-panel
{
padding-top: 5px;
}

.jp-shareform
{
display: flex;
flex-direction: column;
flex-grow: 1;
}
.jp-shareform-line
{
flex-direction: row;
flex-grow: 1;
justify-content: flex-start;
align-items: stretch;
padding-bottom: 2%;
}

.jp-shareform-title
{
flex-basis: 30%;
flex-direction: column;
justify-content: center;
}

.jp-shareform-element {
flex-basis: 70%;
flex-direction: column;
}

.react-dropdown-select {
width: 90%;
}

0 comments on commit 4206553

Please sign in to comment.