Skip to content

Commit

Permalink
Merge branch 'main' into crowd-linux
Browse files Browse the repository at this point in the history
  • Loading branch information
gaspergrom committed Aug 18, 2023
2 parents 1051329 + 2b3d372 commit e7dfe51
Show file tree
Hide file tree
Showing 31 changed files with 158 additions and 151 deletions.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.5.0",
"private": true,
"scripts": {
"lint": "eslint \"{src,tests}/**/*.{js,ts}\" --max-warnings=0",
"lint": "eslint \"{src,tests}/**/*.{js,ts,vue}\" --max-warnings=0",
"lint:fix": "npm run lint -- --fix",
"build:localhost": "vite build --mode localhost",
"build:production": "vite build --mode prod",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<i class="ri-information-line font-medium text-lg text-blue-600 leading-none" />
</span>
<p class="text-sm text-gray-500 font-medium mt-1">
The following attributes, auto-generated by crowd.dev, are only mapped into HubSpot, and won't be overwritten if their value is updated on your HubSpot account.
The following attributes, auto-generated by crowd.dev, are only mapped into HubSpot,
and won't be overwritten if their value is updated on your HubSpot account.
</p>
</div>
</template>
Expand Down Expand Up @@ -44,7 +45,7 @@

<script setup>
import {
defineEmits, defineProps, computed, h, ref,
defineEmits, defineProps, computed, ref,
} from 'vue';
import AppDialog from '@/shared/dialog/dialog.vue';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@
<app-hubspot-read-only-attr-popover
v-model="isReadOnlyConfirmModalVisible"
:attributes="readOnlyAttributes"
@update:modelValue="isReadOnlyConfirmModalVisible = $event"
@doNotShowModal="handleDoNotShowModal"
@update:model-value="isReadOnlyConfirmModalVisible = $event"
@do-not-show-modal="handleDoNotShowModal"
@continue="handleContinue"
/>
</template>
Expand Down Expand Up @@ -393,7 +393,6 @@ const update = () => {
};
const executeUpdate = (data: HubspotOnboard) => {
loading.value = true;
HubspotApiService.finishOnboard(data)
.then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,6 @@ const activeIntegrations = computed(() => {
}));
});
const isMemberIdentity = computed(() => props.entityType === 'member');
const loading = ref(true);
const platform = ref(null);
const query = ref('');
Expand Down
1 change: 0 additions & 1 deletion frontend/src/modules/auth/pages/callback.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import { onMounted } from 'vue';
import { Auth0Service } from '@/shared/services/auth0.service';
import { mapActions } from '@/shared/vuex/vuex.helpers';
import { useRoute, useRouter } from 'vue-router';
const { doSigninWithAuth0 } = mapActions('auth');
Expand Down
31 changes: 0 additions & 31 deletions frontend/src/modules/auth/pages/profile-form-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ import {
} from 'vue';
import isEqual from 'lodash/isEqual';
import { useRouter } from 'vue-router';
import { i18n } from '@/i18n';
import { FormSchema } from '@/shared/form/form-schema';
import { UserModel } from '@/modules/user/user-model';
import useVuelidate from '@vuelidate/core';
Expand Down Expand Up @@ -222,36 +221,6 @@ const passwordModel = ref(null);
// Form rules
const profileRules = ref(profileFormSchema.value.rules());
const passwordRules = computed(() => {
const rules = passwordFormSchema.value.rules();
const passwordConfirmationValidator = (
_rule,
value,
callback,
) => {
if (
value !== passwordModel.value[fields.newPassword.name]
) {
callback(
new Error(i18n('auth.passwordChange.mustMatch')),
);
} else {
callback();
}
};
return {
...rules,
[fields.newPasswordConfirmation.name]: [
...rules[fields.newPasswordConfirmation.name],
{
validator: passwordConfirmationValidator,
trigger: 'blur',
},
],
};
});
// Form validations
const hasProfileModelChanged = computed(() => !isEqual(
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/modules/auth/pages/terms-and-privacy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</template>

<script>
import { mapActions, mapGetters } from "vuex";
import { mapActions, mapGetters } from 'vuex';
import { UserModel } from '@/modules/user/user-model';
import { AuthService } from '@/modules/auth/auth-service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,16 @@

<script setup>
import {
computed, defineProps, defineEmits, reactive, ref, watch, onMounted,
computed, defineProps, defineEmits, reactive, ref, onMounted,
} from 'vue';
import AppDrawer from '@/shared/drawer/drawer.vue';
import { email, required } from '@vuelidate/validators';
import { required } from '@vuelidate/validators';
import useVuelidate from '@vuelidate/core';
import AppFormItem from '@/shared/form/form-item.vue';
import { useAutomationStore } from '@/modules/automation/store';
import Message from '@/shared/message/message';
import { i18n } from '@/i18n';
import formChangeDetector from '@/shared/form/form-change';
import { useStore } from 'vuex';
import { automationTypes } from '../config/automation-types';
const props = defineProps({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const canAddAutomation = () => {
currentTenant.value.plan,
);
if(planWorkflowCountMax === 'unlimited'){
if (planWorkflowCountMax === 'unlimited') {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,11 @@
<script setup>
import {
computed, ref, getCurrentInstance
computed, ref,
} from 'vue';
import moment from 'moment';
import AppLfMemberFormSubprojectsModal from '@/modules/lf/member/components/form/lf-member-form-subprojects-modal.vue';
const emit = defineEmits(['update:modelValue']);
const props = defineProps({
modelValue: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
class="attributes-form mt-1 mb-5"
label-position="top"
>

<el-form-item
label="Choose attribute"
class="mb-6"
required="true"
>
<app-bulk-edit-attribute-dropdown v-model="attributesData" @change="handleDropdownChange" @clear="handleDropdownClear" />
</el-form-item>

<el-form-item
label="Choose attribute"
class="mb-6"
required="true"
>
<app-bulk-edit-attribute-dropdown v-model="attributesData" @change="handleDropdownChange" @clear="handleDropdownClear" />
</el-form-item>

<!-- Show value field only if attribute is selected -->
<div v-if="Object.keys(selectedAttribute).length > 0">
<el-form-item
Expand Down Expand Up @@ -74,7 +73,9 @@

<div v-if="selectedAttribute.type === 'multiSelect'" class="flex items-center gap-2 -mt-2">
<i class="ri-information-line text-gray-400 text-lg " />
<span class="text-xs leading-5 text-gray-500">Values will be added to each selected member and the existing ones won’t be overwritten.</span>
<span class="text-xs leading-5 text-gray-500">
Values will be added to each selected member and the existing ones won’t be overwritten.
</span>
</div>

<div v-else class="rounded-md bg-yellow-50 border border-yellow-100 flex items-center gap-2 py-2 px-4 mt-6">
Expand All @@ -89,7 +90,7 @@
<el-button class="btn btn--bordered btn--md mr-3" @click="handleCancel">
Cancel
</el-button>
<el-button class="btn btn--primary btn--md" @click="handleSubmit" :disabled="!hasFormChanged">
<el-button class="btn btn--primary btn--md" :disabled="!hasFormChanged" @click="handleSubmit">
Submit
</el-button>
</div>
Expand Down Expand Up @@ -192,7 +193,7 @@ watch(
},
);
// since we have multi-select input for both the organizations and custom attributes,
// since we have multi-select input for both the organizations and custom attributes,
// need to dynamically set the appropriate methods based on the context.
const multiSelectFetchFn = computed(() => {
if (selectedAttribute.value.name === 'organizations') {
Expand Down Expand Up @@ -341,7 +342,7 @@ const handleSubmit = async () => {
|| formModel.value.attributes) && {
attributes: {
...(Object.keys(formattedAttributes).length
&& formattedAttributes)
&& formattedAttributes),
},
},
};
Expand Down
31 changes: 26 additions & 5 deletions frontend/src/modules/member/components/list/member-list-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ import { useLfSegmentsStore } from '@/modules/lf/segments/store';
import { getSegmentsFromProjectGroup } from '@/utils/segments';
import AppMemberMergeDialog from '@/modules/member/components/member-merge-dialog.vue';
import AppTagPopover from '@/modules/tag/components/tag-popover.vue';
import AppPagination from '@/shared/pagination/pagination.vue';
import AppMemberBadge from '../member-badge.vue';
import AppMemberDropdown from '../member-dropdown.vue';
import AppMemberIdentities from '../member-identities.vue';
Expand All @@ -442,8 +443,6 @@ const isScrollbarVisible = ref(false);
const isTableHovered = ref(false);
const isCursorDown = ref(false);
const emit = defineEmits(['onAddMember']);
const isMergeDialogOpen = ref(null);
const isEditTagsDialogOpen = ref(false);
const editTagMember = ref(null);
Expand All @@ -461,8 +460,17 @@ const props = defineProps({
type: Boolean,
default: () => true,
},
pagination: {
type: Object,
default: () => ({
page: 1,
perPage: 20,
}),
},
});
const emit = defineEmits(['onAddMember', 'update:pagination']);
const memberStore = useMemberStore();
const {
members, totalMembers, filters, selectedMembers, savedFilterBody,
Expand Down Expand Up @@ -524,7 +532,14 @@ const emailsColumnWidth = computed(() => {
});
const selectedRows = computed(() => selectedMembers.value);
const pagination = computed(() => filters.value.pagination);
const pagination = computed({
get() {
return props.pagination;
},
set(value) {
emit('update:pagination', value);
},
});
const tableWidth = ref(0);
Expand All @@ -548,11 +563,17 @@ function doChangeSort(sorter) {
}
function doChangePaginationCurrentPage(currentPage) {
filters.value.pagination.page = currentPage;
emit('update:pagination', {
...pagination.value,
page: currentPage,
});
}
function doChangePaginationPageSize(pageSize) {
filters.value.pagination.perPage = pageSize;
emit('update:pagination', {
page: 1,
perPage: pageSize,
});
}
function translate(key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,15 @@
</template>
</el-dropdown>

<app-tag-popover v-model="bulkTagsUpdateVisible"
@reload="fetchMembers({ reload: true })" />
<app-tag-popover
v-model="bulkTagsUpdateVisible"
@reload="fetchMembers({ reload: true })"
/>

<app-bulk-edit-attribute-popover
v-model="bulkAttributesUpdateVisible"
@reload="fetchMembers({ reload: true })"
/>

</div>
</template>

Expand Down
33 changes: 25 additions & 8 deletions frontend/src/modules/member/pages/member-list-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@
@fetch="fetch($event)"
/>
<app-member-list-table
v-model:pagination="pagination"
:has-integrations="hasIntegrations"
:has-members="membersCount > 0"
:is-page-loading="loading"
@update:pagination="onPaginationChange"
@on-add-member="isSubProjectSelectionOpen = true"
/>
</div>
Expand All @@ -90,7 +92,9 @@ import AppPageWrapper from '@/shared/layout/page-wrapper.vue';
import CrFilter from '@/shared/modules/filters/components/Filter.vue';
import { useMemberStore } from '@/modules/member/store/pinia';
import { storeToRefs } from 'pinia';
import { ref, onMounted, computed } from 'vue';
import {
ref, onMounted, computed,
} from 'vue';
import { MemberService } from '@/modules/member/member-service';
import { MemberPermissions } from '@/modules/member/member-permissions';
import { mapGetters } from '@/shared/vuex/vuex.helpers';
Expand Down Expand Up @@ -127,6 +131,11 @@ const hasPermissionToCreate = computed(() => new MemberPermissions(
currentUser.value,
)?.create);
const pagination = ref({
page: 1,
perPage: 20,
});
const isCreateLockedForSampleData = computed(() => new MemberPermissions(
currentTenant.value,
currentUser.value,
Expand Down Expand Up @@ -173,27 +182,35 @@ const showLoading = (filter: any, body: any): boolean => {
};
const fetch = ({
filter,
offset,
limit,
orderBy,
body,
filter, orderBy, body,
}: FilterQuery) => {
if (!loading.value) {
loading.value = showLoading(filter, body);
}
pagination.value.page = 1;
fetchMembers({
body: {
...body,
filter,
offset,
limit,
offset: 0,
limit: pagination.value.perPage,
orderBy,
},
}).finally(() => {
loading.value = false;
});
};
const onPaginationChange = ({
page, perPage,
}: FilterQuery) => {
fetchMembers({
reload: true,
body: {
offset: (page - 1) * perPage || 0,
limit: perPage || 20,
},
});
};
const onAddMember = () => {
isSubProjectSelectionOpen.value = true;
Expand Down
Loading

0 comments on commit e7dfe51

Please sign in to comment.