-
Notifications
You must be signed in to change notification settings - Fork 39
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
[MDS-5356] Actions Dropdown #2605
Conversation
…mnsType, made functin to calculate expandProps: allow more custom props and not allow 'children' to force expansion rendering unless on purpose. Moved some columns from common columns to document columns file, updated an import. Made document object model and an extension: cannot always guarantee method access so set more properties- testing added for proper usage. DocumentTable: changed matchChildColumns to showVersionHistory prop, used FileOperations interface to keep allowed actions structure consistent with docs themselves, parseDocuments run documents through constructor; get rid of archiveDocumentsArgs, instead let the document keep the mine guid, separated out old and new columns functions, it was getting confusing, found the table param 'childrenColumnName'
…le because it's most DRY for now
…common folder, updated imports
…umns basically the same (minus a bug with userAccessData...). Brought some changes back to Core as well
@@ -0,0 +1,51 @@ | |||
import React, { FC } from "react"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is copied from ArchiveDocumentModal, with some word changes.
|
||
public mine_guid: string; | ||
|
||
public document_manager_guid: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint added all these spaces on me and I was not feeling like changing eslint rules, even though it irritates me to look at it.
Replace = "Replace file", | ||
Archive = "Archive file", | ||
Delete = "Delete", | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made sense to me to put this here, but would make sense to put it in the documents directory instead
} | ||
|
||
public setAllowedActions(userRoles: string[] = []) { | ||
this.allowed_actions = this.getAllowedActions(userRoles).filter(Boolean); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://bcmines.atlassian.net/browse/MDS-5356?focusedCommentId=22159 <-- some explanation of why things are set up this way (with functions setting a value instead of returning it)
@@ -1,20 +1,20 @@ | |||
import React from "react"; | |||
import { Table, TableProps, Tooltip } from "antd"; | |||
import { ColumnType } from "antd/es/table"; | |||
import { ColumnsType } from "antd/es/table"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change to ColumnsType was just because of my struggles with type (see above) and attempt to fix it by getting rid of differences between what we had and antd demos. It didn't seem to affect anything.
...expandProps, | ||
}; | ||
} | ||
return { showExpandColumn: false }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ran into an issue where if the dataSource had children, it would show the expand icon even if I didn't want it to. Forced it to be deliberate.
title: string, | ||
sortable = false, | ||
placeHolder = "" | ||
export const renderActionsColumn = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved all the document-specific columns to DocumentColumns.
Put the interface here because the only reason to use it at all is this function (so importing both). Would be willing to move it though)
Objective
MDS-5356
Why are you making this change? Provide a short explanation and/or screenshots