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

(feat) Add export subpaths for styles #105

Merged
merged 3 commits into from
Nov 27, 2023
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: 1 addition & 3 deletions projects/ngx-formentry/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"deleteDestPath": false,
"lib": {
"entryFile": "src/public_api.ts",
"styleIncludePaths": [
"./styles"
]
"styleIncludePaths": ["./styles"]
}
}
4 changes: 4 additions & 0 deletions projects/ngx-formentry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@
"shelljs": "^0.7.8",
"slick-carousel": "^1.8.1",
"tree-model": "^1.0.7"
},
"exports": {
"./styles/ngx-formentry.css": "./styles/ngx-formentry.css",
"./styles/picker.min.css": "./styles/picker.min.css"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ describe('Diagnosis Value Adapter', () => {
// Confirm deleted diagnoses were added to the payload
expect(
payload.find(
(p) =>
p.uuid == '636bf840-a244-4e83-815f-3ba2b6ce35be' &&
p.voided
(p) => p.uuid == '636bf840-a244-4e83-815f-3ba2b6ce35be' && p.voided
)
).toBeTruthy();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ export class DiagnosisValueAdapter implements ValueAdapter {
node.question.extras
);

const isNewDiagnosis = existingDiagnoses.every((d) =>
const isNewDiagnosis = existingDiagnoses.every(
(d) =>
d.diagnosis.coded.uuid !== value[node.question.key] ||
d.certainty !== "CONFIRMED" ||
d.certainty !== 'CONFIRMED' ||
d.rank !== node.question.extras.questionOptions.rank
);

Expand Down Expand Up @@ -125,21 +126,30 @@ export class DiagnosisValueAdapter implements ValueAdapter {
}

private _getDeletedDiagnoses(
diagnosisNodes: Array<DiagnosisPayload>,
existingDiagnoses: Array<Diagnosis>
diagnosisNodes: Array<DiagnosisPayload>,
existingDiagnoses: Array<Diagnosis>
): Array<any> {
return existingDiagnoses.filter(existingDiagnosis => {
return !diagnosisNodes?.some(node => {
if (node instanceof ArrayNode) {
return node.control.value.some(value => {
return value[node.question.key] === existingDiagnosis.diagnosis.coded.uuid &&
existingDiagnosis.rank === node.question.extras.questionOptions.rank &&
existingDiagnosis.certainty === 'CONFIRMED';
});
}
return false;
});
}).map(existingDiagnosis => ({ uuid: existingDiagnosis.uuid, voided: true }));
return existingDiagnoses
.filter((existingDiagnosis) => {
return !diagnosisNodes?.some((node) => {
if (node instanceof ArrayNode) {
return node.control.value.some((value) => {
return (
value[node.question.key] ===
existingDiagnosis.diagnosis.coded.uuid &&
existingDiagnosis.rank ===
node.question.extras.questionOptions.rank &&
existingDiagnosis.certainty === 'CONFIRMED'
);
});
}
return false;
});
})
.map((existingDiagnosis) => ({
uuid: existingDiagnosis.uuid,
voided: true
}));
}

private _updatedOldDiagnoses(
Expand Down Expand Up @@ -281,7 +291,9 @@ export class DiagnosisValueAdapter implements ValueAdapter {
>;

for (let childNode of childrenNodes) {
if (childNode.control.value !== nodeAsGroup.initialValue?.primaryDiagnosisId) {
if (
childNode.control.value !== nodeAsGroup.initialValue?.primaryDiagnosisId
) {
return true;
}
}
Expand Down
16 changes: 0 additions & 16 deletions projects/ngx-formentry/src/style/app.scss

This file was deleted.

1 change: 0 additions & 1 deletion projects/ngx-formentry/styles/ngx-formentry.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import 'picker.min.css';
.ng-select {
padding-bottom: 1.25em;
min-width: 16rem;
Expand Down