web/satellite: fix unlock feature inside object browser

Fixed unlock feature inside object browser.

Bug: Clicking unlock button doesn't do anything but it should open switch passphrase modal.

Change-Id: Ie7fa0f842a393c4d887f4dac63fb59edf16229ea
This commit is contained in:
Vitalii 2023-02-17 17:26:33 +02:00 committed by Vitalii Shpital
parent 8aa6110835
commit 00021e6c75
7 changed files with 35 additions and 28 deletions

View File

@ -16,6 +16,7 @@
import { useStore } from '@/utils/hooks';
import { APP_STATE_MUTATIONS } from '@/store/mutationConstants';
import { ManageProjectPassphraseStep } from '@/types/managePassphrase';
import { MODALS } from '@/utils/constants/appStatePopUps';
import TableItem from '@/components/common/TableItem.vue';
@ -25,6 +26,7 @@ const store = useStore();
* Open the modal for the current file.
*/
function openModal(): void {
store.commit(APP_STATE_MUTATIONS.TOGGLE_MANAGE_PROJECT_PASSPHRASE_MODAL_SHOWN, ManageProjectPassphraseStep.Switch);
store.commit(APP_STATE_MUTATIONS.SET_MANAGE_PASSPHRASE_STEP, ManageProjectPassphraseStep.Switch);
store.commit(APP_STATE_MUTATIONS.UPDATE_ACTIVE_MODAL, MODALS.manageProjectPassphrase);
}
</script>

View File

