Skip to content

Commit 7861b76

Browse files
jsorohovaMichaelJLiumalincristjan-mrmalzaslon
authored
Runtime UI redesign using Fluent UI (#2784)
Runtime UI redesign using Fluent UI with previous default.json for e2e tests and static build * Fixed nested definitions listing (#2315) * Registered operationDetails widget (#2323) * Fixed Product APIs registration (#2324) * feat: add option to configure a default to expand all group tags (#2330) * Admin UI redesign (#2121) * Boostrapped React-based admin panel. * Navigation top level * Navigation - pages * Pages navigation item * Delete confirmation code improvement * Navigation 'Navigation' item * Settings and Help navigation items, Top panel * Page/Layout modals * Media modal * Media modals * Focused layout * Styles and Custom widgets items * Mobile styles * URLs navigation item * Toast notifications * Site menu * Favicon upload * Popups item * Onboarding modal * Components updates * Anchors and bug fixes * Content changes * Validation implementation * Reset content flow restyling * Pagination support * Loaders and content changes * Permalink validation fixes * Feedback link change --------- Co-authored-by: Alexander Zaslonov <alzaslon@microsoft.com> * Pagination simplified for data API (#2304) * Accessibility fixes (#2343) * Nav link color fix (#2346) * Fixed: UTF-8 characters that have more than 1 byte get truncated by migrate scripts (#2348) * API operation-details - use correct protocol (#2357) * APIs dropdown close fix and Product API widget target fix (#2352) * Fixed Settings modal incorrect behaviour (#2361) * Packages update - custom widgets overrides default widget fix (#2363) * api-management-custom-widgets packages updated * npm audit fix * Increase dev-portal version to 2.25.0 * skipWorkspaces query param added to APIs & Products services (#2366) * Fixed error when changing OAuth flow (#2368) * Fixed error when changing oauth flow * added missing removeEventListener in finally clause * added check to ensure the popup is closed (in case the user cancels the flow manually) * refactoring * Fixed: custom HTML widget not rendering on published portals (#2370) * Validation fixes (#2374) * Fixed Link media functionality (#2377) * Fixed: error when loading operations grouped by tags without apiId (#2376) * Fixed: error when loading subscriptions without user signed in (#2375) * iframe sandbox allowed tags fixed for safari * Fixed subscription header always required (#2382) * Fixed subscription header always required * remove set selectedSubscriptionKey to null * use of outdated custom widget scaffolder by npx fixed (#2383) * Added role view dropdown (#2378) * Update to 2.26 version Update version on package.json to 2.26 for preparing release * Disable reset password for signed in users (#2308) * Disable reset password for signed in users * code review fix * Fixed heavily truncated description for APIs and Products (#2386) * Added mime type to media linking (#2390) * GitHub CI permissions change (#2393) * GitHub CI permissions change * Added a check permission * Paperbits version bump (#2391) * Fixed media empty permalink errors (#2395) * Bumped paperbits version to sync with the managed (#2397) * Fixed non-working anchors for definitions, made multiple complex schemas more readable (#2389) * Fixed non-working anchors for definitions, made multiple complex schemas more readable * Changed the logic of scrolling to the definition * Fixed management API version mismatch (#2385) * Fixed management API version mismatch * Changed test settings to use the new endpoint * Changed test data jsons * Added UI interface for multiple auth servers (#2337) * Added ui interface for multiple auth servers * added nullchecks * fixed typo * extracted serverName in constant * Upgrade dependency follow-redirects (#2401) * Commented out markdown announcement * Deleted markdown announcement slide * Fixed default home page menu text color (#2406) * Bump undici from 5.28.2 to 5.28.3 (#2410) Bumps [undici](https://github.com/nodejs/undici) from 5.28.2 to 5.28.3. - [Release notes](https://github.com/nodejs/undici/releases) - [Commits](nodejs/undici@v5.28.2...v5.28.3) --- updated-dependencies: - dependency-name: undici dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fixed: registered apiProducts widget correctly (#2411) * Fixed validation behaviour (#2412) * Used naming cinvention with dash (#2414) * fixed api products widget editor registration (#2416) * Improved logging around AAD B2C flows (#2402) * Improved logging around AAD B2C flows * ran lint:fix * Move default media files to regional storage (#2407) * Moved default media files to regional storage and change endpoints to use them accordingly * fixed default.json conflicts * code review changes * Alt tag for images in the Media modal (#2423) * Fixed: API not loaded the first time (#2424) * aria-label attributes for fields with custom labels (#2427) * Fixed multiple media files deletion (#2434) * Update issue templates (#2436) * Create cleanUpOpenedIssues.yml Test: Execute github action to clean up existing opened issues * Update cleanUpOpenedIssues.yml * Update cleanUpOpenedIssues.yml Update token * Update cleanUpOpenedIssues.yml * Update cleanUpOpenedIssues.yml * Update cleanUpOpenedIssues.yml * Update cleanUpOpenedIssues.yml * Update cleanUpOpenedIssues.yml using bash to fetch issues urls * Fixed non-closing list of APIs dropdown widget (#2450) * Prepare release 2.27 Setting up "version": "2.27.0" on package.json to start preparing release * Update package-lock.json Update 2.27 version on package-lock.json * Migration script: added recursive download of media data from content… (#2457) * Migration script: added recursive download of media data from content storage * Added to scripts v2 --------- Co-authored-by: Roman Kolesnikov <rokolesnikov@microsoft.com> * Fixed overlapping API dropdown (#2459) * API Dropdown - navigation fix (#2460) * Revert "Move default media files to regional storage (#2407)" (#2461) This reverts commit 64ee99e. * Fix scripts.v2: migrate & capture (#2465) Co-authored-by: Roman Kolesnikov <rokolesnikov@microsoft.com> * Fixed auth servers in test console on switching apis (#2471) * Fixed enum values processing for console operations query and template parameters (#2476) * Fixed toast notifications to appear on top of the Fluent UI overlays (#2484) * Fixed do not show AAD config message in runtime for sigin social widget (#2485) * FUI - List of operations (#2475) * FUI - List of operations (#2490) * FUI - List of operations * FUI - List of operations - GQL * FUI - Operation list - CR fixes and router listener * FUI - List of operations - a11y fixes * FUI - List of operations - a11y fixes * FUI - List of operations - a11y fixes * FUI - API details (#2483) --------- Co-authored-by: Elena Shorohova <jsorohova@microsoft.com> Co-authored-by: Elena Shorohova <92329687+jsorohova@users.noreply.github.com> * FUI - API details (#2489) * FUI - List of operations * FUI - List of operations - GQL * FUI - API details * FUI - API details * FUI - Operation list - CR fixes and router listener * FUI - API details - router listener * FUI - List of operations (#2475) * FUI - APIs list (#2431) * APIs List V2 - init * APIs List V2 - APIs List v2 * APIs List V2 - @fluentui/react-components * APIs List V2 - TODO * APIs List V2 - api-list base working * APIs List V2 - api-list pagination working * APIs List V2 - api-list first row info * APIs List V2 - api-list cards & fuiTheme fix * APIs List V2 - ApisCards * APIs List V2 - cleanup * APIs List V2 - npm i * APIs List V2 - search & group by WiP * APIs list - group by tag & sorting WiP (TODO) * merge - styling refactor * page size fix * merge fix * refactor of style handling * markdown processing * margin adjusted * FUI - Products list (#2492) * FUI - list of APIs in a Product (#2493) * FUI - filters for list pages (#2496) * Fixed Custom widgets CORS issue in Safari (#2498) [28254976] * FUI - Redesign toggle (#2500) * FUI - APIs list Dropdown (#2501) * APIs list - as Dropdown * APIs list Dropdown - links * FUI Dropdown - loading default value & styling * FUI - list-of-apis isRedesignEnabled * FUI - product-list isRedesignEnabled * FUI - Products list Dropdown (#2503) * FUI - product-apis isRedesignEnabled * FUI - Products list as Dropdown * FUI - added option to hide filters * FUI - product-apis refresh on Product change fix * FUI - redesigned filter popup for only one filter group * FUI - min-width fixed * FUI - APIs list style adjustments * FUI - Redesign toggle - Stickness adjustment (#2508) * FUI - Product Subscriptions list (#2510) * FUI - products subscriptions list * FUI - products dropdown formatting * FUI - Subscribe to a Product (#2511) * FUI - products subscriptions list * FUI - products dropdown formatting * FUI - API details badges added * FUI - Product Subscribe + ToS * FUI - Product details (#2513) * Added pagination and filter support for subscriptions in the test console (#2516) * Added pagination and filter support for subscriptions in the test console * simplified if statement * added nullcheck * Use basic auth for change password (#2396) * FUI - Operation details widget (#2517) * FUI - Sign in (#2518) * FUI - signin * sign in fixes * FUI - Sign In Social (#2519) * FUI - Profile (#2520) * FUI - Subscriptions (#2521) * FUI - minor fixes found in testing in Managed portal (#2523) * FUI - pagination "hasNextPage" variant added (#2524) * FUI - Operation details - GQL (#2525) * FUI - Validation summary (#2528) * FUI - Sign Up + Captcha (#2529) * FUI - Reset password (#2530) * Bumped version to 2.29 (#2531) * browser specific iframe sandbox tokens support (#2514) * browser specific iframe sandbox tokens support * missing semicolon * check all tokens to be safe * changes requested by igor * FUI - Tags filtering for APIs Group by Tag view (#2533) * Reverted accidential redesign merge (#2532) * FUI - Sign Up AAD (#2535) * Create config.yml (#2536) * Update README.md (#2641) * Update bug_report.md (#2647) * What's new modal refactoring (#2657) * Whats new modal refactoring * Fixed a11y issue for slides headings * Role and screen size dropdowns accessibility fix (#2659) * Made several left nav items keyboard accessible (#2660) * Multiple fixes for Site menu item modal (#2661) * FUI - Operation console (#2655) * FUI - Operation console * Removed paging from test console subscriptions dropdown (#2664) Limit dropdown with 50 subscriptions (100 keys) Improved subscriptions secrets load * Developer portal version bump to 2.30 (#2662) * Fixed grouping apis subscriptions in test console selector (#2665) * Error processing and search fixes in Admin UI (#2666) * Error processing and search fixes in Admin UI * Fixed permalink validation in the page admin modal * Added a fix for incorrect validation (#2668) * CR fix (#2669) * FUI - WS console (#2670) * FUI - Reports page (#2672) * FUI - Reports * FUI - Reports --------- Co-authored-by: Jan Mach <janmach1@microsoft.com> * FUI - Console body improvements and bug fixes (#2673) * FUI - code review & minor changes * FUI - Console body improvements and bug fixes --------- Co-authored-by: Jan Mach <janmach1@microsoft.com> * FUI - Console body improvements and bug fixes (#2674) * FUI - code review & minor changes * FUI - Console body improvements and bug fixes * FUI - Reports charts npm package --------- Co-authored-by: Jan Mach <janmach1@microsoft.com> * FUI - API changelog page (#2675) * FUI - Change password page (#2676) * FUI - Confirm password page (#2677) * Fixed integration user errors (#2679) * Fixed integration user errors * Fixed GitHub build errors * FUI - Covering No data scenarios and small fixes (#2680) * FUI - SOAP headers and console bug fixes (#2681) * FUI - SOAP headers and console bug fixes * FUI - Added check for SOAP headers urlTemplate * Fixed custom widgets editor configuration view (#2686) Co-authored-by: Roman I. Kolesnikov false <rokolesnikov@microsoft.com> * Added allow-same-origin as a settings option for custom widgets (#2688) * Added cors allo-same-origin option for custom widget * Nit, changed text * Update package version to 2.31.0 (#2689) * Update package version to 2.31.0 --------- Co-authored-by: Roman I. Kolesnikov false <rokolesnikov@microsoft.com> * Fixed nonImageDetailModal to pass schema validation on saving of linked item (#2691) Co-authored-by: Roman I. Kolesnikov false <rokolesnikov@microsoft.com> * Packages and styles upgrade (#2692) * Migrated declarations. * Upgraded designer styles. * Updated packages and fixed styles --------- Co-authored-by: Alexander Zaslonov <alzaslon@microsoft.com> * Merged PR 10992070: fix(sitemenu): Fix linking for image site menu -> media modal **Problem:** Link image doesn't work for media because of missed property compared to schema **Solution:** Fixed **Synchronization:** _Describe If there is any condition to merge this code to main repository. Link any PR that is needed to be deployed together with this PR._ **Type of change:** - [ ] Feature work - [X] Bugfix - [ ] Security patch - [ ] Documentation - [ ] Engineering change - [ ] Test - [ ] Logging/Metrics _Before submitting this PR, please make sure that the following are done_: - [ ] There is sufficient test coverage (unit/BVT) - [ ] There is sufficient logging and metrics to troubleshoot in production. Ensured PII is not logged - [ ] Validated that it is not introducing breaking changes in the product behavior **Risk**: - [ ] High – Errors could cause MAJOR regression of many scenarios. (Example: new large features or high-level infrastructure changes) - [ ] Medium – Errors could cause regression of 1 or more scenarios. (Example: somewhat complex bug fixes, small new features) - [X] Small – No issues are expected. (Example: Very small bugfixes, string changes, or configuration settings changes) Related work items: #29755670 * Merged PR 11000481: fix(media): Fixed reference url is not updatable **Problem:** When you try to put value to reference url in limk media dialog, the value is not updated **Solution:** Fixed state updates **Synchronization:** _Describe If there is any condition to merge this code to main repository. Link any PR that is needed to be deployed together with this PR._ **Type of change:** - [ ] Feature work - [X] Bugfix - [ ] Security patch - [ ] Documentation - [ ] Engineering change - [ ] Test - [ ] Logging/Metrics _Before submitting this PR, please make sure that the following are done_: - [X] There is sufficient test coverage (unit/BVT) - [ ] There is sufficient logging and metrics to troubleshoot in production. Ensured PII is not logged - [X] Validated that it is not introducing breaking changes in the product behavior **Risk**: - [ ] High – Errors could cause MAJOR regression of many scenarios. (Example: new large features or high-level infrastructure changes) - [ ] Medium – Errors could cause regression of 1 or more scenarios. (Example: somewhat complex bug fixes, small new features) - [X] Small – No issues are expected. (Example: Very small bugfixes, string changes, or configuration settings changes) Related work items: #29755670 * Fixed styles after last packages update (#2694) * Fixed styles after last packages update * Returned default styles from style guide * merge from master * Update Paperbits packages and styles in api list widget (#2696) * Fixed styles after packages upgrade (#2697) * Removed unnecessary imports from styles * Fixed admin dropdown on small screen resolutions * Fixed tabs styles and editor alignments (#2698) * Developer portal version bump to 2.32 (#2699) * Migrate design-time and editor to React (#2700) * clean up * FUI - Moving to the native elements - Sign in and Product pages (#2702) * FUI - Moving to the native elements - Required label (#2704) * FUI - Moving to the native elements - Required label - Added missed variable (#2705) * Signup migrate to simple elements, captcha redesign (#2703) Signup migrate to simple elements Cleanup content for signup and new captcha Fixed validation summary * chore: Remove unused workflow (#2706) * Fixed publishing * FUI - Moving to the native elements - API list (#2707) * FUI - Moving to the native elements - Product list (#2708) * Fixed sign up social widget * Accessibility fixes for new Admin UI (#2710) * Migrated reset password widget and editor Updated paperbits packages * Migrated change password widget and editor * Migrated confirm password to editor runtime * Merge * FUI - API products (#2712) * Migrated subscription widget * Migrated profile widget editor runtime to React * Paperbits packages upgrade to 0.1.629 (#2713) * Migrated signin social to React editor runtime * Migrated details of api widget * migrated api history widget to React editor runtime * migrated operation list to React design runtime * remove migrated templates * Update license reference (#2716) Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com> * Fixed pages and layouts validation and added No items text when searching (#2715) * Fixed terms of use widget * FUI - Operation details - Moving to native elements (#2718) * Migrated to simple elements and implemented cancel for editing mode for Profile and Subscriptions table components * FUI - Reports - Moving to native elements (#2721) * Fixed forms styles (#2722) * Fixed layouts validation (#2723) * Fixed tooltip button position (#2724) Fixed scrolling on subscription rename/cancel * FUI - React runtime files, Search field and Profile page adjustments (#2725) * FUI - Migration to native elements - React runtime * FUI - Moving to native elements - Search field * FUI - Fixed Profile page Account table styles * FUI - Profile page Subscriptions full table adjustments * Master branch merge (#2726) * FUI - React runtime files - Products and User (#2728) * FUI - React runtime files - Products * FUI - React runtime files - User * FUI - React runtime files - Renaming (#2729) * Added new password validation must be different from old (#2730) * Update package.json engines to require Node pre v20 (#2731) * Update package.json engines to require Node pre v20 * upd * Add IDEA specific files to .gitignore (#2732) * Fixed filtering by tag for apis widget (#2735) * Fixed filtering by tag for apis widget * Fixed editor update event propagate to widget (#2737) * Fixed: Operation details does not show request headers and parameters and Required headers were NOT added in test Console * Added validation for required parameters and headers in Operation console (#2739) * Added reveal secret button and removed tags from HTTP response content format (#2740) * FUI - Removed autocomplete for search to fix Edge behaviour (#2742) * Upgraded Paperbits libraries to 0.1.631 * FUI - Removed autocomplete for search to fix Edge behaviour * Fixed examples displaying in the Operation details widget in knockout (#2745) * Fixed Page name displaying in admin top panel (#2749) * Paperbits packages upgrade to 0.1.632 (#2748) * Master merge into fui/master (#2750) * FUI - Fixed GraphQL console fields (#2751) * FUI - Visual code improvements (#2752) * Implemented service worker to intercept network traces, added tracking simple page navigation (#2743) * Added sent page load metrics to backend logs * Added service worker, network traces and tracking simple page navigation * Clean sensitive data from traces parameters * Added feature flag for client telemetry * added clean up worker if feature flag is disabled * extended user event logging for buttons clicks * improved logging messages format * set console logger by default and improved user interaction logging * FUI - Fixed invalid query variables format (#2753) * Popup over collapsible menu z-index fix (#2754) * FUI - Fixed multiple bugs * FUI - Fixed multiple bugs (#2757) * FUI - Fixed font not being customizable * FUI - Fixed font not being customizable (#2758) * FUI - Getting language from content-type header in GQL console * FUI - Getting language from content-type header in GQL console (#2759) * FUI - Fixed get header function * FUI - Removed setting language for the response * Updated packages and GQL response formatting * Added runtime redesign content snapshot * Fixed sign in button width * Fixed required styles for parameters in test console * Changed image uris in the default content (#2760) Co-authored-by: Roman I. Kolesnikov false <rokolesnikov@microsoft.com> * FUI - Pagination rework for API and Product lists (#2770) * Updated operations layout. * Upgraded libraries. * Upgraded libraries. * FUI - Pagination accessibility adjustments (#2772) * FUI - Scrollable tables and fixed form data inputs (#2773) * FUI - Margin fixes and updated template file (#2774) * Updated picture URLs in the default template. * Updated labels on signup form buttons. * FUI - Redesign enabling logging (#2775) * FUI - Redesign enabling logging in runtime (#2776) * Reverted default.json file content * FUI - Captcha size and custom widgets configs load fixes * Fixing failing e2e tests * maxDiffPixels property fix * FUI - Added support to reset portal to old default.json with feature flag setting * FUI - Setting for enabling new or old theme (#2778) * FUI - GQL console WS part (#2779) * Try/catch-es for isRedesignEnabled setting (#2780) * Try/catch-es for isRedesignEnabled setting * FUI - Logger in GQL console * FUI - Bug fixes for User pages (#2781) * Fixed static build with old data * Adjusted tests for the latest UI --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com> Co-authored-by: Michael Liu <practicalvb@yahoo.com> Co-authored-by: malincrist <92857141+malincrist@users.noreply.github.com> Co-authored-by: jan-mrm <67435696+jan-mrm@users.noreply.github.com> Co-authored-by: Alexander Zaslonov <alzaslon@microsoft.com> Co-authored-by: Ján Mach <92859870+JMach1@users.noreply.github.com> Co-authored-by: Carlos Perez <carlosperez@microsoft.com> Co-authored-by: Jan Mach <janmach1@microsoft.com> Co-authored-by: Farhad Alizada <104755925+f-alizada@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: sthirthala <38636149+sthirthala@users.noreply.github.com> Co-authored-by: Roman Kolesnikov <14820428+rkolesnikovDX@users.noreply.github.com> Co-authored-by: Roman Kolesnikov <rokolesnikov@microsoft.com> Co-authored-by: Igor O <ygrik@hotmail.com> Co-authored-by: Max Podriezov <maxpodriezov@microsoft.com> Co-authored-by: Emmanuel Ferdman <emmanuelferdman@gmail.com> Co-authored-by: Eugene Tsakh <onatolich@gmail.com> Co-authored-by: Igor O <igo@microsoft.com>
1 parent 1540140 commit 7861b76

File tree

386 files changed

+30618
-10547
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

386 files changed

+30618
-10547
lines changed

package-lock.json

Lines changed: 12425 additions & 8704 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
"postcss-loader": "^7.3.3",
5858
"querystring-es3": "^0.2.1",
5959
"raw-loader": "^4.0.2",
60-
"sass": "^1.67.0",
61-
"sass-loader": "^13.3.2",
60+
"sass": "1.67.0",
61+
"sass-loader": "13.3.2",
6262
"stream-browserify": "^3.0.0",
6363
"style-loader": "^3.3.3",
6464
"terser-webpack-plugin": "^5.3.9",
@@ -76,15 +76,19 @@
7676
"@azure/msal-browser": "^2.37.1",
7777
"@braintree/sanitize-url": "6.0.4",
7878
"@fluentui/font-icons-mdl2": "^8.5.9",
79-
"@fluentui/react": "^8.105.11",
79+
"@fluentui/react": "^8.117.7",
80+
"@fluentui/react-charting": "^5.22.5",
81+
"@fluentui/react-components": "^9.49.0",
82+
"@fluentui/react-icons": "^2.0.237",
8083
"@microsoft/applicationinsights-web": "^3.0.2",
8184
"@monaco-editor/loader": "^1.3.3",
82-
"@paperbits/azure": "^0.1.634",
83-
"@paperbits/common": "^0.1.634",
84-
"@paperbits/core": "^0.1.634",
85-
"@paperbits/forms": "^0.1.634",
85+
"@monaco-editor/react": "^4.6.0",
86+
"@paperbits/azure": "^0.1.643",
87+
"@paperbits/common": "^0.1.643",
88+
"@paperbits/core": "^0.1.643",
89+
"@paperbits/forms": "^0.1.643",
8690
"@paperbits/react": "1.0.8",
87-
"@paperbits/styles": "^0.1.634",
91+
"@paperbits/styles": "^0.1.643",
8892
"@webcomponents/custom-elements": "1.6.0",
8993
"@webcomponents/shadydom": "^1.11.0",
9094
"client-oauth2": "4.3.3",
@@ -114,10 +118,13 @@
114118
"react": "^18.2.0",
115119
"react-cropper": "^2.3.2",
116120
"react-dom": "^18.2.0",
121+
"react-markdown": "^8.0.7",
122+
"react-syntax-highlighter": "^15.5.0",
117123
"react-toastify": "^9.1.3",
118124
"rehype-raw": "^6.1.1",
119125
"rehype-sanitize": "^5.0.1",
120126
"rehype-stringify": "^9.0.3",
127+
"rehype-truncate": "^1.2.2",
121128
"remark": "^14.0.3",
122129
"remark-gfm": "^3.0.1",
123130
"remark-parse": "^10.0.2",

playwright.config.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import { defineConfig } from '@playwright/test';
22

33
export default defineConfig({
4-
retries: 2,
5-
use: {
6-
video: 'retain-on-failure'
7-
}
4+
retries: 2,
5+
use: {
6+
video: 'retain-on-failure'
7+
},
8+
expect: {
9+
toMatchSnapshot: {
10+
maxDiffPixels: 20
11+
},
12+
},
813
});

src/admin/leftPanel.tsx

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import * as React from 'react';
22
import { Resolve } from '@paperbits/react/decorators';
3+
import { ISiteService } from '@paperbits/common/sites';
4+
import { EventManager } from '@paperbits/common/events';
35
import { ViewManager } from '@paperbits/common/ui';
46
import { Router } from '@paperbits/common/routing';
7+
import { Logger } from '@paperbits/common/logging';
58
import { initializeIcons } from '@fluentui/font-icons-mdl2';
6-
import { CommandBarButton, Icon, IIconProps, Separator, Stack, Text } from '@fluentui/react';
9+
import { CommandBarButton, Icon, IIconProps, Separator, Stack, Text, Toggle } from '@fluentui/react';
710
import { Pages } from './pages/pages';
811
import { Navigation } from './navigation/navigation';
912
import { Urls } from './urls/urls';
@@ -14,7 +17,7 @@ import { MediaModal } from './media/mediaModal';
1417
import { CustomWidgets } from './custom-widgets/customWidgets';
1518
import { OnboardingModal } from './onboardingModal';
1619
import { lightTheme } from './utils/themes';
17-
import { mobileBreakpoint } from '../constants';
20+
import { isRedesignEnabledSetting, mobileBreakpoint } from '../constants';
1821
initializeIcons();
1922

2023
const enum NavItem {
@@ -35,7 +38,8 @@ const enum NavItem {
3538
interface LeftPanelState {
3639
selectedNavItem: NavItem,
3740
isMobile: boolean,
38-
showOnboardingModal: boolean
41+
showOnboardingModal: boolean,
42+
isRedesignEnabled: boolean
3943
}
4044

4145
const pageIcon: IIconProps = { iconName: 'Page' };
@@ -53,24 +57,35 @@ const helpIcon: IIconProps = { iconName: 'Help' };
5357
const iconStyles = { root: { color: lightTheme.palette.themePrimary, fontSize: 20 } };
5458

5559
export class LeftPanel extends React.Component<{}, LeftPanelState> {
60+
@Resolve('siteService')
61+
public siteService: ISiteService;
62+
63+
@Resolve('eventManager')
64+
public eventManager: EventManager;
65+
5666
@Resolve('viewManager')
5767
public viewManager: ViewManager;
5868

5969
@Resolve('router')
6070
public router: Router;
6171

72+
@Resolve('logger')
73+
public logger: Logger;
74+
6275
constructor(props: any) {
6376
super(props);
6477

6578
this.state = {
6679
selectedNavItem: NavItem.Main,
6780
isMobile: window.innerWidth < mobileBreakpoint,
68-
showOnboardingModal: false
81+
showOnboardingModal: false,
82+
isRedesignEnabled: false
6983
};
7084
}
7185

7286
componentDidMount(): void {
7387
if (!localStorage.getItem('isOnboardingSeen')) this.setState({ showOnboardingModal: true });
88+
this.loadSettings();
7489

7590
window.addEventListener('resize', this.checkScreenSize.bind(this));
7691
}
@@ -79,6 +94,16 @@ export class LeftPanel extends React.Component<{}, LeftPanelState> {
7994
window.removeEventListener('resize', this.checkScreenSize.bind(this));
8095
}
8196

97+
loadSettings = async (): Promise<void> => {
98+
let redesignSetting = false;
99+
try {
100+
redesignSetting = await this.siteService.getSetting(isRedesignEnabledSetting);
101+
} catch (error) {
102+
this.logger?.trackError(error, { message: `Failed to get setting: ${isRedesignEnabledSetting} - admin panel` });
103+
}
104+
this.setState({ isRedesignEnabled: !!redesignSetting });
105+
}
106+
82107
checkScreenSize = (): void => {
83108
if (window.innerWidth < mobileBreakpoint) {
84109
this.setState({ isMobile: true });
@@ -213,10 +238,25 @@ export class LeftPanel extends React.Component<{}, LeftPanelState> {
213238
}}
214239
/>
215240
</Stack>
216-
{ this.renderNavItemsSwitch(this.state.selectedNavItem) }
241+
<div className="side-panel-content">
242+
{ this.renderNavItemsSwitch(this.state.selectedNavItem) }
243+
</div>
217244
{ this.state.selectedNavItem === NavItem.Media && <MediaModal onDismiss={this.handleBackButtonClick.bind(this)} /> }
218245
{ this.state.selectedNavItem === NavItem.Settings && <SettingsModal onDismiss={this.handleBackButtonClick.bind(this)} /> }
219246
{ this.state.selectedNavItem === NavItem.Help && <HelpModal onDismiss={this.handleBackButtonClick.bind(this)} /> }
247+
<Toggle
248+
label={"Preview new UI design"}
249+
onText={"On"}
250+
offText={"Off"}
251+
checked={this.state.isRedesignEnabled}
252+
onChange={async (_, checked) => {
253+
this.setState({ isRedesignEnabled: checked });
254+
await this.siteService.setSetting(isRedesignEnabledSetting, checked);
255+
this.logger.trackEvent(`${checked ? 'Checked' : 'Unchecked'}: Preview new UI design`);
256+
this.eventManager.dispatchEvent('onSaveChanges');
257+
this.eventManager.dispatchEvent('onDataPush'); // Needed to reload the runtime part
258+
}}
259+
/>
220260
</div>
221261
</>
222262
)

src/admin/settings/settingsModal.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ISiteService, SiteSettingsContract } from '@paperbits/common/sites';
55
import { IMediaService, MediaContract } from '@paperbits/common/media';
66
import { MetaDataSetter } from "@paperbits/common/meta/metaDataSetter";
77
import { EventManager } from '@paperbits/common/events';
8-
import { Checkbox, CommandBarButton, DefaultButton, Icon, Image, ImageFit, Label, Link, Modal, Pivot, PivotItem, PrimaryButton, Stack, Text, TextField } from '@fluentui/react';
8+
import { Checkbox, CommandBarButton, DefaultButton, Image, ImageFit, Label, Modal, Pivot, PivotItem, PrimaryButton, Stack, Text, TextField } from '@fluentui/react';
99
import { MediaSelectionItemModal } from '../media/mediaSelectionItemModal';
1010
import { getThumbnailUrl } from '../utils/helpers';
1111
import { ResetDetailsWorkshop } from '../../components/content';
@@ -23,7 +23,8 @@ interface SettingsModalState {
2323
selectedFavicon: MediaContract,
2424
showMediaSelectionModal: boolean,
2525
showResetConfirmation: boolean,
26-
resetConfirmation: string
26+
resetConfirmation: string,
27+
applyNewTheme: boolean
2728
}
2829

2930
interface SettingsModalProps {
@@ -56,7 +57,8 @@ export class SettingsModal extends React.Component<SettingsModalProps, SettingsM
5657
selectedFavicon: null,
5758
showMediaSelectionModal: false,
5859
showResetConfirmation: false,
59-
resetConfirmation: ''
60+
resetConfirmation: '',
61+
applyNewTheme: true
6062
}
6163
}
6264

@@ -106,9 +108,9 @@ export class SettingsModal extends React.Component<SettingsModalProps, SettingsM
106108

107109
saveChanges = async (): Promise<void> => {
108110
if (this.state.selectedTab === Tab.Advanced) {
109-
this.resetDetailsWorkshop.reset();
111+
this.resetDetailsWorkshop.reset(this.state.applyNewTheme);
110112
} else {
111-
await this.siteService.setSetting('site', this.state.settings);
113+
await this.siteService.setSetting<SiteSettingsContract>('site', this.state.settings);
112114
this.eventManager.dispatchEvent('onSaveChanges');
113115
}
114116

@@ -193,6 +195,12 @@ export class SettingsModal extends React.Component<SettingsModalProps, SettingsM
193195
<Stack className="reset-content-wrapper">
194196
<Text block styles={{ root: { fontWeight: 600 } }}>Restore website to default state</Text>
195197
<Text block>By resetting the website, all the pages, layouts, customizations, and uploaded media, will be deleted. The published version of the developer portal will not be deleted.</Text>
198+
<Checkbox
199+
label="Apply new starter theme"
200+
checked={this.state.applyNewTheme}
201+
onChange={() => this.setState({ applyNewTheme: !this.state.applyNewTheme })}
202+
styles={{ root: { paddingTop: '10px' } }}
203+
/>
196204
<Checkbox
197205
label="Yes, reset the website to default state"
198206
checked={this.state.showResetConfirmation}

src/apim.design.module.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ReactModule } from "@paperbits/react/react.module";
12
import * as Constants from "./constants";
23
import "./bindingHandlers/codeEditor";
34
import "./bindingHandlers/copyToClipboard";
@@ -9,11 +10,11 @@ import { ConsoleLogger } from "@paperbits/common/logging";
910
import { DefaultSessionManager } from "@paperbits/common/persistence/defaultSessionManager";
1011
import { HistoryRouteHandler } from "@paperbits/common/routing";
1112
import { RoleBasedSecurityDesignModule } from "@paperbits/core/security/roleBasedSecurity.design.module";
12-
import { ListOfApisDesignModule } from "./components/apis/list-of-apis/ko/listOfApisEditor.module";
13-
import { DetailsOfApiDesignModule } from "./components/apis/details-of-api/ko/detailsOfApiEditor.module";
14-
import { HistoryOfApiEditorModule as HistoryOfApiDesignModule } from "./components/apis/history-of-api/ko/historyOfApiEditor.module";
13+
import { ListOfApisDesignModule } from "./components/apis/list-of-apis/listOfApis.design.module";
14+
import { DetailsOfApiDesignModule } from "./components/apis/details-of-api/detailsOfApi.design.module";
15+
import { HistoryOfApiDesignModule } from "./components/apis/history-of-api/historyOfApi.design.module";
1516
import { SigninDesignModule } from "./components/users/signin/signin.design.module";
16-
import { SigninSocialEditorModule as SigninSocialDesignModule } from "./components/users/signin-social/signinSocial.design.module";
17+
import { SigninSocialDesignModule } from "./components/users/signin-social/signinSocial.design.module";
1718
import { SignupSocialDesignModule } from "./components/users/signup-social/signupSocial.design.module";
1819
import { SignupDesignModule } from "./components/users/signup/signup.design.module";
1920
import { ProfileDesignModule } from "./components/users/profile/profile.design.module";
@@ -23,18 +24,18 @@ import { MapiClient, IdentityService } from "./services";
2324
import { SetupModule } from "./components/setup/setup.module";
2425
import { ContentModule } from "./components/content";
2526
import { CustomWidgetListModule } from "./components/custom-widget-list";
26-
import { OperationListEditorModule as OperationListDesignModule } from "./components/operations/operation-list/ko/operationListEditor.module";
27+
import { OperationListDesignModule } from "./components/operations/operation-list/operationList.design.module";
2728
import { OperationDetailsDesignModule } from "./components/operations/operation-details/operationDetails.design.module";
28-
import { ProductListEditorModule as ProductListDesignModule } from "./components/products/product-list/ko/productListEditor.module";
29-
import { ProductSubscribeEditorModule as ProductSubscribeDesignModule } from "./components/products/product-subscribe/ko/productSubscribeEditor.module";
30-
import { ProductApisEditorModule as ProductApisDesignModule } from "./components/products/product-apis/ko/productApisEditor.module";
31-
import { ProductSubscriptionsEditorModule as ProductSubscriptionsDesignModule } from "./components/products/product-subscriptions/ko/productSubscriptionsEditor.module";
29+
import { ProductListDesignModule } from "./components/products/product-list/productList.design.module";
30+
import { ProductSubscribeDesignModule } from "./components/products/product-subscribe/productSubscribe.design.module";
31+
import { ProductApisDesignModule } from "./components/products/product-apis/productApis.design.module";
32+
import { ProductSubscriptionsDesignModule } from "./components/products/product-subscriptions/productSubscriptions.design.module";
3233
import { App } from "./components/app/app";
33-
import { ReportsEditorModule as ReportsDesignModule } from "./components/reports/ko/reportsEditor.module";
34+
import { ReportsDesignModule } from "./components/reports/reports.design.module";
3435
import { ResetPasswordDesignModule } from "./components/users/reset-password/resetPassword.design.module";
35-
import { ConfirmPasswordEditorModule as ConfirmPasswordDesignModule } from "./components/users/confirm-password/ko/confirmPasswordEditor.module";
36+
import { ConfirmPasswordDesignModule } from "./components/users/confirm-password/confirmPassword.design.module";
3637
import { HelpModule } from "./components/help";
37-
import { ChangePasswordEditorModule as ChangePasswordDesignModule } from "./components/users/change-password/ko/changePasswordEditor.module";
38+
import { ChangePasswordDesignModule } from "./components/users/change-password/changePassword.design.module";
3839
import { TenantService } from "./services/tenantService";
3940
import { ValidationSummaryDesignModule } from "./components/users/validation-summary/validationSummary.design.module";
4041
import { BackendService } from "./services/backendService";
@@ -44,16 +45,16 @@ import { PolicyService } from "./services/policyService";
4445
import { OAuthService } from "./services/oauthService";
4546
import { OldContentRouteGuard } from "./routing/oldContentRouteGuard";
4647
import { AccessTokenRefrsher } from "./authentication/accessTokenRefresher";
47-
import { ApiProductsDesignModule } from "./components/apis/api-products/ko/apiProductsEditor.module";
48+
import { ApiProductsDesignModule } from "./components/apis/api-products/apiProducts.design.module";
4849
import { RuntimeConfigurator } from "./services/runtimeConfigurator";
4950
import { CustomHtmlDesignModule } from "./components/custom-html/customHtml.design.module";
5051
import { CustomWidgetDesignModule } from "./components/custom-widget/customWidget.design.module";
5152
import { CodeEditor } from "./components/code-editor/code-editor";
5253

53-
5454
export class ApimDesignModule implements IInjectorModule {
5555
public register(injector: IInjector): void {
5656
injector.bindModule(new SetupModule());
57+
injector.bindModule(new ReactModule());
5758
injector.bindModule(new ListOfApisDesignModule());
5859
injector.bindModule(new ApiProductsDesignModule());
5960
injector.bindModule(new DetailsOfApiDesignModule());

0 commit comments

Comments
 (0)