dev: instance setup workflow (#2935)

* chore: instance type updated

* chore: instance not ready screen added

* chore: instance layout added

* chore: instance magic sign in endpoint and type added

* chore: instance admin password endpoint added

* chore: instance setup page added

* chore: instance setup form added

* chore: instance layout updated

* fix: instance admin workflow setup

* fix: admin workflow setup

---------

Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
This commit is contained in:
Anmol Singh Bhatia 2023-11-29 20:33:08 +05:30 committed by sriram veeraghanta
parent ee30eb0590
commit fd5b7d20a8
25 changed files with 905 additions and 38 deletions

View file

@ -17,6 +17,7 @@ export interface IInstanceStore {
formattedConfig: IFormattedInstanceConfiguration | null;
// action
fetchInstanceInfo: () => Promise<IInstance>;
createInstance: () => Promise<IInstance>;
fetchInstanceAdmins: () => Promise<IInstanceAdmin[]>;
updateInstanceInfo: (data: Partial<IInstance>) => Promise<IInstance>;
fetchInstanceConfigurations: () => Promise<any>;
@ -45,6 +46,7 @@ export class InstanceStore implements IInstanceStore {
formattedConfig: computed,
// actions
fetchInstanceInfo: action,
createInstance: action,
fetchInstanceAdmins: action,
updateInstanceInfo: action,
fetchInstanceConfigurations: action,
@ -84,6 +86,22 @@ export class InstanceStore implements IInstanceStore {
}
};
/**
* Creating new Instance In case of no instance found
*/
createInstance = async () => {
try {
const instance = await this.instanceService.createInstance();
runInAction(() => {
this.instance = instance;
});
return instance;
} catch (error) {
console.log("Error while creating the instance");
throw error;
}
};
/**
* fetch instance admins from API
*/