-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1744 from finos/copy-menu
Copy menu
- Loading branch information
Showing
32 changed files
with
738 additions
and
414 deletions.
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
33 changes: 33 additions & 0 deletions
33
rust/perspective-viewer/src/rust/components/copy_dropdown.rs
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,33 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Copyright (c) 2018, the Perspective Authors. | ||
// | ||
// This file is part of the Perspective library, distributed under the terms | ||
// of the Apache License 2.0. The full license can be found in the LICENSE | ||
// file. | ||
|
||
use super::containers::dropdown_menu::*; | ||
use crate::model::*; | ||
|
||
pub fn get_menu_items(has_render: bool) -> Vec<CopyDropDownMenuItem> { | ||
vec![ | ||
CopyDropDownMenuItem::OptGroup( | ||
"Current View", | ||
if has_render { | ||
vec![ExportMethod::Csv, ExportMethod::Json, ExportMethod::Png] | ||
} else { | ||
vec![ExportMethod::Csv, ExportMethod::Json] | ||
}, | ||
), | ||
CopyDropDownMenuItem::OptGroup( | ||
"All", | ||
vec![ExportMethod::CsvAll, ExportMethod::JsonAll], | ||
), | ||
CopyDropDownMenuItem::OptGroup("Config", vec![ExportMethod::JsonConfig]), | ||
] | ||
} | ||
|
||
pub type CopyDropDownMenu = DropDownMenu<ExportMethod>; | ||
pub type CopyDropDownMenuProps = DropDownMenuProps<ExportMethod>; | ||
pub type CopyDropDownMenuMsg = DropDownMenuMsg; | ||
pub type CopyDropDownMenuItem = DropDownMenuItem<ExportMethod>; |
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
Oops, something went wrong.