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

Chores/segments, permissions and tags typescript #1930

Merged
merged 134 commits into from
Feb 27, 2023

Conversation

kyle-ssg
Copy link
Member

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?

Changes

Please describe.

How did you test this code?

Please describe.

# Conflicts:
#	frontend/package-lock.json
#	frontend/package.json
# Conflicts:
#	frontend/package-lock.json
#	frontend/package.json
…chores/initial_typescript

# Conflicts:
#	frontend/package-lock.json
#	frontend/package.json
@kyle-ssg kyle-ssg changed the base branch from chores/permissions_typescript to chores/identity_list_typescript February 24, 2023 08:15
…ypescript

# Conflicts:
#	frontend/common/dispatcher/action-constants.js
#	frontend/common/utils/utils.tsx
#	frontend/web/components/EditPermissions.js
#	frontend/web/components/modals/CreateSegment.tsx
#	frontend/web/components/pages/WidgetPage.tsx
…ypescript

# Conflicts:
#	frontend/common/constants.ts
#	frontend/common/stores/project-store.js
#	frontend/web/components/pages/SegmentsPage.tsx
#	frontend/web/components/pages/WidgetPage.tsx
@kyle-ssg kyle-ssg changed the title Chores/segments and tags typescript Chores/segments, permissions and tags typescript Feb 24, 2023
@@ -1,18 +1,30 @@
import React, {Component, useEffect, useState} from 'react';
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a refactor of the Widget page to fix all the types, as part of this I have regression tested the integration. It fixes a few states
image

Copy link
Contributor

@matthewelwell matthewelwell left a comment

Choose a reason for hiding this comment

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

Added a couple of minor comments on some (possible) typos. I will also do some testing in the Uffizzi environment.

frontend/common/utils/utils.tsx Outdated Show resolved Hide resolved
frontend/web/components/pages/AuditLogPage.tsx Outdated Show resolved Hide resolved
@matthewelwell
Copy link
Contributor

A couple of issues I've found:

  1. Unable to add new rules / conditions to a segment:
Screen.Recording.2023-02-24.at.12.45.36.mov
  1. Registering as a user from an invite without any permissions gives a blank screen and the following console error:
react-dom.production.min.js:187 ReferenceError: Permission is not defined
    at Object.children (App.js:343:66)
    at r.render (AccountProvider.js:98:24)
    at da (react-dom.production.min.js:173:192)
    at ca (react-dom.production.min.js:172:282)
    at Ns (react-dom.production.min.js:247:361)
    at xs (react-dom.production.min.js:216:164)
    at ks (react-dom.production.min.js:210:471)
    at ys (react-dom.production.min.js:206:372)
    at react-dom.production.min.js:114:115
    at t.unstable_runWithPriority (scheduler.production.min.js:20:134)

More details here: #1801 (comment).

Note that, even when given view project / view environment permission the blank page / console error persists.

Base automatically changed from chores/identity_list_typescript to main February 24, 2023 13:14
@kyle-ssg
Copy link
Member Author

kyle-ssg commented Feb 25, 2023

Something very weirds going on, since the E2E can obviously do this locally and on GH. Checking this out now after all of the conflicts

# Conflicts:
#	frontend/common/dispatcher/action-constants.js
#	frontend/common/dispatcher/app-actions.js
#	frontend/common/services/useIdentity.ts
#	frontend/common/types/requests.ts
#	frontend/common/types/responses.ts
#	frontend/common/utils/utils.tsx
#	frontend/web/components/ChipInput.tsx
#	frontend/web/components/modals/CreateSegment.tsx
#	frontend/web/components/pages/AuditLogPage.tsx
#	frontend/web/components/pages/UsersPage.tsx
@kyle-ssg
Copy link
Member Author

After looking into this, I realised that linting is missing on quite a few files which is how the Permissions import was missed. I'll have to do a follow up PR to resolve that.

@@ -46,10 +47,6 @@ const FeatureListProvider = class extends React.Component {
AppActions.toggleFlag(i, environments, comment, environmentFlags, projectFlags);
};

setFlag = (i, flag, environments) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Unused / action no longer exists

@@ -44,6 +44,7 @@ module.exports = Object.assign({}, EventEmitter.prototype, {

loaded() {
this.hasLoaded = true;
this.error = null;
Copy link
Member Author

Choose a reason for hiding this comment

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

This was causing the datadog widget to appear in the error state after loading

@kyle-ssg
Copy link
Member Author

I've adjusted the lint slightly to make the next PR less huge and to rule out any possibility of further missing imports. Excluding superficial spacing lints, it got down to 0 errors.

Copy link
Contributor

@matthewelwell matthewelwell left a comment

Choose a reason for hiding this comment

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

@kyle-ssg the two issues above seem to be resolved and I've been through the code again - all looks good to me.

@kyle-ssg kyle-ssg merged commit 7481fda into main Feb 27, 2023
@kyle-ssg kyle-ssg deleted the chores/segments_typescript branch February 27, 2023 16:21
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.

2 participants