mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-11-25 13:18:30 +00:00
Replace OnTheFly.js with OnTheFly.ts and introduce ThirdPartyEdit.vue for enhanced third-party entity management
- Migrated API functions in `OnTheFly.js` to `OnTheFly.ts` for improved type safety using TypeScript. - Added `ThirdPartyEdit.vue` to streamline third-party creation and editing with a Vue component structure. - Updated third-party-related types in `types.ts` to improve consistency and explicitly distinguish `company`, `contact`, and `child` entities. - Enhanced `AddPersons.vue` and dependent components to support adding third-party contacts. - Adjusted styles and removed `.btn-tpchild` for consistency in button definitions across SCSS.
This commit is contained in:
@@ -5,19 +5,29 @@ import { CreateComponentConfig } from "ChillMainAssets/types";
|
||||
import { trans, SAVE } from "translator";
|
||||
import { useTemplateRef } from "vue";
|
||||
import { Person } from "ChillPersonAssets/types";
|
||||
import {Thirdparty} from "../../../../../../ChillThirdPartyBundle/Resources/public/types";
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: "onPersonCreated", payload: { person: Person }): void;
|
||||
(e: "onThirdPartyCreated", payload: { thirdParty: Thirdparty }): void;
|
||||
(e: "close"): void;
|
||||
}>();
|
||||
|
||||
const props = defineProps<CreateComponentConfig>();
|
||||
const props = defineProps<CreateComponentConfig & {modalTitle: string}>();
|
||||
const modalDialogClass = { "modal-xl": true, "modal-scrollable": true };
|
||||
|
||||
type CreateComponentType = InstanceType<typeof Create>;
|
||||
|
||||
const create = useTemplateRef<CreateComponentType>("create");
|
||||
|
||||
const onPersonCreated = ({person}: {person: Person}): void => {
|
||||
emit("onPersonCreated", {person});
|
||||
};
|
||||
|
||||
const onThirdPartyCreated = ({tp}: {tp: Thirdparty}): void => {
|
||||
emit("onThirdPartyCreated", {thirdParty: tp});
|
||||
}
|
||||
|
||||
function save(): void {
|
||||
console.log("save from CreateModal");
|
||||
create.value?.save();
|
||||
@@ -43,7 +53,8 @@ defineExpose({ save });
|
||||
:allowedTypes="props.allowedTypes"
|
||||
:action="props.action"
|
||||
:query="props.query"
|
||||
@onPersonCreated="(payload) => emit('onPersonCreated', payload)"
|
||||
@onPersonCreated="onPersonCreated"
|
||||
@onThirdPartyCreated="onThirdPartyCreated"
|
||||
></Create>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user