PromucFlow_constructor/app/client/src/widgets/DocumentViewerWidget/index.ts

53 lines
1.6 KiB
TypeScript
Raw Normal View History

import { ResponsiveBehavior } from "utils/autoLayout/constants";
import IconSVG from "./icon.svg";
import Widget from "./widget";
fix: airgapped instance bug fixes (#22440) ## Description - This PR fixes few of the bugs on airgapped instances. Fixes #22361 Fixes #22375 Fixes #22392 Fixes #22394 Fixes #22395 Fixes #22441 Fixes #22437 Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video ## Type of change - Bug fixes (non-breaking change which fixes an issue) ## How Has This Been Tested? - Manual ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-04-20 08:24:55 +00:00
import { isAirgapped } from "@appsmith/utils/airgapHelpers";
feat: Widget Discoverability (#24934) ## Description Grouping the widgets into categories to make it easier for people to find widgets. This will be behind the feature flag `release_widgetdiscovery_enabled` <img src="https://github.com/appsmithorg/appsmith/assets/22471214/4932a091-1831-4d95-b722-3301580fb6be" height="300px" /> Project home [here on Notion](https://www.notion.so/appsmith/Widget-Discoverability-755cf059a1904950888304b90b74106f?d=8bc3059134984787900a69963dd13d90#27967092cfa74505bab55bd163d28c18). #### PR fixes following issue(s) #24865 #24867 #24868 #24869 #### Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video > > #### Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - Chore (housekeeping or task changes that don't impact user perception) - This change requires a documentation update > > > ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [x] Manual - [ ] Jest - [x] Cypress > > #### Test Plan > (https://github.com/appsmithorg/TestSmith/issues/2440) > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [x] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [x] Test plan has been peer reviewed by project stakeholders and other QA members - [x] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [x] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-07-22 05:57:18 +00:00
import { WIDGET_TAGS } from "constants/WidgetConstants";
fix: airgapped instance bug fixes (#22440) ## Description - This PR fixes few of the bugs on airgapped instances. Fixes #22361 Fixes #22375 Fixes #22392 Fixes #22394 Fixes #22395 Fixes #22441 Fixes #22437 Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video ## Type of change - Bug fixes (non-breaking change which fixes an issue) ## How Has This Been Tested? - Manual ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-04-20 08:24:55 +00:00
const isAirgappedInstance = isAirgapped();
export const CONFIG = {
type: Widget.getWidgetType(),
name: "Document Viewer", // The display name which will be made in uppercase and show in the widgets panel ( can have spaces )
iconSVG: IconSVG,
feat: Widget Discoverability (#24934) ## Description Grouping the widgets into categories to make it easier for people to find widgets. This will be behind the feature flag `release_widgetdiscovery_enabled` <img src="https://github.com/appsmithorg/appsmith/assets/22471214/4932a091-1831-4d95-b722-3301580fb6be" height="300px" /> Project home [here on Notion](https://www.notion.so/appsmith/Widget-Discoverability-755cf059a1904950888304b90b74106f?d=8bc3059134984787900a69963dd13d90#27967092cfa74505bab55bd163d28c18). #### PR fixes following issue(s) #24865 #24867 #24868 #24869 #### Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video > > #### Type of change > Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - Chore (housekeeping or task changes that don't impact user perception) - This change requires a documentation update > > > ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [x] Manual - [ ] Jest - [x] Cypress > > #### Test Plan > (https://github.com/appsmithorg/TestSmith/issues/2440) > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [x] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [x] Test plan has been peer reviewed by project stakeholders and other QA members - [x] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [x] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-07-22 05:57:18 +00:00
tags: [WIDGET_TAGS.MEDIA],
needsMeta: false, // Defines if this widget adds any meta properties
isCanvas: false, // Defines if this widget has a canvas within in which we can drop other widgets
searchTags: ["pdf"],
defaults: {
widgetName: "DocumentViewer",
fix: airgapped instance bug fixes (#22440) ## Description - This PR fixes few of the bugs on airgapped instances. Fixes #22361 Fixes #22375 Fixes #22392 Fixes #22394 Fixes #22395 Fixes #22441 Fixes #22437 Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video ## Type of change - Bug fixes (non-breaking change which fixes an issue) ## How Has This Been Tested? - Manual ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-04-20 08:24:55 +00:00
docUrl: !isAirgappedInstance
? "https://www.learningcontainer.com/wp-content/uploads/2019/09/sample-pdf-file.pdf"
: "",
rows: 40,
columns: 24,
version: 1,
animateLoading: true,
responsiveBehavior: ResponsiveBehavior.Fill,
},
properties: {
derived: Widget.getDerivedPropertiesMap(),
default: Widget.getDefaultPropertiesMap(),
meta: Widget.getMetaPropertiesMap(),
config: Widget.getPropertyPaneConfig(),
chore: Grouping & Reorganisation for ButtonWidget, JSON Form widget and Audio Widget (#14379) * POC: Grouping for ButtonWidget * Adds featureflag * improve feature flag experience for unfinished widgets * Styling of tabs * Adds activation group for ButtonWidget * Makes contentConfig & styleCOnfig optional to avoid typescript errors from tests * Adds UI for search * Fixes title, search & tabs UI to the top * fix: style issue * fix styles * refactor ProeprtyPaneTab * updates Button based on Figma design changes * POC for AudioWidget * chore: JSON Form Grouping & Reorganisation (#15033) * POC: JSON Form grouping * fix: Empty sections * Moves icon into a separate sub section * fix some sections based on updated Designs * fix styling issues * fix: double border * udpdates based on Figma updates * Updates order as per Figma * refactor and better naming of function * address review comments for JSON form configs * fix UI issues * reorder JSON form's array data section * Adds Button Form settings * Address QA comments * update JSON form with new design changes * Open array & object style by default * trigger ci * chore: Grouping & reorganisation of Video widget (#15297) * POC: JSON Form grouping * fix: Empty sections * Moves icon into a separate sub section * fix some sections based on updated Designs * fix styling issues * fix: double border * udpdates based on Figma updates * Updates order as per Figma * Content & Style Config for Video Widget * refactor and better naming of function * address review comments for JSON form configs * fix UI issues * ?? * chore: Grouping & reorganisation of Document Viewer widget (#15514) * Grouping & re-org for Document Viewer * fix: scroll issue * feat: Search properties in property pane (#14876) * Upgrades fuse.js package * Property pane search POC * POC: JSON Form grouping * fix: Empty sections * Moves icon into a separate sub section * fix some sections based on updated Designs * fix styling issues * fix: double border * udpdates based on Figma updates * Updates order as per Figma * fix unused variable after merge * Adds empty search UI * Makes the order of search result proper * Refactor PropertyControlGenerator * refactor and support for panel * Revert "Upgrades fuse.js package" This reverts commit 76d8038139ff4b8add79019a75eaaf40fd620e8e. * extract out search functionality to helper * cleanup * fix: panel issue * Focus on Search bar on opening the property pane * better naming * fix: fuzzy search params * refactor: As suggested in the code review * fix: section is not hidden when there's no children * fix: issue panel properties
2022-08-04 05:31:05 +00:00
contentConfig: Widget.getPropertyPaneContentConfig(),
feat: widget property setters (#23441) ## Description - This PR adds setter methods to update widget property programmatically. Example:- `Input1.setText("setter methods are cool!");` Docs link : https://docs.appsmith.com/reference/widgets For any selected widget check the `Methods` section #### PR fixes following issue(s) Fixes #### Type of change - New feature (non-breaking change which adds functionality) ## Testing > #### How Has This Been Tested? - [x] Manual - [x] Jest - [x] Cypress > > #### Test Plan https://github.com/appsmithorg/TestSmith/issues/2409 #### Issues raised during DP testing - [x] [Errors are not logged in the debugger](https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1564017346) separate GitHub issue https://github.com/appsmithorg/appsmith/issues/24609 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1564155545 ( `setVisibility("false")` ) - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1580525843 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1576582825 - Blocker for testing - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1577956441 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1577930108 - Not a issue (lint error query) - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1593471791 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1591440488 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1586747864 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1596738201 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1598541537 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1611413076 - [x] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1612621567 - [ ] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1619654507 - [ ] https://github.com/appsmithorg/appsmith/pull/23441#issuecomment-1621256722 > > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change) have been covered - [x] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest) - [x] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed --------- Co-authored-by: Rishabh Rathod <rishabh.rathod@appsmith.com>
2023-07-08 14:07:26 +00:00
setterConfig: Widget.getSetterConfig(),
autocompleteDefinitions: Widget.getAutocompleteDefinitions(),
},
autoLayout: {
widgetSize: [
{
viewportMinWidth: 0,
configuration: () => {
return {
minWidth: "280px",
minHeight: "280px",
};
},
},
],
},
};
export default Widget;