@ -37,6 +37,7 @@ import { Bucket } from '@/types/buckets';
import { useStore } from '@/utils/hooks';
import { APP_STATE_MUTATIONS } from '@/store/mutationConstants';
import { ManageProjectPassphraseStep } from '@/types/managePassphrase';
import { MODALS } from '@/utils/constants/appStatePopUps';
import LockedIcon from '@/../static/images/browser/locked.svg';
import CloseIcon from '@/../static/images/browser/close.svg';
@ -74,7 +75,8 @@ const objectsCount = computed((): number => {
* Opens switch passphrase modal.
*/
function openManageModal(): void {
store.commit(APP_STATE_MUTATIONS.TOGGLE_MANAGE_PROJECT_PASSPHRASE_MODAL_SHOWN, ManageProjectPassphraseStep.Switch);
store.commit(APP_STATE_MUTATIONS.SET_MANAGE_PASSPHRASE_STEP, ManageProjectPassphraseStep.Switch);
store.commit(APP_STATE_MUTATIONS.UPDATE_ACTIVE_MODAL, MODALS.manageProjectPassphrase);
}
</script>

View File

@ -94,7 +94,7 @@ function closeModal(): void {
}
onMounted(() => {
store.commit(APP_STATE_MUTATIONS.CLEAR_MANAGE_PASSPHRASE_STEP);
store.commit(APP_STATE_MUTATIONS.SET_MANAGE_PASSPHRASE_STEP, undefined);
});
</script>

View File

@ -154,7 +154,7 @@ export default class ProjectSelection extends Vue {
this.closeDropdown();
this.$store.commit(OBJECTS_MUTATIONS.CLEAR);
this.$store.commit(APP_STATE_MUTATIONS.TOGGLE_ENTER_PASSPHRASE_MODAL_SHOWN);
this.$store.commit(APP_STATE_MUTATIONS.UPDATE_ACTIVE_MODAL, MODALS.enterPassphrase);
if (this.isBucketsView) {
await this.$router.push(RouteConfig.Buckets.path).catch(() => {return; });

View File

@ -116,6 +116,9 @@ export const appStateModule = {
[APP_STATE_MUTATIONS.SET_ONB_OS](state: State, os: OnboardingOS): void {
state.appState.onbSelectedOs = os;
},
[APP_STATE_MUTATIONS.SET_MANAGE_PASSPHRASE_STEP](state: State, step: ManageProjectPassphraseStep | undefined): void {
state.appState.managePassphraseStep = step;
},
[APP_STATE_MUTATIONS.TOGGLE_ACTIVE_DROPDOWN](state: State, dropdown: string): void {
state.appState.activeDropdown = dropdown;
},

View File

@ -67,7 +67,7 @@ export const APP_STATE_MUTATIONS = {
SET_ONB_API_KEY: 'SET_ONB_API_KEY',
SET_ONB_CLEAN_API_KEY: 'SET_ONB_CLEAN_API_KEY',
SET_ONB_OS: 'SET_ONB_OS',
CLEAR_MANAGE_PASSPHRASE_STEP: 'CLEAR_MANAGE_PASSPHRASE_STEP',
SET_MANAGE_PASSPHRASE_STEP: 'SET_MANAGE_PASSPHRASE_STEP',
TOGGLE_ACTIVE_DROPDOWN: 'TOGGLE_ACTIVE_DROPDOWN',
UPDATE_ACTIVE_MODAL: 'UPDATE_ACTIVE_MODAL',
REMOVE_ACTIVE_MODAL: 'REMOVE_ACTIVE_MODAL',

View File

@ -44,29 +44,29 @@ export const APP_STATE_DROPDOWNS = {
};
enum Modals {
ADD_TEAM_MEMBER= 'addTeamMember',
EDIT_PROFILE= 'editProfile',
CHANGE_PASSWORD= 'changePassword',
CREATE_PROJECT= 'createProject',
ADD_PAYMENT_METHOD= 'addPaymentMethod',
OPEN_BUCKET= 'openBucket',
MFA_RECOVERY= 'mfaRecovery',
ENABLE_MFA= 'enableMFA',
DISABLE_MFA= 'disableMFA',
ADD_TOKEN_FUNDS= 'addTokenFunds',
SHARE_BUCKET= 'shareBucket',
SHARE_OBJECT= 'shareObject',
DELETE_BUCKET= 'deleteBucket',
CREATE_BUCKET= 'createBucket',
NEW_FOLDER= 'newFolder',
CREATE_PROJECT_PASSPHRASE= 'createProjectPassphrase',
MANAGE_PROJECT_PASSPHRASE= 'manageProjectPassphrase',
ADD_COUPON= 'addCoupon',
NEW_BILLING_ADD_COUPON= 'newBillingAddCoupon',
CREATE_PROJECT_PROMPT= 'createProjectPrompt',
UPLOAD_CANCEL_POPUP= 'uploadCancelPopup',
OBJECT_DETAILS= 'objectDetails',
ENTER_PASSPHRASE= 'enterPassphrase',
ADD_TEAM_MEMBER = 'addTeamMember',
EDIT_PROFILE = 'editProfile',
CHANGE_PASSWORD = 'changePassword',
CREATE_PROJECT = 'createProject',
ADD_PAYMENT_METHOD = 'addPaymentMethod',
OPEN_BUCKET = 'openBucket',
MFA_RECOVERY = 'mfaRecovery',
ENABLE_MFA = 'enableMFA',
DISABLE_MFA = 'disableMFA',
ADD_TOKEN_FUNDS = 'addTokenFunds',
SHARE_BUCKET = 'shareBucket',
SHARE_OBJECT = 'shareObject',
DELETE_BUCKET = 'deleteBucket',
CREATE_BUCKET = 'createBucket',
NEW_FOLDER = 'newFolder',
CREATE_PROJECT_PASSPHRASE = 'createProjectPassphrase',
MANAGE_PROJECT_PASSPHRASE = 'manageProjectPassphrase',
ADD_COUPON = 'addCoupon',
NEW_BILLING_ADD_COUPON = 'newBillingAddCoupon',
CREATE_PROJECT_PROMPT = 'createProjectPrompt',
UPLOAD_CANCEL_POPUP = 'uploadCancelPopup',
OBJECT_DETAILS = 'objectDetails',
ENTER_PASSPHRASE = 'enterPassphrase',
}
// modals could be of VueConstructor type or Object (for composition api components).