Skip to content

Commit

Permalink
refactor stratify related components , fix equations to model saving (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnyama authored Aug 6, 2024
1 parent 90d8af3 commit 3c88179
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ footer {
header {
display: inline-flex;
justify-content: space-between;
padding: var(--gap-2) 0;
padding: var(--gap-4) 0;
gap: var(--gap-3);
}
header > div {
display: inline-flex;
gap: var(--gap-small);
gap: var(--gap-1);
align-items: center;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@
</div>
<div class="matrix-grid">
<template v-for="row in matrix">
<div
class="cell"
:class="{ 'filled-cell': cell.content.id }"
v-for="(cell, colIdx) in row"
:key="colIdx"
></div>
<div class="cell" :class="{ 'filled-cell': cell.content.id }" v-for="(cell, colIdx) in row" :key="colIdx" />
</template>
</div>
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,7 @@
</template>
</tera-drilldown-section>
<tera-drilldown-preview>
<section v-if="selectedModel">
<tera-model-description
:model="selectedModel"
:feature-config="{ isPreview: true }"
:generating-card="isGeneratingCard"
/>
</section>
<tera-model-description v-if="selectedModel" :model="selectedModel" :generating-card="isGeneratingCard" />
<tera-operator-placeholder v-else :node="node" style="height: 100%" />
</tera-drilldown-preview>
</tera-columnar-panel>
Expand All @@ -120,7 +114,7 @@
</tera-drilldown>
<tera-save-asset-modal
v-if="selectedModel"
:model="selectedModel"
:asset="selectedModel"
:is-visible="showSaveModelModal"
@close-modal="onCloseModelModal"
@on-save="onAddModel"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,39 @@
>
<div :tabName="StratifyTabs.Wizard">
<tera-drilldown-section class="pl-4">
<div class="form-section">
<header class="inline-flex justify-content-between">
<section>
<h5>Stratify model</h5>
<p>The model will be stratified with the following settings.</p>
<p v-if="node.state.hasCodeBeenRun" class="code-executed-warning">
Note: Code has been executed which may not be reflected here.
</p>
</section>
<section>
<Button
style="margin-right: auto"
size="small"
severity="secondary"
outlined
label="Reset"
@click="resetModel"
class="mr-2"
/>
<Button
:disabled="isStratifyButtonDisabled"
:label="stratifyButtonLabel"
size="small"
icon="pi pi-play"
@click="stratifyModel"
/>
</section>
</header>
<tera-stratification-group-form
class="mt-2"
:model-node-options="modelNodeOptions"
:config="node.state.strataGroup"
@update-self="updateStratifyGroupForm"
<template #header-controls-left>
<section>
<h5>Stratify model</h5>
<p>The model will be stratified with the following settings.</p>
<p v-if="node.state.hasCodeBeenRun" class="code-executed-warning">
Note: Code has been executed which may not be reflected here.
</p>
</section>
</template>
<template #header-controls-right>
<Button
style="margin-right: auto"
size="small"
severity="secondary"
outlined
label="Reset"
@click="resetModel"
class="mr-2"
/>
</div>
<Button
:disabled="isStratifyButtonDisabled"
:label="stratifyButtonLabel"
size="small"
icon="pi pi-play"
@click="stratifyModel"
/>
</template>
<tera-stratification-group-form
class="mt-2"
:model-node-options="modelNodeOptions"
:config="node.state.strataGroup"
@update-self="updateStratifyGroupForm"
/>
</tera-drilldown-section>
</div>
<div :tabName="StratifyTabs.Notebook">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export const extractTemplateMatrix = (templates: MiraTemplate[]) => {
const rowNames = extractConceptNames(templates, 'subject');
const colNames = extractConceptNames(templates, 'outcome');

// Not sure how to parse templates with no subejct or no outcomes
// Not sure how to parse templates with no subject or no outcomes
// and interacts with only controllers and itself, return a matrix
// with a single row for now - Mar 13, 2024
if (rowNames.length === 0 || colNames.length === 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ export const collapseTemplates = (miraModel: MiraModel) => {
if (!tempMatrixMap.has(key)) {
tempMatrixMap.set(key, []);
}

const originalTemplate = templateMap.get(t.name);
tempMatrixMap.get(key)?.push(originalTemplate as MiraTemplate);

Expand Down

0 comments on commit 3c88179

Please sign in to comment.