Skip to content
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

[Feat] Duplicate layer and add layer from config #1401

Merged
merged 7 commits into from Feb 4, 2021

Conversation

heshan0131
Copy link
Contributor

No description provided.

@@ -896,6 +898,7 @@ export const removeFilterUpdater = (state, action) => {
*/
export const addLayerUpdater = (state, action) => {
const defaultDataset = Object.keys(state.datasets)[0];
if (props.type && state.layerClasses[props.type])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right. Was this line added by mistake?

let newLabel = `Copy of ${original.config.label}`;
let postfix = 0;
while (layers.find(l => l.config.label === newLabel)) {
newLabel = `${newLabel} ${postfix++}`;
Copy link
Collaborator

@ilyabo ilyabo Jan 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will probably generate something like Copy of My layer 0 1 2 3 4 5 6 and so on: starting with 0 and appending the next number to it every time. It'd be better to define some kind of template in a separate constant like Copy of ${layerName}${postfix} and then replace the variables in the loop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

@heshan0131 heshan0131 changed the title [Feat] Duplicate layer and add layer from config (WIP) [Feat] Duplicate layer and add layer from config Feb 1, 2021
Copy link
Collaborator

@ilyabo ilyabo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

b2kdaman and others added 7 commits February 5, 2021 00:35
Signed-off-by: Valentine <vpanchin@gmail.com>
Signed-off-by: Valentine <vpanchin@gmail.com>
Signed-off-by: Valentine <vpanchin@gmail.com>
Signed-off-by: Valentine <vpanch@softserveinc.com>
Signed-off-by: Shan He <heshan0131@gmail.com>
Signed-off-by: Shan He <heshan0131@gmail.com>
Signed-off-by: Shan He <heshan0131@gmail.com>
@heshan0131 heshan0131 merged commit 9e5bfdc into master Feb 4, 2021
@delete-merged-branch delete-merged-branch bot deleted the 1224-duplicate-layer branch February 4, 2021 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants