-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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: Tags ListView Page #24964
Merged
Merged
feat: Tags ListView Page #24964
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
0e099cc
add create relationship dao + test
hughhhh 9ffd7c7
aadd create command for relationships
hughhhh 6b75e34
add api + test
hughhhh 98ecc81
create tags modal
hughhhh c9ecff7
save for now
hughhhh 93dc089
Merge branch 'master' of https://github.com/preset-io/superset into t…
hughhhh 68d8ebf
remove unneeded migration
hughhhh 815fe05
Merge branch 'master' of https://github.com/preset-io/superset into t…
hughhhh b6da96f
fix fe linting
hughhhh 55d2e12
update test
hughhhh b474daf
fix test
hughhhh 80d6090
added test
hughhhh 423b069
fixed python test
hughhhh 53c4590
fix linting
hughhhh da3a783
Update superset-frontend/src/features/tags/TagModal.tsx
hughhhh 18a81d1
refactory
hughhhh 417fae1
update exception
hughhhh c2e069d
fix update test
hughhhh b7cfbc6
ok
hughhhh 748d0cb
updating status codes
hughhhh 910656a
fix: remove unused file (#24946)
mdeshmu e30746d
save
hughhhh 4d68c24
save
hughhhh 881712e
saving
hughhhh 0719bde
add validation test
hughhhh 85ff144
save
hughhhh 29ff60a
add api
hughhhh 9c5977d
update bulk test
hughhhh fd6f2ee
add refresh data
hughhhh a2f0187
Merge branch 'master' of https://github.com/preset-io/superset into t…
hughhhh 58409d1
fix PageHeaderWithActions not showing dropdown
hughhhh 2bb4640
fix styling on metadata bar
hughhhh f0a0070
fix more bugs
hughhhh 1e8766f
add bulk to queries
hughhhh 27f6d37
add + button
hughhhh d98a37f
Merge branch 'master' of https://github.com/preset-io/superset into t…
hughhhh 0b366af
linting
hughhhh 712d3bd
fix linting
hughhhh 9659dce
fixing test part 2
hughhhh 2453c4a
fixed metadata bar owner items and added created_on_delta_humanized t…
fisjac 5eac9c4
fix open api spec
hughhhh 2cfa65a
Merge pull request #604 from fisjac/tags-hover-bugfix
hughhhh 7a09338
Merge branch 'master' of https://github.com/preset-io/superset into t…
hughhhh 4805e5f
opps
hughhhh 4dab0c4
rename var
hughhhh 2400b7d
Update superset-frontend/src/components/ListView/ListView.tsx
hughhhh 9be61e1
fix test
hughhhh 94be254
first set of bug fixes
hughhhh 93bdc9e
fix update list
hughhhh 84d3cfd
add bulk_create setting for keeping state on create functions
hughhhh 790511b
set bulk tagging to false
hughhhh fddf9b1
set showMenuDropdown to true
hughhhh 4137e28
fix linting
hughhhh 564fa06
Merge branch 'master' of https://github.com/preset-io/superset into t…
hughhhh 737eaca
update classname for tag button
hughhhh b7aec35
update default value for test
hughhhh 9a5ede4
ok ok ok
hughhhh 43eb5dd
address kamil concernes
hughhhh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import React, { useState, useEffect } from 'react'; | ||
import { t, SupersetClient } from '@superset-ui/core'; | ||
import { FormLabel } from 'src/components/Form'; | ||
import Modal from 'src/components/Modal'; | ||
import AsyncSelect from 'src/components/Select/AsyncSelect'; | ||
import Button from 'src/components/Button'; | ||
import { loadTags } from 'src/components/Tags/utils'; | ||
import { TaggableResourceOption } from 'src/features/tags/TagModal'; | ||
|
||
interface BulkTagModalProps { | ||
onHide: () => void; | ||
refreshData: () => void; | ||
addSuccessToast: (msg: string) => void; | ||
addDangerToast: (msg: string) => void; | ||
show: boolean; | ||
selected: any[]; | ||
resourceName: string; | ||
} | ||
|
||
const BulkTagModal: React.FC<BulkTagModalProps> = ({ | ||
show, | ||
selected = [], | ||
onHide, | ||
refreshData, | ||
resourceName, | ||
addSuccessToast, | ||
addDangerToast, | ||
}) => { | ||
useEffect(() => {}, []); | ||
|
||
const onSave = async () => { | ||
await SupersetClient.post({ | ||
endpoint: `/api/v1/tag/bulk_create`, | ||
jsonPayload: { | ||
tags: tags.map(tag => tag.value), | ||
objects_to_tag: selected.map(item => [resourceName, +item.original.id]), | ||
}, | ||
}) | ||
.then(({ json = {} }) => { | ||
addSuccessToast(t('Tagged %s items', selected.length)); | ||
}) | ||
.catch(err => { | ||
addDangerToast(t('Failed to tag items')); | ||
}); | ||
|
||
refreshData(); | ||
onHide(); | ||
setTags([]); | ||
}; | ||
|
||
const [tags, setTags] = useState<TaggableResourceOption[]>([]); | ||
|
||
return ( | ||
<Modal | ||
title={t('Bulk tag')} | ||
show={show} | ||
onHide={() => { | ||
setTags([]); | ||
onHide(); | ||
}} | ||
footer={ | ||
<div> | ||
<Button | ||
data-test="modal-save-dashboard-button" | ||
buttonStyle="secondary" | ||
onClick={onHide} | ||
> | ||
{t('Cancel')} | ||
</Button> | ||
<Button | ||
data-test="modal-save-dashboard-button" | ||
buttonStyle="primary" | ||
onClick={onSave} | ||
> | ||
{t('Save')} | ||
</Button> | ||
</div> | ||
} | ||
> | ||
<> | ||
<>{t('You are adding tags to the %s entities', selected.length)}</> | ||
<br /> | ||
<FormLabel>{t('tags')}</FormLabel> | ||
<AsyncSelect | ||
ariaLabel="tags" | ||
// @ts-ignore | ||
value={tags} | ||
options={loadTags} | ||
onHide={onHide} | ||
// @ts-ignore | ||
onChange={tags => setTags(tags)} | ||
placeholder={t('Select Tags')} | ||
mode="multiple" | ||
/> | ||
</> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default BulkTagModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
ts-nocheck