Skip to content

Commit

Permalink
Main -> Val (#139479)
Browse files Browse the repository at this point in the history
  • Loading branch information
BearHanded authored Oct 11, 2023
2 parents 2b41931 + caa5805 commit 452ecc4
Show file tree
Hide file tree
Showing 15 changed files with 4,712 additions and 5,370 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/scan_security-hub-jira-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
role-to-assume: ${{ secrets.PRODUCTION_SYNC_OIDC_ROLE }}
- name: Sync Security Hub and Jira
uses: Enterprise-CMCS/[email protected].3
uses: Enterprise-CMCS/[email protected].5
with:
jira-token: ${{ secrets.JIRA_SERVICE_USER_TOKEN }}
jira-username: ${{ secrets.JIRA_SERVICE_USERNAME }}
Expand All @@ -31,3 +31,4 @@ jobs:
jira-ignore-statuses: Done, Closed, Canceled
jira-custom-fields: '{ "customfield_14154" : [{"id": "16955", "value": "CARTS"}] }'
aws-severities: CRITICAL, HIGH, MEDIUM
assign-jira-ticket-to: ${{ secrets.ACCOUNT_ID_REHMAN }}
6 changes: 6 additions & 0 deletions services/app-api/libs/validation/backend-section.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ export const sectionSchema = {
comment: {
type: "string",
},
addAnotherText: {
type: ["string", "null"],
},
hideOptionalHint: {
type: ["boolean", "null"],
},
questions: {
type: "array",
items: {
Expand Down
10 changes: 10 additions & 0 deletions services/carts-bigmac-streams/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,20 @@ plugins:
- serverless-online
- serverless-iam-helper
- serverless-s3-bucket-helper
- serverless-stack-termination-protection

custom:
stage: ${opt:stage, self:provider.stage}
region: ${opt:region, self:provider.region}
serverlessTerminationProtection:
stages: # This is a list of common names for important envs that should not be destroyed. You can remove the stage names your project doesn't use; this list is meant to be inclusive.
- master
- val
- production
- develop
- main
- impl
- prod
kafkaConnectImage: ${ssm:/configuration/${self:custom.stage}/kafka_connect_image, ssm:/configuration/default/kafka_connect_image,"confluentinc/cp-kafka-connect:6.2.0"}
bootstrapBrokerStringTls: ${ssm:/configuration/${self:custom.stage}/bigmac/bootstrapBrokerStringTls, ssm:/configuration/default/bigmac/bootstrapBrokerStringTls}
vpcId: ${ssm:/configuration/${self:custom.stage}/vpc/id, ssm:/configuration/default/vpc/id}
Expand Down
6 changes: 3 additions & 3 deletions services/carts-bigmac-streams/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5295,9 +5295,9 @@ postcss-value-parser@^4.1.0:
integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==

postcss@^8.2.15:
version "8.4.22"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.22.tgz#c29e6776b60ab3af602d4b513d5bd2ff9aa85dc1"
integrity sha512-XseknLAfRHzVWjCEtdviapiBtfLdgyzExD50Rg2ePaucEesyh8Wv4VPdW0nbyDa1ydbrAxV19jvMT4+LFmcNUA==
version "8.4.31"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.31.tgz#92b451050a9f914da6755af352bdc0192508656d"
integrity sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==
dependencies:
nanoid "^3.3.6"
picocolors "^1.0.0"
Expand Down
151 changes: 5 additions & 146 deletions services/database/data/seed/seed-section-base-2023.json
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@
"parts": [
{
"id": "2023-02-a-01",
"text": "This table is pre-filled with your SEDS data for the two most recent federal fiscal years (FFY). If the information is inaccurate, adjust your data in SEDS (go to line 7: “Unduplicated Number Ever Enrolled” in your fourth quarter SEDS report) and then refresh this page. If you’re adjusting data in SEDS, allow one business day for the CARTS data below to update.",
"text": "This table is pre-filled with your SEDS data for the two most recent federal fiscal years (FFY). The percent change column in the table below calculates the rate of growth in enrollment over the previous federal fiscal year by subtracting the previous fiscal year enrollment total from the current fiscal year enrollment total (B - A), and dividing that by the previous fiscal year total (A). If the information is inaccurate, adjust your data in SEDS (go to line 7: “Unduplicated Number Ever Enrolled” in your fourth quarter SEDS report) and then refresh this page. If you’re adjusting data in SEDS, allow one business day for the CARTS data below to update.",
"type": "part",
"title": "Number of Children Enrolled in CHIP",
"questions": [
Expand Down Expand Up @@ -1745,151 +1745,6 @@
"fieldset_id": "synthesized-table-2-2",
"fieldset_info": {
"rows": [
[
{
"contents": "2013"
},
{
"lookupAcs": {
"ffy": "2013",
"acsProperty": "numberUninsured"
}
},
{
"lookupAcs": {
"ffy": "2013",
"acsProperty": "numberUninsuredMoe"
}
},
{
"lookupAcs": {
"ffy": "2013",
"acsProperty": "percentUninsured"
}
},
{
"lookupAcs": {
"ffy": "2013",
"acsProperty": "percentUninsuredMoe"
}
}
],
[
{
"contents": "2014"
},
{
"lookupAcs": {
"ffy": "2014",
"acsProperty": "numberUninsured"
}
},
{
"lookupAcs": {
"ffy": "2014",
"acsProperty": "numberUninsuredMoe"
}
},
{
"lookupAcs": {
"ffy": "2014",
"acsProperty": "percentUninsured"
}
},
{
"lookupAcs": {
"ffy": "2014",
"acsProperty": "percentUninsuredMoe"
}
}
],
[
{
"contents": "2015"
},
{
"lookupAcs": {
"ffy": "2015",
"acsProperty": "numberUninsured"
}
},
{
"lookupAcs": {
"ffy": "2015",
"acsProperty": "numberUninsuredMoe"
}
},
{
"lookupAcs": {
"ffy": "2015",
"acsProperty": "percentUninsured"
}
},
{
"lookupAcs": {
"ffy": "2015",
"acsProperty": "percentUninsuredMoe"
}
}
],
[
{
"contents": "2016"
},
{
"lookupAcs": {
"ffy": "2016",
"acsProperty": "numberUninsured"
}
},
{
"lookupAcs": {
"ffy": "2016",
"acsProperty": "numberUninsuredMoe"
}
},
{
"lookupAcs": {
"ffy": "2016",
"acsProperty": "percentUninsured"
}
},
{
"lookupAcs": {
"ffy": "2016",
"acsProperty": "percentUninsuredMoe"
}
}
],
[
{
"contents": "2017"
},
{
"lookupAcs": {
"ffy": "2017",
"acsProperty": "numberUninsured"
}
},
{
"lookupAcs": {
"ffy": "2017",
"acsProperty": "numberUninsuredMoe"
}
},
{
"lookupAcs": {
"ffy": "2017",
"acsProperty": "percentUninsured"
}
},
{
"lookupAcs": {
"ffy": "2017",
"acsProperty": "percentUninsuredMoe"
}
}
],
[
{
"contents": "2018"
Expand Down Expand Up @@ -8636,6 +8491,7 @@
"parts": [
{
"id": "2023-03-i-01",
"title": "\u00A0",
"type": "part",
"questions": [
{
Expand All @@ -8661,12 +8517,15 @@
},
{
"id": "2023-03-i-02",
"title": "\u00A0",
"text": "Please answer the following questions for all of the state's approved HSIs as listed in section 2.2 of the CHIP state plan.",
"type": "part",
"questions": [
{
"id": "2023-03-i-02-01",
"type": "repeatables",
"addAnotherText": "Does the state have additional HSIs to report?",
"hideOptionalHint": true,
"questions": [
{
"id": "2023-03-i-02-01-01",
Expand Down
5 changes: 3 additions & 2 deletions services/ui-src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"@fortawesome/react-fontawesome": "^0.1.11",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@okta/okta-react": "^3.0.4",
"@okta/okta-auth-js": "^4.9.0",
"@okta/okta-react": "^4.1.0",
"@reach/accordion": "^0.10.5",
"@redux-devtools/extension": "^3.2.2",
"@testing-library/jest-dom": "^4.2.4",
Expand Down Expand Up @@ -39,7 +40,7 @@
"react-redux": "^8.0.1",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1",
"react-scripts": "^5.0.1",
"react-searchable-dropdown": "^1.2.5",
"react-uuid": "^1.0.2",
"redux": "4.1.0",
Expand Down
8 changes: 4 additions & 4 deletions services/ui-src/src/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@
* See the License for the specific language governing permissions and limitations under the License.
*/

import React, { useState, useEffect } from "react";
import { useState, useEffect } from "react";
import { useOktaAuth } from "@okta/okta-react";

const Profile = () => {
const { authState, authService } = useOktaAuth();
const { authState, oktaAuth } = useOktaAuth();
const [userInfo, setUserInfo] = useState(null);

useEffect(() => {
if (!authState.isAuthenticated) {
// When user isn't authenticated, forget any user info
setUserInfo(null);
} else {
authService.getUser().then((info) => {
oktaAuth.getUser().then((info) => {
setUserInfo(info);
});
}
}, [authState, authService]); // Update if authState changes
}, [authState, oktaAuth]); // Update if authState changes

if (!userInfo) {
return (
Expand Down
23 changes: 17 additions & 6 deletions services/ui-src/src/components/fields/Repeatables.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ const Repeatables = ({
removeRepeatableFrom(question.id);
};

let doYouHaveAnotherVerbiage;
if (question.addAnotherText) {
doYouHaveAnotherVerbiage = question.addAnotherText;
} else if (question.typeLabel) {
doYouHaveAnotherVerbiage = `Do you have another ${question.typeLabel} in this list?`;
} else {
doYouHaveAnotherVerbiage = `Do you have another in this list?`;
}

return (
<>
<Accordion
Expand All @@ -64,26 +73,28 @@ const Repeatables = ({
type="button"
className="add-objective ds-c-button ds-c-button--danger"
>
Delete last {type || "item"}
Delete last {question.typeLabel || "item"}
</button>
)}
</Accordion>

<div className="section-footer">
<span className="question-inner-header span-pdf-no-bookmark">
Do you have another{type ? ` ${type}` : ""} in this list?
{doYouHaveAnotherVerbiage}
</span>

<div className="ds-c-field__hint" aria-label="Hint">
Optional
</div>
{!question.hideOptionalHint && (
<div className="ds-c-field__hint" aria-label="Hint">
Optional
</div>
)}
<button
disabled={disabled}
onClick={add}
type="button"
className="add-objective ds-c-button ds-c-button--primary"
>
Add another{type && ` ${type}`}
Add another{question.typeLabel && ` ${question.typeLabel}`}
<FontAwesomeIcon icon={faPlus} />
</button>
</div>
Expand Down
52 changes: 52 additions & 0 deletions services/ui-src/src/components/fields/Repeatables.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import React from "react";
import { Provider } from "react-redux";
import configureMockStore from "redux-mock-store";
import Repeatables from "./Repeatables";
import { screen, render } from "@testing-library/react";

const mockStore = configureMockStore();
const store = mockStore({ lastYearTotals: { 2022: [] } });
const renderQuestion = async (question) =>
await render(
<Provider store={store}>
<Repeatables
question={question}
type={null}
disabled={false}
addRepeatableTo={jest.fn()}
removeRepeatableFrom={jest.fn()}
></Repeatables>
</Provider>
);

describe("Repeatables", () => {
it("should render with default verbiage", async () => {
const question = {
typeLabel: "TypeLabel",
questions: [],
};
await renderQuestion(question);
screen.getByText("Do you have another TypeLabel in this list?");
screen.getByText("Optional");
screen.getByText("Add another TypeLabel");
});

it("should hide the Optional hint when specified", async () => {
const question = {
hideOptionalHint: true,
questions: [],
};
await renderQuestion(question);
expect(screen.queryByText("Optional")).toBeNull();
});

it("should use override verbiage when specified", async () => {
const question = {
addAnotherText: "Y'all got more or what?",
questions: [],
};
await renderQuestion(question);
expect(screen.queryByText(/Do you have another/)).toBeNull();
screen.getByText("Y'all got more or what?");
});
});
Loading

0 comments on commit 452ecc4

Please sign in to comment.