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

Read data about selected integration connectors #141

Merged
merged 5 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cypress/e2e/OutcomeFlow/outcome.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ describe('Outcome Page', () => {
cy.get('[value="xm"]').click();
cy.get('[value="nosecuredpages"]').click();
cy.get('[value="search-no"]').click();
cy.get('[value="xp-connect-none"]').click();
cy.get('.css-gmuwbf > .chakra-button').click();
cy.get('[value="scs"]').click();
cy.get('[value="vuejs"]').click();
cy.get('.css-gmuwbf > .chakra-button').click();
Expand Down Expand Up @@ -44,6 +46,8 @@ describe('Outcome Page', () => {
cy.get('[value="securityloginrequired"]').click();
cy.get('[value="historicalpersonalize90"]').click();
cy.get('[value="search-index"]').click();
cy.get('[value="xp-connect-none"]').click();
cy.get('.css-gmuwbf > .chakra-button').click();
cy.get('[value="unicorn"]').click();
cy.get('[value="netcore"]').click();
cy.get('.css-gmuwbf > .chakra-button').click();
Expand Down
46 changes: 46 additions & 0 deletions src/lib/GameContextParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class GameContextParser {
this.parseContext_ExperienceEdge(gameInfoContext, outcomeConditions);
this.parseContext_SiteSearchUsed(gameInfoContext, outcomeConditions);
this.parseContext_SerializationUsed(gameInfoContext, outcomeConditions);
this.parseContext_ConnectorsUsed(gameInfoContext, outcomeConditions);
}

/**
Expand Down Expand Up @@ -223,4 +224,49 @@ export class GameContextParser {
outcomeConditions.serializationUsed.unicorn = serializationUsedOptions.value.includes('unicorn');
}
}

/**
* Check for what type of integration connection modules are in the solution.
* This will drive them towards a Connect implementation (likely)
* @param gameInfoContext: This is the current context which contains the prompts and answers
* @param outcomeConditions: This is where the results should be stored
*/
parseContext_ConnectorsUsed(gameInfoContext: GameInfoContextType, outcomeConditions: OutcomeConditions) {
var connectorsUsedOptions = gameInfoContext.answers?.find(
(x: IAnswer) => x.promptQuestionId == PromptMappings.connectorsUsed
);
if (connectorsUsedOptions != undefined) {
outcomeConditions.connectorsUsed.none = connectorsUsedOptions.value.includes('xp-connect-none');

//Only read the other options if None is not selected. Blank out all selections if user selected None
//Technically, because it's a multi-select, they could select a connector and None, but we will use 'None' to rule out other selections
if (outcomeConditions.connectorsUsed.none) {
outcomeConditions.connectorsUsed = {
none: true,
sfmc: false,
sfcrm: false,
contenthub: false,
dam: false,
cmp: false,
dynamics365commerce: false,
dynamics365sales: false,
komfo: false,
sharepoint: false
};
}
//If they didn't select None, read the rest of their selections
else {
outcomeConditions.connectorsUsed.sfmc = connectorsUsedOptions.value.includes('xp-connect-sfmc');
outcomeConditions.connectorsUsed.sfcrm = connectorsUsedOptions.value.includes('xp-connect-sfcrm');
outcomeConditions.connectorsUsed.contenthub = connectorsUsedOptions.value.includes('xp-connect-contenthub');
outcomeConditions.connectorsUsed.dam = connectorsUsedOptions.value.includes('xp-connect-dam');
outcomeConditions.connectorsUsed.cmp = connectorsUsedOptions.value.includes('xp-connect-cmp');
outcomeConditions.connectorsUsed.dynamics365commerce = connectorsUsedOptions.value.includes('xp-commerce-dynamics365-commerce');
outcomeConditions.connectorsUsed.dynamics365sales = connectorsUsedOptions.value.includes('xp-connect-dynamics365sales');
outcomeConditions.connectorsUsed.komfo = connectorsUsedOptions.value.includes('xp-komfo');
outcomeConditions.connectorsUsed.sharepoint = connectorsUsedOptions.value.includes('xp-sharepoint');
}

}
}
}
4 changes: 2 additions & 2 deletions src/models/OutcomeConditions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export interface IConnectorsUsed {
contenthub: boolean,
dam: boolean,
cmp: boolean,
dynamics365: boolean,
dynamics365commerce: boolean,
dynamics365sales: boolean,
komfo: boolean,
sharepoint: boolean,
Expand Down Expand Up @@ -181,7 +181,7 @@ export class OutcomeConditions {
contenthub: false,
dam: false,
cmp: false,
dynamics365: false,
dynamics365commerce: false,
dynamics365sales: false,
komfo: false,
sharepoint: false
Expand Down
1 change: 1 addition & 0 deletions src/models/PromptMappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export enum PromptMappings {
siteSearchUsed = 'sitesearch',
historicalPersonalization = 'historicalpersonalizationneeds',
serializationUsed = 'serialization',
connectorsUsed = 'integrationmodules',
}
Loading