Skip to content

[Enterprise Search] Adds app logic file to Workplace Search#76009

Merged
scottybollinger merged 6 commits intoelastic:masterfrom
scottybollinger:ws-app-logic
Aug 26, 2020
Merged

[Enterprise Search] Adds app logic file to Workplace Search#76009
scottybollinger merged 6 commits intoelastic:masterfrom
scottybollinger:ws-app-logic

Conversation

@scottybollinger
Copy link
Contributor

Summary

This PR adds an app_logic file to Workplace Search. It also introduces 2 new server properties, canCreateInvitations and isFederatedAuth. Finally, a refactor is done on the main index component

Checklist

Delete any items that are not applicable to this PR.

For maintainers

Adds the easier-to-read ComponentConfigured and ComponentUnconfigured FCs with a ternary in the root compoenent
@scottybollinger scottybollinger added Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.10.0 labels Aug 26, 2020

expect(wrapper.find(ErrorState).exists()).toBe(true);
expect(wrapper.find(Overview)).toHaveLength(0);
expect(wrapper.find(ErrorState)).toHaveLength(2);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The hidden routes, with navigation, also have an ErrorState

This allows for breaking apart the app-specific data and also having an interface to extend in the app_logic file
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

@kbn/optimizer bundle module count

id value diff baseline
enterpriseSearch 201 +1 200

async chunks size

id value diff baseline
enterpriseSearch 350.3KB +1.2KB 349.0KB

distributable file count

id value diff baseline
total 53198 +1 53197

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

🎉 Looks great! Thanks for the super granular PR!

export const WorkplaceSearch: React.FC<IInitialAppData> = () => {
export const WorkplaceSearch: React.FC<IInitialAppData> = (props) => {
const { config } = useContext(KibanaContext) as IKibanaContext;
return !config.host ? <WorkplaceSearchUnconfigured /> : <WorkplaceSearchConfigured {...props} />;
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉 Glad you liked this pattern I used in App Search!

Comment on lines +30 to +31
const { hasInitialized } = useValues(AppLogic) as IAppValues;
const { initializeAppData } = useActions(AppLogic) as IAppActions;
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder to self: I should update App Search's IAppLogicValues/Actions types to remove the Logic

@scottybollinger scottybollinger merged commit 35b8d50 into elastic:master Aug 26, 2020
@scottybollinger scottybollinger deleted the ws-app-logic branch August 26, 2020 21:21
scottybollinger added a commit that referenced this pull request Aug 26, 2020
…76040)

* Add new Workplace Search initial data properties

* Add app logic

* Refactor index to match App Search

Adds the easier-to-read ComponentConfigured and ComponentUnconfigured FCs with a ternary in the root compoenent

* Remove ‘Logic’ from interface names

* Extract initial data from WS into interface

This allows for breaking apart the app-specific data and also having an interface to extend in the app_logic file

* Destructuring FTW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.10.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants