forked from jsnbuchanan/crowd-funder-for-time-pwa
refactor: move display text logic to BulkMembersDialog component
- Replace individual text props with single isOrganizer boolean prop - Add computed properties for title, description, buttonText, and emptyStateText - Simplify parent component interface by removing text prop passing - Update quote style from single to double quotes for consistency - Improve component encapsulation and maintainability
This commit is contained in:
@@ -145,10 +145,7 @@ export default class BulkMembersDialog extends Vue {
|
|||||||
@Prop({ default: "" }) activeDid!: string;
|
@Prop({ default: "" }) activeDid!: string;
|
||||||
@Prop({ default: "" }) apiServer!: string;
|
@Prop({ default: "" }) apiServer!: string;
|
||||||
@Prop({ required: true }) dialogType!: "admit" | "visibility";
|
@Prop({ required: true }) dialogType!: "admit" | "visibility";
|
||||||
@Prop({ required: true }) title!: string;
|
@Prop({ required: true }) isOrganizer!: boolean;
|
||||||
@Prop({ required: true }) description!: string;
|
|
||||||
@Prop({ required: true }) buttonText!: string;
|
|
||||||
@Prop({ required: true }) emptyStateText!: string;
|
|
||||||
|
|
||||||
// Vue notification system
|
// Vue notification system
|
||||||
$notify!: (
|
$notify!: (
|
||||||
@@ -187,6 +184,28 @@ export default class BulkMembersDialog extends Vue {
|
|||||||
return selectedCount > 0 && selectedCount < this.membersData.length;
|
return selectedCount > 0 && selectedCount < this.membersData.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get title() {
|
||||||
|
return this.isOrganizer
|
||||||
|
? "Admit Pending Members"
|
||||||
|
: "Add Members to Contacts";
|
||||||
|
}
|
||||||
|
|
||||||
|
get description() {
|
||||||
|
return this.isOrganizer
|
||||||
|
? "Would you like to admit these members to the meeting and add them to your contacts?"
|
||||||
|
: "Would you like to add these members to your contacts?";
|
||||||
|
}
|
||||||
|
|
||||||
|
get buttonText() {
|
||||||
|
return this.isOrganizer ? "Admit + Add to Contacts" : "Add to Contacts";
|
||||||
|
}
|
||||||
|
|
||||||
|
get emptyStateText() {
|
||||||
|
return this.isOrganizer
|
||||||
|
? "No pending members to admit"
|
||||||
|
: "No members are not in your contacts";
|
||||||
|
}
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.notify = createNotifyHelpers(this.$notify);
|
this.notify = createNotifyHelpers(this.$notify);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,18 +203,7 @@
|
|||||||
:active-did="activeDid"
|
:active-did="activeDid"
|
||||||
:api-server="apiServer"
|
:api-server="apiServer"
|
||||||
:dialog-type="isOrganizer ? 'admit' : 'visibility'"
|
:dialog-type="isOrganizer ? 'admit' : 'visibility'"
|
||||||
:title="isOrganizer ? 'Admit Pending Members' : 'Add Members to Contacts'"
|
:is-organizer="isOrganizer"
|
||||||
:description="
|
|
||||||
isOrganizer
|
|
||||||
? 'Would you like to admit these members to the meeting and add them to your contacts?'
|
|
||||||
: 'Would you like to add these members to your contacts?'
|
|
||||||
"
|
|
||||||
:button-text="isOrganizer ? 'Admit + Add to Contacts' : 'Add to Contacts'"
|
|
||||||
:empty-state-text="
|
|
||||||
isOrganizer
|
|
||||||
? 'No pending members to admit'
|
|
||||||
: 'No members are not in your contacts'
|
|
||||||
"
|
|
||||||
@close="closeBulkMembersDialogCallback"
|
@close="closeBulkMembersDialogCallback"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user