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

A few more store -> core dependency fixes #4383

Merged
merged 13 commits into from
Jun 23, 2020
Merged

Conversation

nwmac
Copy link
Contributor

@nwmac nwmac commented Jun 18, 2020

  • Move BaseEndpointAuth
  • Move StratosTheme
  • Move ThemeService
  • Move types from utils.service that are only used once in store
  • Move PermissionValues
  • Move http and jetstream helpers

@nwmac nwmac self-assigned this Jun 18, 2020
@nwmac nwmac added the blocked label Jun 18, 2020
@nwmac nwmac changed the title A few more Store -> Core dependency fixes A few more store -> core dependency fixes Jun 19, 2020
@nwmac nwmac removed the blocked label Jun 23, 2020
Copy link
Contributor

@richard-cox richard-cox left a comment

Choose a reason for hiding this comment

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

A few minor grouping questions

@@ -6,7 +8,6 @@ export interface IPermissionConfigs {
export type PermissionTypes = string;
export type CurrentUserPermissions = string;
export type ScopeStrings = string;
export type PermissionValues = string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a comment, we may find these other types will be referenced by plugins such as cloud-foundry. It might make sense at that point to group them all together in an types file that exposes all

return pages.find(page => {
return isJetstreamError(page);
}) as JetStreamErrorResponse;
}

export function jetStreamErrorResponseToSafeString(response: JetStreamErrorResponse): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should move this too, purely so all the jetsream error handlers are in the same place (function is only used in one file in cf package)

props.indexOf('url') >= 0
) ? obj as HttpErrorResponse : null;
}

/**
* Attempt to create a sensible string explaining the error object returned from a failed http request
* @param err The raw error from a http request
Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking about it, not sure if we want to move this as well, which would be the whole contents of the file. This function is only used in core though, but it's a similar error handler

@richard-cox richard-cox added the needs attention This PR needs attention label Jun 23, 2020
@nwmac nwmac added comments-addressed and removed needs attention This PR needs attention labels Jun 23, 2020
@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@64b430d). Click here to learn what that means.
The diff coverage is 78.70%.

@@            Coverage Diff            @@
##             master    #4383   +/-   ##
=========================================
  Coverage          ?   58.97%           
=========================================
  Files             ?      891           
  Lines             ?    29154           
  Branches          ?     4224           
=========================================
  Hits              ?    17194           
  Misses            ?    11960           
  Partials          ?        0           

@@ -2,27 +2,3 @@ import { HttpErrorResponse } from '@angular/common/http';

import { isHttpErrorResponse, JetStreamErrorResponse } from '../../store/src/jetstream';
Copy link
Contributor

Choose a reason for hiding this comment

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

This file can be nuked in a future PR

@richard-cox richard-cox merged commit 0e60818 into master Jun 23, 2020
@richard-cox richard-cox deleted the store-core-more2 branch June 23, 2020 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants