Skip to content

Commit

Permalink
refactor: del redundant ToDo comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Iogsotot committed May 28, 2024
1 parent 8cbd283 commit 2bdc2b3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
13 changes: 3 additions & 10 deletions src/features/locators/locators.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,11 @@ const locatorsSlice = createSlice({
state,
{ payload }: PayloadAction<{ elementId?: ElementId; priority: LocatorCalculationPriority; ids?: ElementId[] }>,
) {
// ToDo: fix legacy naming
// eslint-disable-next-line @typescript-eslint/naming-convention
const { elementId, ids, priority } = payload;
if (elementId) locatorsAdapter.upsertOne(state, { elementId, priority } as ILocator);
if (ids) {
// ToDo: fix legacy naming
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-shadow
// TODO: fix legacy naming
// eslint-disable-next-line @typescript-eslint/no-shadow
const newValue: Partial<ILocator>[] = ids.map((elementId) => ({ elementId, priority }));
locatorsAdapter.upsertMany(state, newValue as ILocator[]);
}
Expand Down Expand Up @@ -216,8 +214,6 @@ const locatorsSlice = createSlice({
locatorsAdapter.upsertMany(state, locators.map(({ elementId }) => ({ elementId, isGenerated })) as ILocator[]);
},
setJdnHash(state, { payload }: PayloadAction<{ elementId: ElementId; jdnHash: string }>) {
// ToDo: fix legacy naming
// eslint-disable-next-line @typescript-eslint/naming-convention
const { elementId, jdnHash } = payload;
locatorsAdapter.upsertOne(state, { elementId, jdnHash } as ILocator);
},
Expand Down Expand Up @@ -249,16 +245,13 @@ const locatorsSlice = createSlice({
// ToDo isGenerated refactoring
const locator = typeof payload === 'string' ? simpleSelectLocatorById(state, payload) : payload;
if (!locator) return;
// ToDo: fix legacy naming
// eslint-disable-next-line @typescript-eslint/naming-convention
const { isGenerated, elementId } = locator;
locatorsAdapter.upsertOne(state, { elementId, isGenerated: !isGenerated } as ILocator);
},
toggleLocatorIsChecked(state, { payload }: PayloadAction<string>) {
const locator = simpleSelectLocatorById(state, payload);
if (!locator) return;
// ToDo: fix legacy naming
// eslint-disable-next-line @typescript-eslint/naming-convention

const { isChecked, elementId } = locator;
locatorsAdapter.upsertOne(state, { elementId, isChecked: !isChecked } as ILocator);
},
Expand Down
3 changes: 1 addition & 2 deletions src/features/locators/reducers/addCustomLocator.thunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ export const addCustomLocator = createAsyncThunk(
let foundElementText;
let originalCssSelector = '';
let fullXpath = '';
// ToDo: fix legacy naming
// eslint-disable-next-line @typescript-eslint/naming-convention

const elementId = `${generateId()}_${pageObjectId}`;

if (getLocatorValidationStatus(message) === ValidationStatus.SUCCESS) {
Expand Down
2 changes: 0 additions & 2 deletions src/features/locators/reducers/changeLocatorElement.thunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ type ChangeLocatorElementPayload = ChangeLocatorAttributesPayload;
export const changeLocatorElement = createAsyncThunk(
'locators/changeLocatorElement',
async (payload: ChangeLocatorElementPayload, thunkAPI) => {
// ToDo: fix legacy naming
// eslint-disable-next-line @typescript-eslint/naming-convention
const { locatorValue, elementId, locatorType, ...rest } = payload;

const state = thunkAPI.getState() as RootState;
Expand Down
1 change: 0 additions & 1 deletion src/features/locators/reducers/identifyElements.thunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ export const onLocatorsCreated: Middleware = (store) => (next) => (action) => {
const { generateXpath, generateCssSelector } = selectAutoGeneratingLocatorTypes(state as RootState);
// generateCssSelector: false because it's run with attributes generation for performance reasons
// ToDo: take generateCssSelector from selectAutoGeneratingLocatorTypes, when backend will be ready
// console.log('generateCssSelector: ', generateCssSelector); // LOG
// @ts-ignore
store.dispatch(runLocatorsGeneration({ locators, generateXpath, generateCssSelector }));
}
Expand Down

0 comments on commit 2bdc2b3

Please sign in to comment.