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: "" }) apiServer!: string;
|
||||
@Prop({ required: true }) dialogType!: "admit" | "visibility";
|
||||
@Prop({ required: true }) title!: string;
|
||||
@Prop({ required: true }) description!: string;
|
||||
@Prop({ required: true }) buttonText!: string;
|
||||
@Prop({ required: true }) emptyStateText!: string;
|
||||
@Prop({ required: true }) isOrganizer!: boolean;
|
||||
|
||||
// Vue notification system
|
||||
$notify!: (
|
||||
@@ -187,6 +184,28 @@ export default class BulkMembersDialog extends Vue {
|
||||
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() {
|
||||
this.notify = createNotifyHelpers(this.$notify);
|
||||
}
|
||||
|
||||
@@ -203,18 +203,7 @@
|
||||
:active-did="activeDid"
|
||||
:api-server="apiServer"
|
||||
:dialog-type="isOrganizer ? 'admit' : 'visibility'"
|
||||
:title="isOrganizer ? 'Admit Pending Members' : 'Add Members to Contacts'"
|
||||
: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'
|
||||
"
|
||||
:is-organizer="isOrganizer"
|
||||
@close="closeBulkMembersDialogCallback"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user